{"id":22922429,"url":"https://github.com/gopalbasak1/bike-store-server","last_synced_at":"2026-04-11T05:03:53.632Z","repository":{"id":264052928,"uuid":"892166735","full_name":"gopalbasak1/Bike-Store-Server","owner":"gopalbasak1","description":"Technology \u0026 Live Server","archived":false,"fork":false,"pushed_at":"2025-02-16T12:15:46.000Z","size":141,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T12:23:40.006Z","etag":null,"topics":["cors","dotenv","eslint-config-prettier","express","mongodb","mongoose","nodejs","prettier","ts-node-dev","typescript","typescript-eslint-setup"],"latest_commit_sha":null,"homepage":"https://bike-store-ebon.vercel.app/","language":"TypeScript","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/gopalbasak1.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-21T16:13:27.000Z","updated_at":"2025-02-16T12:15:49.000Z","dependencies_parsed_at":"2024-11-21T18:39:44.002Z","dependency_job_id":"acf55034-e217-453d-afcd-e89e99dc5392","html_url":"https://github.com/gopalbasak1/Bike-Store-Server","commit_stats":null,"previous_names":["gopalbasak1/bike-store-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopalbasak1%2FBike-Store-Server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopalbasak1%2FBike-Store-Server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopalbasak1%2FBike-Store-Server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gopalbasak1%2FBike-Store-Server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gopalbasak1","download_url":"https://codeload.github.com/gopalbasak1/Bike-Store-Server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246655803,"owners_count":20812694,"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":["cors","dotenv","eslint-config-prettier","express","mongodb","mongoose","nodejs","prettier","ts-node-dev","typescript","typescript-eslint-setup"],"created_at":"2024-12-14T08:10:08.091Z","updated_at":"2025-10-23T19:56:24.761Z","avatar_url":"https://github.com/gopalbasak1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bike Store API\n\nA robust and scalable REST API for managing bikes and orders, built using TypeScript, jwt, password salt, Node.js, Express, Mongoose and MongoDB.\n\n## Live Deployment Link\n\n[Bike-Store-Server](https://bike-store-ebon.vercel.app/)\n\n## Features\n\n- 🛒 **Bike Management:** Add, update, delete, and fetch bike details with strict validations.\n- 👤 **User Management:** Add, update, and fetch user details securely.\n- 🌟 **Review System:** Add and fetch customer reviews.\n- 🛍️ **Order Management:** Create and manage orders with price calculations.\n- 🔒 **Secure Authentication:** Uses JWT tokens and password hashing with bcrypt.\n- 💳 **Secure Payment System:** Integration with ShurjoPay to handle payments securely and efficiently.\n- Validation: Uses Generic for schema validation and ensures data integrity.\n- TypeScript Support: Full TypeScript support for type safety and better developer experience.\n- Environment Configuration: Manage sensitive information securely using dotenv.\n- Code Quality: Integrated ESLint and Prettier for consistent code styling and linting.\n- Development Tools:\n  - Live reload with ts-node-dev.\n  - Build with tsc.\n  - Lint and format code using Prettier and ESLint.\n\n## Tech Stack\n\n**Dependencies:** Node, Express, mongoose, dotenv, cors, shurjopay\n\n**Dependencies:** typescript, ts-node-dev, prettier, eslint-config-prettier, @typescript-eslint/_, @types/_\n\n- **Server:** ![Node.js](https://img.shields.io/badge/-Node.js-339933?logo=node.js\u0026logoColor=white)\n- **Framework:** ![Express](https://img.shields.io/badge/-Express.js-000000?logo=express\u0026logoColor=white)\n- **Database:** ![MongoDB](https://img.shields.io/badge/-MongoDB-47A248?logo=mongodb\u0026logoColor=white)\n- **Language:** ![TypeScript](https://img.shields.io/badge/-TypeScript-3178C6?logo=typescript\u0026logoColor=white)\n- **Payment Gateway:** ![SurjoPay](https://img.shields.io/badge/-SurjoPay-FF4500)\n\n## Secure Payment Integration with SurjoPay\n\nThis project integrates **SurjoPay**, a reliable and secure payment gateway, to manage customer payments efficiently. Here are the key benefits of using SurjoPay:\n\n- **Encryption:** End-to-end encryption to protect sensitive financial data.\n- **Fraud Prevention:** Advanced mechanisms to detect and prevent fraudulent transactions.\n- **Seamless Checkout:** Provides a fast and user-friendly checkout experience for customers.\n- **Multi-currency Support:** Allows customers to pay using various currencies.\n- **Payment Status:** Automatic order status updates based on payment confirmations.\n\n### Payment Flow\n\n1. Customer places an order via `/api/orders`.\n2. SurjoPay processes the payment.\n3. Upon successful payment, the order is marked as \"Paid\" in the system.\n4. Payment confirmation or failure is handled through secure callbacks.\n\n## Prerequisites\n\nEnsure you have the following installed:\n\n- Node.js (\u003e=16.x)\n- npm or yarn\n- MongoDB (running locally or a hosted instance)\n\n## Getting Started\n\n## 1 Clone the Repository\n\n```bash\ngit clone https://github.com/gopalbasak1/Bike-Store-Server.git\ncd Bike-Store-Server\n```\n\n## 2 Install Dependencies\n\n```bash\nnpm install\n```\n\n## 3 Environment Setup\n\nCreate a .env file in the root directory and configure the following variables:\n\n```bash\n(DATABASE_URL) MONGO_URI=\u003cyour-mongodb-connection-string\u003e\nPORT=\u003cport-number\u003e\n```\n\n## 4 Run the Project\n\n- Development: Start the server with hot reloading:\n\n```bash\nnpm run dev\n```\n\n- Production: Build and start the server: Start the server with hot reloading:\n\n```bash\nnpm run build\nnpm start:prod\n```\n\n### Configuration\n\nTo set up SurjoPay, configure the following environment variables in your `.env` file:\n\n````bash\nSURJOPAY_SP_ENDPOINT=\u003cadd-sp-endpoint\u003e\nSURJOPAY_SP_USERNAME=\u003cadd-sp-username\u003e\nSURJOPAY_SP_PASSWORD=\u003cyour-sp-password\u003e\nSURJOPAY_SP_PREFIX=\u003cadd-SP\u003e\nSURJOPAY_SP_RETURN_URL=\u003cyour-localhost(frontend)-orders-verify\u003e\n\n## 5 API Endpoints\n\n- Bikes\n  - POST /api/products: Add a new bike.\n  - GET /api/products: Fetch all bikes.\n  - GET /api/products/:productId: Fetch a bike by ID.\n  - PATCH /api/products/:productId: Update bike details.\n  - DELETE /api/products/:productId: Delete a bike.\n- Orders\n  - POST /api/orders: Place a new order.\n  - GET /api/orders: Fetch all order bikes.\n  - GET /api/orders/revenue: Total revenue calculated from all orders.\n- Reviews\n  - POST /api/orders: Place a new order.\n  - GET /api/orders: Fetch all order bikes.\n\n## Scripts\n\n- `npm run dev`: Run the server in development mode with hot reload.\n- `npm run build`: Build the project using TypeScript.\n- `npm run start:prod`: Run the production build.\n- `npm run lint`: Run ESLint for linting TypeScript files.\n- `npm run lint:fix`: Automatically fix linting issues.\n- `npm run prettier`: Format files using Prettier.\n- `npm run prettier:fix`: Fix and format files with Prettier.\n\n## Project Structure\n\n```bash\nplaintext\n\nsrc/\n├── controllers/   # Request handlers\n├── interfaces/    # TypeScript interfaces\n├── models/        # Mongoose schemas\n├── routes/        # API route definitions\n├── server.ts      # Application entry point\n\n````\n\n## License\n\nThis project is licensed under the [MIT](https://choosealicense.com/licenses/mit/) License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopalbasak1%2Fbike-store-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgopalbasak1%2Fbike-store-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgopalbasak1%2Fbike-store-server/lists"}