{"id":23769498,"url":"https://github.com/mohsen104/divar-backend","last_synced_at":"2026-03-28T20:30:15.587Z","repository":{"id":266743510,"uuid":"899227488","full_name":"mohsen104/divar-backend","owner":"mohsen104","description":"A backend service for managing categories, options, user authentication, and other core functionalities for a marketplace-like application.","archived":false,"fork":false,"pushed_at":"2024-12-21T13:10:48.000Z","size":51,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-01T02:21:45.816Z","etag":null,"topics":["backend","express-js","jwt","jwt-authentication","node-js"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mohsen104.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-05T21:16:30.000Z","updated_at":"2024-12-21T13:10:52.000Z","dependencies_parsed_at":"2024-12-05T22:32:31.570Z","dependency_job_id":null,"html_url":"https://github.com/mohsen104/divar-backend","commit_stats":null,"previous_names":["mohsen104/divar-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2Fdivar-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2Fdivar-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2Fdivar-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mohsen104%2Fdivar-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mohsen104","download_url":"https://codeload.github.com/mohsen104/divar-backend/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239950625,"owners_count":19723721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backend","express-js","jwt","jwt-authentication","node-js"],"created_at":"2025-01-01T02:21:27.627Z","updated_at":"2026-03-28T20:30:15.529Z","avatar_url":"https://github.com/mohsen104.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Divar Backend Project\n\nA backend service for managing categories, options, user authentication, and other core functionalities for a marketplace-like application.\n\n\n## 📜 Features\n- **Authentication**: \n  - Login with OTP, check OTP, and logout functionalities.\n- **Category Management**: \n  - Create, fetch, and delete categories.\n- **Option Management**: \n  - Add, update, fetch, and delete options for categories.\n- **User Profile**: \n  - Fetch user profile information.\n- **API Documentation**: \n  - Swagger documentation for all endpoints.\n\n\n## 🚀 Technologies Used\n- **Node.js**: Runtime environment.\n- **Express.js**: Web framework.\n- **MongoDB**: NoSQL database (via Mongoose).\n- **JWT**: Authentication tokens.\n- **Swagger UI**: API documentation.\n- **Multer**: File uploads.\n- **dotenv**: Environment variable management.\n\n\n## 🔧 Getting Started\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/mohsen104/divar-backend.git\n   cd divar-backend\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Create a `.env` file in the root directory with the following variables:\n   ```env\n   PORT\n   NODE_ENV\n   MONGODB_URL\n   JWT_SECRET_KEY\n   COOKIE_SECRET_KEY\n   MAP_IR_URL\n   MAP_API_KEY\n   ```\n\n4. Run the development server:\n   ```bash\n   npm run dev\n   ```\n\n5. Access the Swagger documentation at:\n   ```\n   http://localhost:3000/api-docs\n   ```\n\n## 📘 API Documentation\n\nAPI documentation is available through Swagger at `/api-docs`.\n\n### Authentication\n- **POST** `/auth/send-otp`: Login with OTP.\n- **POST** `/auth/check-otp`: Verify OTP for login.\n- **GET** `/auth/logout`: Logout user.\n\n### Category Management\n- **POST** `/category`: Create a new category.\n- **GET** `/category`: Fetch all categories.\n- **DELETE** `/category/{id}`: Delete a category by ID.\n\n### Option Management\n- **POST** `/option`: Create a new option for a category.\n- **GET** `/option`: Fetch all options.\n- **PUT** `/option/{id}`: Update an option by ID.\n- **DELETE** `/option/{id}`: Delete an option by ID.\n- **GET** `/option/by-category/{categoryId}`: Fetch options for a category by ID.\n- **GET** `/option/by-category-slug/{slug}`: Fetch options for a category by slug.\n\n### User Profile\n- **GET** `/user/whoami`: Fetch current user profile.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohsen104%2Fdivar-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohsen104%2Fdivar-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohsen104%2Fdivar-backend/lists"}