{"id":22119830,"url":"https://github.com/moonman369/blinkmart-server","last_synced_at":"2026-05-02T15:35:41.675Z","repository":{"id":265755809,"uuid":"896586560","full_name":"moonman369/BlinkMart-Server","owner":"moonman369","description":"This is the server side code for a real life quick commerce application clone","archived":false,"fork":false,"pushed_at":"2025-03-19T20:17:39.000Z","size":73,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T21:34:39.264Z","etag":null,"topics":["backend","ecommerce-website","full-stack","jwt","mern","nodejs","nosql","quick-commerce"],"latest_commit_sha":null,"homepage":"https://api.blinkmart.projects.moonman.in","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/moonman369.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-11-30T18:58:24.000Z","updated_at":"2025-03-19T20:17:43.000Z","dependencies_parsed_at":"2024-11-30T20:19:32.860Z","dependency_job_id":"cb4e7e2f-a0b4-4903-b6cb-cb198b952e10","html_url":"https://github.com/moonman369/BlinkMart-Server","commit_stats":null,"previous_names":["moonman369/blinkmart-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonman369%2FBlinkMart-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonman369%2FBlinkMart-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonman369%2FBlinkMart-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moonman369%2FBlinkMart-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moonman369","download_url":"https://codeload.github.com/moonman369/BlinkMart-Server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245219537,"owners_count":20579604,"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","ecommerce-website","full-stack","jwt","mern","nodejs","nosql","quick-commerce"],"created_at":"2024-12-01T14:17:38.496Z","updated_at":"2026-05-02T15:35:41.670Z","avatar_url":"https://github.com/moonman369.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BlinkMart Server\n\nWelcome to the **BlinkMart Server** repository!  \nThis project powers the backend for BlinkMart, a modern e-commerce platform built with Node.js, Express, and MongoDB.\n\n---\n\n## 🚀 Features\n\n- **RESTful API** for products, categories, users, cart, orders, and addresses\n- **JWT Authentication** with role-based access (User/Admin)\n- **Razorpay Payment Integration** (COD \u0026 Online)\n- **Order \u0026 Cart Management** with real-time updates\n- **Address Book** for multiple delivery addresses\n- **Razorpay Webhook Support** for payment events\n- **Email Verification** for new users\n- **Comprehensive Error Handling** with meaningful messages\n\n---\n\n## 🛠️ Tech Stack\n\n- **Node.js** / **Express.js**\n- **MongoDB** (Mongoose)\n- **JWT** Authentication\n- **Razorpay** Payment Gateway\n- **Nodemailer** for email services\n- **Socket.IO** (optional)\n- **Docker** (optional)\n\n---\n\n## 📦 Getting Started\n\n1. **Clone the repository**\n\n   ```bash\n   git clone https://github.com/your-username/BlinkMart-Server.git\n   cd BlinkMart-Server\n   ```\n\n2. **Install dependencies**\n\n   ```bash\n   npm install\n   ```\n\n3. **Configure environment variables**  \n   Create a `.env` file in the root directory with the following:\n\n   ```\n   PORT=5000\n   MONGODB_URI=your_mongodb_connection_string\n   JWT_SECRET=your_jwt_secret\n   JWT_EXPIRY=7d\n   \n   RAZORPAY_KEY_ID=your_razorpay_key_id\n   RAZORPAY_KEY_SECRET=your_razorpay_key_secret\n   RAZORPAY_WEBHOOK_SECRET=your_razorpay_webhook_secret\n   \n   EMAIL_USER=your_email@example.com\n   EMAIL_PASS=your_email_password\n   FRONTEND_URL=https://your-frontend-url.com\n   ```\n\n4. **Run the server**\n   ```bash\n   npm run dev\n   ```\n\n---\n\n## 📚 API Endpoints\n\n### Auth\n\n| Method | Endpoint                | Description         |\n|--------|------------------------ |--------------------|\n| POST   | `/api/v1/auth/register` | Register user      |\n| POST   | `/api/v1/auth/login`    | Login user         |\n| POST   | `/api/v1/auth/send-verification-email` | Send verification email |\n| GET    | `/api/v1/auth/verify-email` | Verify email token |\n\n### Products\n\n| Method | Endpoint                          | Description           |\n|--------|-----------------------------------|-----------------------|\n| GET    | `/api/v1/product/get-all-products`| List all products     |\n| GET    | `/api/v1/product/get-product/:id` | Get product by ID     |\n| POST   | `/api/v1/product/create-product`  | Create product (Admin)|\n| PUT    | `/api/v1/product/update-product/:id` | Update product (Admin)|\n| DELETE | `/api/v1/product/delete-product/:id` | Delete product (Admin)|\n\n### Categories \u0026 Subcategories\n\n| Method | Endpoint                                 | Description           |\n|--------|------------------------------------------|-----------------------|\n| GET    | `/api/v1/category/get-all-categories`    | List all categories   |\n| POST   | `/api/v1/category/create-category`       | Create category (Admin)|\n| GET    | `/api/v1/subcategory/get-all-subcategories` | List all subcategories|\n| POST   | `/api/v1/subcategory/create-subcategory` | Create subcategory (Admin)|\n\n### Cart\n\n| Method | Endpoint                  | Description         |\n|--------|---------------------------|---------------------|\n| GET    | `/api/v1/cart/get-cart`   | Get user cart       |\n| POST   | `/api/v1/cart/add-item`   | Add item to cart    |\n| PUT    | `/api/v1/cart/update-item/:id` | Update cart item   |\n| DELETE | `/api/v1/cart/remove-item/:id` | Remove cart item   |\n\n### Address\n\n| Method | Endpoint                          | Description         |\n|--------|-----------------------------------|---------------------|\n| GET    | `/api/v1/address/get-all-addresses` | Get all addresses  |\n| POST   | `/api/v1/address/add-address`     | Add address         |\n| PUT    | `/api/v1/address/update-address/:id` | Update address     |\n| DELETE | `/api/v1/address/delete-address/:id` | Delete address     |\n\n### Orders \u0026 Payments\n\n| Method | Endpoint                              | Description                   |\n|--------|---------------------------------------|-------------------------------|\n| GET    | `/api/v1/order/get-order-details`     | Get user orders               |\n| POST   | `/api/v1/order/create-cod-order`      | Create COD order              |\n| POST   | `/api/v1/order/create-online-order`   | Create online payment order   |\n| POST   | `/api/v1/order/verify-payment`        | Verify Razorpay payment       |\n| POST   | `/api/v1/order/payment-failed`        | Mark order as payment failed  |\n| POST   | `/api/v1/order/payment-cancelled`     | Mark order as cancelled       |\n| POST   | `/api/v1/order/razorpay-webhook`      | Razorpay webhook endpoint     |\n\n---\n\n## 🏗️ Project Structure\n\n```\nBlinkMart-Server/\n├── config/              # Configuration files\n├── controllers/         # Request handlers\n├── middlewares/         # Express middlewares \n├── models/              # Mongoose models\n├── routes/              # Route definitions\n├── utils/               # Utility functions\n├── index.js             # Entry point\n└── vercel.json          # Vercel deployment configuration\n```\n\n---\n\n## � Payment Flow\n\n1. **Order Created**: User places order (COD or Online)  \n2. **Razorpay Order**: For online, backend creates Razorpay order  \n3. **Payment**: User pays via Razorpay widget  \n4. **Verification**: Frontend calls `/verify-payment` after success  \n5. **Webhook**: Razorpay notifies backend via `/razorpay-webhook`  \n6. **Order Status**: Order updated to Completed/Failed/Cancelled  \n\n---\n\n## 🧑‍💻 Contributing\n\n1. Fork the repo  \n2. Create your feature branch (`git checkout -b feature/feature-name`)  \n3. Commit your changes (`git commit -m 'Add feature'`)  \n4. Push to the branch (`git push origin feature/feature-name`)  \n5. Open a Pull Request  \n\n---\n\n## 📄 License\n\nMIT\n\n---\n\n**© 2025 BlinkMart. All rights reserved.**\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonman369%2Fblinkmart-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoonman369%2Fblinkmart-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoonman369%2Fblinkmart-server/lists"}