A full-stack E-commerce platform built using the MERN stack with secure authentication, RESTful APIs, role-based access control, shopping cart functionality, order management, and cloud deployment support.
Repository Link:
:contentReference[oaicite:0]{index=0}
The E-commerce Website is a scalable and secure full-stack web application designed to provide a seamless online shopping experience. The platform allows users to browse products, manage carts, place orders, and securely authenticate into the system.
The application follows a modular architecture with separate frontend and backend services to ensure maintainability, scalability, and efficient deployment.
The project demonstrates:
- Full-stack MERN development
- REST API design
- Authentication and authorization
- Cloud deployment concepts
- State management
- Component-based frontend architecture
- Backend modularization
- User Registration and Login
- Secure Authentication
- Product Browsing
- Product Detail View
- Shopping Cart
- Order Placement
- Responsive UI
- Category-based Product Listing
- Role-Based Access Control
- Product Management
- Order Management
- User Management
- RESTful API Integration
- JWT Authentication
- Modular Backend Architecture
- Context API State Management
- Cloud Deployment Support
- Scalable Project Structure
- React.js
- Vite
- JavaScript
- Tailwind CSS
- Axios
- React Router DOM
- Context API
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT Authentication
- bcrypt.js
- AWS EC2
- AWS S3
- GitHub
Client (React Frontend)
|
| HTTP Requests (REST APIs)
v
Node.js + Express Backend
|
| Mongoose ODM
v
MongoDB Database
E-commerce/
│
├── frontend/
│ ├── public/
│ ├── src/
│ │ ├── assets/
│ │ ├── components/
│ │ ├── context/
│ │ ├── pages/
│ │ ├── main.jsx
│ │ └── index.js
│ │
│ ├── package.json
│ └── vite.config.js
│
├── backend/
│ ├── config/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── services/
│ ├── server.js
│ └── package.json
│
└── README.md
The frontend is developed using React.js with a component-based architecture.
Contains reusable UI components:
- Navbar
- Footer
- Product Cards
- Cart Components
- Hero Sections
Contains route-level pages:
- Home
- Products
- Product
- Cart
- Orders
- Login
- Contact
- About
Implements global state management using Context API.
Stores images, icons, and static resources.
The backend follows a layered architecture.
Database configuration and environment setup.
Contains business logic for:
- Authentication
- Product operations
- Cart operations
- Order management
Custom middleware for:
- Authentication
- Authorization
- Error handling
MongoDB schemas and database models.
Defines REST API routes.
Contains reusable service logic and utilities.
User Login/Register
|
v
Backend Authentication API
|
v
JWT Token Generation
|
v
Token Stored on Client
|
v
Authenticated API Requests
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register | Register User |
| POST | /api/auth/login | Login User |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/products | Fetch Products |
| GET | /api/products/:id | Fetch Product Details |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/orders | Create Order |
| GET | /api/orders | Get User Orders |
User
- name
- email
- password
- role
Product
- title
- description
- category
- price
- image
- stock
Order
- userId
- products
- totalAmount
- paymentStatus
- orderStatus
git clone https://github.com/lovelymahor/E-commerce.gitcd frontend
npm install
npm run devFrontend runs on:
http://localhost:5173
cd backend
npm install
npm startBackend runs on:
http://localhost:5000
Create a .env file inside backend directory.
PORT=5000
MONGO_URI=your_mongodb_connection
JWT_SECRET=your_secret_key
AWS_ACCESS_KEY=your_access_key
AWS_SECRET_KEY=your_secret_key
AWS_BUCKET_NAME=your_bucket_namecd frontend
npm run devcd backend
npm startUsed for hosting backend services.
Used for storing static assets and media files.
Frontend → AWS Hosting
Backend → EC2 Instance
Assets → AWS S3
Database → MongoDB
- Payment Gateway Integration
- Wishlist Functionality
- Product Reviews and Ratings
- Admin Dashboard Analytics
- Inventory Management
- Email Notifications
- Order Tracking
- Docker Support
- CI/CD Pipeline
Contributions are welcome.
Steps to contribute:
1. Fork the repository
2. Create a feature branch
3. Commit changes
4. Push the branch
5. Open a Pull RequestThis project is licensed under the MIT License.
