MultiVend is a cutting-edge, feature-rich multi-vendor e-commerce platform that revolutionizes online trading by empowering both shoppers and entrepreneurs. Our platform creates a dynamic marketplace where users can not only shop but also establish and manage their own online stores with ease.
Follow these steps to set up the E-commerce Backend Application:
-
Clone the project:
git clone git@github.com:Mohamed-Ramadan1/E-commerce-Backend-Application.git
-
Navigate to the project directory:
cd E-commerce-Backend-Application
-
Install dependencies:
npm install
-
Create a
.env
file in the root directory with the following variables:NODE_ENV= PORT= DATABASE= EMAIL_PASSWORD= JWT_SECRET= JWT_EXPIRES_IN=90d JWT_LOGOUT_EXPIRES_IN=0 JWT_COOKIE_EXPIRES_IN=90 CLOUD_NAME= CLOUD_API_KEY= CLOUD_API_SECRET= GOOGLE_CLIENT_ID= GOOGLE_REDIRECT_URL= STRIPE_SECRET_KEY= STRIPE_SUCCESS_URL= STRIPE_CANCEL_URL=
Note: Fill in the appropriate values for each variable. Ensure you provide a MongoDB connection string for the
DATABASE
variable (local or Atlas). -
Start the development server:
npm run dev
Ensure you have Docker and Docker Compose installed on your machine, then run:
docker-compose up
This will build the image and start the container. The project will then be up and running.
To build the project for production using Webpack, run:
npm run build
- Node.js version 20 or higher
- MongoDB (local or Atlas)
Please ensure all environment variables are properly set before running the application.
This section provides information on how to use the E-commerce Backend Application.
- Node.js (v20 or higher)
- npm (Node Package Manager)
- MongoDB connection
To run the application in development mode, use the following command:
npm run dev
To run the application in production mode, follow these steps:
-
Build the project:
npm run build
-
Start the production server:
npm run start
Make sure all environment variables in the .env
file are properly set before running the application in either mode.
The API documentation is available as a Postman collection. Follow these steps to access and use it:
-
Locate the file
E-Commerce App.postman_collection.json
in the main directory of the project. -
Import this file into Postman:
- Open Postman
- Click on "Import" in the top left corner
- Drag and drop the JSON file or browse to select it
- Click "Import" to confirm
-
Once imported, you will have your own version of the API documentation within Postman.
-
You can now explore all available endpoints, their purposes, required parameters, and example requests/responses.
With the Postman collection, you can:
- View all available endpoints
- Send requests to test the API
- See example responses
- Understand the structure of request payloads
Remember to set up any required authentication (such as JWT tokens) as specified in the Postman collection.
For any specific usage instructions or examples of key features, please refer to the documentation provided in the Postman collection.
Our E-commerce Backend Application offers a robust set of features designed to support a comprehensive online marketplace:
-
Authentication and Authorization: Secure JWT-based authentication system with cookie management.
-
Product Management:
- Users can browse and purchase products
- Admins and shop owners can add, delete, and manage products
-
Shopping Cart: Personalized cart system storing user, product, and transaction details.
-
Shop Management:
- Users can create and manage their own shops
- Shop owners can manage inventory, settings, and profiles
-
Support Ticket System:
- Users can create and track support tickets
- Dedicated system for shop owners to manage customer issues
-
Order Management:
- Users can create and cancel orders
- Admins can oversee and manage all orders
- Shop owners can manage orders related to their products
-
Review System: Allows users to review products they've purchased.
-
Wishlist: Advanced wishlist functionality for users.
-
Return and Refund Policy: Comprehensive system for handling returns and refunds.
-
Real-time Notification System: Keeps users updated on various activities and transactions.
-
Email Communication: Robust email system for important updates and notifications.
-
One-way Messaging: Allows admins to send messages to users via email.
-
Discount Code System:
- Shop owners and admins can create discount codes
- Users can apply these codes during purchases
-
Prime Membership:
- Offers benefits like free shipping and increased loyalty points
- Loyalty points can be exchanged for discounts
-
Reporting System:
- Users can report problematic shops
- Shop owners can request shop deletion
-
Sub-order System: Ensures privacy in multi-vendor orders.
-
Dual Analytics System:
- Real-time Analytics: Provides up-to-the-minute insights on various metrics.
- Monthly Reports: Automatically generated and sent to website admins and shop owners, offering in-depth analysis of performance and trends.
Note: The application includes a powerful email notification system. For visual examples of these notifications, please refer to the docs/images/
directory in the repository.
MultiVend is built using a modern tech stack, leveraging powerful tools and libraries to create a robust e-commerce platform. Here's an overview of the key technologies used:
- Node.js: The runtime environment for executing JavaScript on the server.
- Express.js: A minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- TypeScript: A typed superset of JavaScript that compiles to plain JavaScript, enhancing code quality and developer productivity.
- MongoDB: A NoSQL database used with Mongoose as the ODM (Object Document Mapper).
- bcryptjs: Library for hashing passwords.
- jsonwebtoken: Implementation of JSON Web Tokens for secure authentication.
- helmet: Helps secure Express apps by setting various HTTP headers.
- express-rate-limit: Basic rate-limiting middleware for Express.
- express-mongo-sanitize: Middleware to sanitize user-supplied data to prevent MongoDB Operator Injection.
- multer: Middleware for handling multipart/form-data, primarily used for file uploads.
- cloudinary: Cloud service for image and video management.
- stripe: Official Stripe API library for Node.js.
- nodemailer: Module for sending emails.
- socket.io: Real-time bidirectional event-based communication.
- node-cron: Task scheduler in pure JavaScript for Node.js.
- bull: Premium Queue package for handling distributed jobs and messages in Node.js.
- swagger-jsdoc and swagger-ui-express: Tools for generating and serving Swagger API documentation.
- webpack: Module bundler for JavaScript applications.
- ts-node-dev: TypeScript execution and development tool with restart capability.
- jest: JavaScript testing framework (listed in scripts, assuming it's used for testing).
- dotenv: Loads environment variables from a .env file.
- cors: Package for providing a Connect/Express middleware that can be used to enable CORS.
- morgan: HTTP request logger middleware for Node.js.
- validator: Library of string validators and sanitizers.
This tech stack ensures a scalable, secure, and feature-rich backend for the MultiVend e-commerce platform, providing a solid foundation for building complex marketplace functionalities.
- GitHub: Mohamed-Ramadan1
- Email: mohamedramadan11b@gmail.com
- LinkedIn: Mohamed Ramadan
I'm a dedicated backend software engineer with a passion for creating high-quality software solutions.
My goal is to contribute to the tech community by developing innovative solutions that address real-world challenges . I'm always eager to learn new
technologies and methodologies to enhance my skills and deliver better software.
Feel free to reach out to me for any questions, suggestions, or potential collaborations regarding this project or other backend development topics!