Currently under construction. Of course you can explore what I've built so far. Just follow some basic steps mentioned below.
Authentication middlewares are currently removed from endpoints for testing purpose (but are added as comments next to each endpoint)
- NodeJS
- ExpressJS
- MongoDB Atlas
- JavaScript
git clone https://github.com/sandip2224/EcommerceX-REST-API.git
npm install
npm install -D nodemon
MONGO_URI=<Your_Unique_MongoDB_Cluster_URL>
PORT=<Local_Server_Port_Number>
JWT_KEY=<Your_Private_JWT_Key>
Note: Get the following URL from MongoDB official website. You need to configure the
username
,password
anddbname
accordingly.
mongodb+srv://<username>:<password>@cluster0.x1ccn.mongodb.net/<dbname>?retryWrites=true&w=majority
nodemon server
GET /api/products
GET /api/products/:productId
POST /api/products
PATCH /api/products/:productId
DELETE /api/products/:productId
DELETE /api/products
To manage user order details:
GET /api/orders
GET /api/orders/:orderId
POST /api/orders
PATCH /api/orders/:orderId
DELETE /api/orders/:orderId
To manage user credentials and roles:
GET /api/users
GET /api/users/:userId
PATCH /api/users/:userId
DELETE /api/users/:userId
To process pending payments on existing orders:
GET /api/payments
GET /api/payments/:paymentId
POST /api/payments/:orderId
To register a new user before login:
POST /api/users/register
To login a user and generate a JWT token for accessing protected routes:
POST /api/users/login
- Add seller, customer, admin levels for protected endpoints
- Add product image upload functionality with POST route (+testing done)
- Payment route should accept home address, pincode, state, country (+testing done)
- Add testing components using Jest and Supertest to replace Postman (On current endpoints)
- Email confirmation on paid orders (Nodemailer integration)
- Add express rate limiter on all routes to prevent DDOS [enhancement]
- Replace promises with async/await in routes handlers
Distributed under the MIT License. See LICENSE
for more information.