{"id":30429592,"url":"https://github.com/vermaharsha/user-management-api","last_synced_at":"2026-04-08T20:43:28.642Z","repository":{"id":307305312,"uuid":"943223134","full_name":"vermaharsha/user-management-api","owner":"vermaharsha","description":"A backend service providing secure authentication, role-based access, and RESTful APIs for managing users, products, and a dashboard.","archived":false,"fork":false,"pushed_at":"2025-07-30T13:43:22.000Z","size":1817,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-08T20:43:26.492Z","etag":null,"topics":["bycrpt","ejs","express-js","jwt","mongodb","mongoose","node-js","restful-api"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vermaharsha.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,"zenodo":null}},"created_at":"2025-03-05T11:06:45.000Z","updated_at":"2025-07-30T13:43:26.000Z","dependencies_parsed_at":"2025-07-30T16:14:25.783Z","dependency_job_id":"b90334dd-8c2f-4c68-a8ee-2916adb1d806","html_url":"https://github.com/vermaharsha/user-management-api","commit_stats":null,"previous_names":["vermaharsha/user-management-api"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vermaharsha/user-management-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vermaharsha%2Fuser-management-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vermaharsha%2Fuser-management-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vermaharsha%2Fuser-management-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vermaharsha%2Fuser-management-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vermaharsha","download_url":"https://codeload.github.com/vermaharsha/user-management-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vermaharsha%2Fuser-management-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31573788,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["bycrpt","ejs","express-js","jwt","mongodb","mongoose","node-js","restful-api"],"created_at":"2025-08-22T17:33:20.835Z","updated_at":"2026-04-08T20:43:28.612Z","avatar_url":"https://github.com/vermaharsha.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# User Management API\n\n## Project Summary\nA backend service built with Node.js, Express, and MongoDB (using Mongoose). The service provides a robust RESTful API for managing users and products while ensuring secure authentication and role-based access control. A simple dashboard is also included to help manage data visually.\n\n## Features\n- **User \u0026 Product Management:**  \n  - Full CRUD operations for users and products.\n- **Secure Authentication:**  \n  - Uses JSON Web Tokens (JWT) for authentication.\n  - Passwords are securely hashed with bcrypt.\n- **Role-Based Access Control:**  \n  - Enforces different access levels (Admin, Seller, Customer) for various endpoints.\n- **Clean and Modular Architecture:**  \n  - Easy to extend and maintain.\n\n## Tech Stack\n- **Backend:** Node.js, Express.js\n- **Frontend:** Ejs \n- **Database:** MongoDB with Mongoose\n- **Authentication:** JWT, bcrypt.js\n- **Utilities:** dotenv, nodemon, morgan, cors\n\n## Installation \u0026 Setup\n\n1. **Clone the Repository:**\n   ```bash\n   git clone https://github.com/yourusername/BlueMedix.git\n   cd BlueMedix\n   ```\n\n2. **Install Dependencies:**\n   ```bash\n   npm install\n   ```\n\n3. **Configure Environment Variables:**\n   Create a `.env` file in the root directory with the following:\n   ```dotenv\n   PORT=3000\n   MONGO_URI=mongodb://localhost:27017/bluemedix\n   JWT_SECRET=your_jwt_secret\n   ```\n\n4. **Run the Application:**\n   ```bash\n   npm run dev\n   ```\n   The server should now run on `http://localhost:3000` and connect to your MongoDB instance.\n\n## API Endpoints\n\n### Authentication\n- **Register User:**  \n  - **Method:** POST  \n  - **URL:** `/api/auth/register`  \n  - **Description:** Creates a new user.\n  \n- **Login User:**  \n  - **Method:** POST  \n  - **URL:** `/api/auth/login`  \n  - **Description:** Authenticates a user and returns a JWT token.\n\n### User Management (Admin \u0026 Authenticated Users)\n- **Get All Users:**  \n  - **Method:** GET  \n  - **URL:** `/api/users`  \n  - **Description:** Retrieves a list of all users (admin-only).\n  \n- **Get Single User:**  \n  - **Method:** GET  \n  - **URL:** `/api/users/:id`  \n  - **Description:** Retrieves details of a specific user.\n  \n- **Update User:**  \n  - **Method:** PUT  \n  - **URL:** `/api/users/:id`  \n  - **Description:** Updates user information.\n  \n- **Delete User:**  \n  - **Method:** DELETE  \n  - **URL:** `/api/users/:id`  \n  - **Description:** Deletes a user (admin-only).\n\n### Product Management\n- **Get All Products:**  \n  - **Method:** GET  \n  - **URL:** `/api/products`  \n  - **Description:** Retrieves all products.\n  \n- **Create Product:**  \n  - **Method:** POST  \n  - **URL:** `/api/products`  \n  - **Description:** Creates a new product (accessible to sellers/admins).\n  \n- **Update Product:**  \n  - **Method:** PUT  \n  - **URL:** `/api/products/:id`  \n  - **Description:** Updates product details.\n  \n- **Delete Product:**  \n  - **Method:** DELETE  \n  - **URL:** `/api/products/:id`  \n  - **Description:** Deletes a product.\n\n\u003e **Note:** For protected routes, include the following header:\n\u003e ```\n\u003e Authorization: Bearer \u003cyour_jwt_token\u003e\n\u003e ```\n\n## Visual Overview\n\n### User Register\n![Register](https://github.com/user-attachments/assets/c56da892-76e3-4129-a503-6d7852bd2f5f)\n\n### User Login\n![Login](https://github.com/user-attachments/assets/838813fb-40fa-47cb-845f-2a4bf1def16f)\n\n### MongoDB \n![Screenshot 2025-03-05 184019](https://github.com/user-attachments/assets/0755225d-509f-49d4-90bd-de563a6b3d02)\n\n\n## Future Enhancements\n- **Implement Caching:** Add Redis for caching frequent queries.\n- **Automated Testing:** Integrate unit and integration tests.\n- **Enhanced Error Handling:** Improve logging and error responses.\n\n---\n## Author 💻\nMade with love by [Harsha Verma](https://github.com/vermaharsha)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvermaharsha%2Fuser-management-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvermaharsha%2Fuser-management-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvermaharsha%2Fuser-management-api/lists"}