A RESTful API for an e-commerce platform that provides multiple endpoints to manage authentication, users, cart, wishlist, addresses, products, categories, brands, coupons, orders and reviews.
This project is built using Express.js and MongoDB; all the APIs are well-documented using Swagger specification. User authentication has been implemented via JSON Web Tokens and the project is deployed on a DigitalOcean Droplet using Nginx as a web server.
2. Deployment and Documentation
This project is deployed on a DigitalOcean Droplet and linked to a custom domain. To visit the live deployment, click here.
Swagger Docs
APIs are documented using Swagger (OpenAPI) specification and all of them are live and functional. To view Swagger docs, click here. Select Shopease production server in the dropdown menu and play with any API.
Postman Docs
Postman is used to prototype, develop and test API endpoints. It is also used to document those APIs. To view Postman docs, click here.
3. Main Features
Authentication using JSON Web Tokens (signup, login, reset password)
Authorization based on role of a user (user or admin)
Database modelling using various Mongoose schemas
Used MongoDB aggregation pipelines to perform complex database queries
Applied filters, sorting and pagination on Mongoose documents
Scheduled CRON job to check the expiry status of coupons every midnight
API and CRON jobs are deployed on a DigitalOcean Droplet using Nginx as a web server
Configured PM2 to keep API and Cron jobs running as daemon processes to ensure availability
Utilized the cluster module to evenly distribute incoming requests across all CPU cores in the server
APIs are documented using Swagger (OpenAPI) specification
Integration of payment gateway using Razorpay APIs
Verification of email addresses and phone numbers using Abstract APIs (third party service)
Validation of request payload using Joi library
Logging of HTTP requests using Morgan
Separate loggers for development and production environments
Parsing of multipart/form-data using Formidable library
Upload and delete images using Cloudinary APIs
Ability to send emails using Nodemailer
Setup routing using Express middlewares
Centralized error handling using Express middlewares
Project is based on MVC architecture
Used Postman to prototype, develop, test and document APIs
4. Schemas and Routes
Shopease API consists of 8 schemas and 70+ routes and controllers.