A full-stack e-commerce platform built with React, Node.js, and MongoDB. This project includes a customer-facing store, admin dashboard, and comprehensive backend API.
- Customer Store: https://mern-ecom-psi.vercel.app/
- Admin Dashboard: https://apna-ecommerce.vercel.app/login
- Live Demo
- Features
- Tech Stack
- Project Structure
- Installation & Setup
- API Documentation
- Screenshots
- Usage
- Contributing
- License
- User Authentication: Secure login/signup with JWT tokens
- Product Browsing: Browse products with filtering and search
- Shopping Cart: Add/remove items with real-time updates
- Wishlist: Save favorite products for later
- Order Management: Place orders and track order history
- Address Management: Multiple shipping addresses
- User Profile: Comprehensive profile management
- Responsive Design: Mobile-first approach with Chakra UI
- Dashboard Analytics: Real-time KPIs and statistics
- Product Management: Add, edit, delete products
- Order Management: View and manage customer orders
- User Management: Manage customer accounts
- Inventory Tracking: Monitor product stock and sales
- Revenue Analytics: Track sales performance and trends
- RESTful API: Well-structured API endpoints
- Authentication & Authorization: Secure JWT-based auth
- Database Integration: MongoDB with Mongoose ODM
- Data Aggregation: Advanced analytics with MongoDB aggregation
- Error Handling: Comprehensive error management
- CORS Support: Cross-origin resource sharing enabled
- React 18 - UI library
- Chakra UI - Component library
- Redux - State management
- React Router DOM - Routing
- Axios - HTTP client
- React Icons - Icon library
- Framer Motion - Animations
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM
- JWT - Authentication
- bcrypt - Password hashing
- CORS - Cross-origin support
- Nodemon - Development server
- React Scripts - Build tools
- ESLint - Code linting
Apna_Ecommerce/
βββ client/ # Customer-facing React app
β βββ src/
β β βββ Components/ # Reusable components
β β βββ Pages/ # Page components
β β βββ Redux/ # State management
β β βββ Routes/ # Routing configuration
β βββ package.json
βββ admin_dashboard/ # Admin React dashboard
β βββ src/
β β βββ components/ # Admin components
β β βββ pages/ # Admin pages
β β βββ redux/ # Admin state management
β β βββ Routes/ # Admin routing
β βββ package.json
βββ server/ # Node.js backend
β βββ Modal/ # Database models
β βββ Routes/ # API routes
β βββ Middleware/ # Custom middleware
β βββ config/ # Database configuration
βββ Images/ # Project images
- Node.js (v14 or higher)
- MongoDB (local or cloud)
- Git
git clone <repository-url>
cd Apna_Ecommercecd server
npm installcd ../client
npm installcd ../admin_dashboard
npm installCreate a .env file in the server directory:
MONGODB_URI=mongodb://localhost:27017/apna_ecommerce
JWT_SECRET=your_jwt_secret_key
PORT=8080Make sure MongoDB is running on your system. The application will automatically create the necessary collections.
cd server
npm startServer will run on http://localhost:8080
cd client
npm startCustomer app will run on http://localhost:3000
cd admin_dashboard
npm startAdmin dashboard will run on http://localhost:3001
POST /userauth/register- User registrationPOST /userauth/login- User loginPOST /adminauth/login- Admin login
GET /admindashboard- Get all productsPOST /admindashboard/add- Add new productPUT /admindashboard/update/:id- Update productDELETE /admindashboard/delete/:id- Delete product
GET /userDashboard/cart- Get user cartPOST /userDashboard/cart- Add to cartDELETE /userDashboard/cart/:id- Remove from cart
GET /userDashboard/address- Get user addressesPOST /userDashboard/address- Add new addressPUT /userDashboard/address/:id- Update addressDELETE /userDashboard/address/:id- Delete address
GET /userDashboard/order- Get user ordersPOST /userDashboard/order- Create new orderPUT /userDashboard/order/:id- Update order status
GET /userDashboard/wishlist- Get user wishlistPOST /userDashboard/wishlist- Add to wishlistDELETE /userDashboard/wishlist/:id- Remove from wishlist
GET /dashboard/analytics- Get detailed analyticsGET /dashboard/summary- Get quick summary
- Homepage: Modern landing page with product showcase
- Product Catalog: Grid view with filtering options
- Shopping Cart: Interactive cart with quantity management
- Checkout: Multi-step checkout process
- User Profile: Comprehensive profile management
- Analytics Dashboard: Real-time KPIs and charts
- Product Management: CRUD operations for products
- Order Management: Order tracking and status updates
- User Management: Customer account management
- Register/Login: Create an account or sign in
- Browse Products: Explore the product catalog
- Add to Cart: Add desired items to shopping cart
- Manage Wishlist: Save products for later purchase
- Checkout: Complete purchase with address selection
- Track Orders: Monitor order status and history
- Login: Access admin dashboard
- View Analytics: Monitor platform performance
- Manage Products: Add, edit, or remove products
- Process Orders: Update order statuses
- User Management: Handle customer accounts
- Redux: Centralized state management
- Redux Thunk: Async action handling
- Persistent State: Cart and user data persistence
- JWT Tokens: Secure authentication
- Protected Routes: Route-level security
- Role-based Access: Admin vs user permissions
- MongoDB Collections: Users, Products, Orders, Cart, Wishlist, Addresses
- Aggregation Pipelines: Complex data queries
- Data Relationships: Proper foreign key references
- Responsive Design: Mobile-first approach
- Chakra UI: Consistent design system
- Loading States: User feedback during operations
- Error Handling: Graceful error management
# Build production version
cd client
npm run build
# Deploy build folder to hosting service# Set production environment variables
# Deploy to cloud service (Heroku, AWS, etc.)- Use MongoDB Atlas for cloud database
- Configure connection string in environment variables
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Manish - Full Stack Developer
- Chakra UI for the amazing component library
- React team for the excellent framework
- MongoDB for the flexible database solution
- All contributors who helped make this project better
Happy Shopping! ποΈ