A full-featured e-commerce application built with the MERN stack (MongoDB, Express.js, React, Node.js) that allows users to browse, purchase, and manage products.
- User authentication (Sign up, Login, Logout)
- Browse products by categories
- View featured products
- Add products to shopping cart
- Adjust product quantities in cart
- Apply discount coupons
- Secure payment processing with Stripe
- View order history
- Dashboard with analytics
- Create, read, update, delete products
- Toggle featured product status
- Manage product categories
- View sales data and metrics
- User management
- React 18 - JavaScript library for building user interfaces
- Vite - Fast build tool and development server
- TailwindCSS - Utility-first CSS framework
- Zustand - Small, fast state management for React
- React Router - Declarative routing for React
- Axios - Promise based HTTP client
- Stripe.js - Payment processing
- Node.js - JavaScript runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - JSON Web Tokens for authentication
- Cloudinary - Image hosting service
- Redis - In-memory data structure store (caching)
- Stripe - Payment processing API
- Node.js (v14 or higher)
- MongoDB database (local or cloud instance)
- Cloudinary account
- Stripe account
- Redis server (optional but recommended)
.
βββ backend/
β βββ controllers/ # Request handlers
β βββ lib/ # Database and service configurations
β βββ middleware/ # Custom middleware functions
β βββ models/ # Mongoose models
β βββ routes/ # API routes
β βββ server.js # Entry point
βββ frontend/
β βββ src/
β β βββ components/ # React components
β β βββ lib/ # Utility functions
β β βββ pages/ # Page components
β β βββ stores/ # Zustand stores
β β βββ App.jsx # Main App component
β β βββ main.jsx # Entry point
β βββ vite.config.js # Vite configuration
βββ .env # Environment variables
βββ .gitignore # Git ignore file
βββ package.json # Project dependencies
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logoutGET /api/auth/profile- Get user profile
GET /api/products- Get all products (admin only)POST /api/products- Create a new product (admin only)PATCH /api/products/:id- Toggle featured status (admin only)DELETE /api/products/:id- Delete a product (admin only)GET /api/products/featured- Get featured productsGET /api/products/category/:category- Get products by categoryGET /api/products/recommendations- Get recommended products
GET /api/cart- Get user's cartPOST /api/cart- Add item to cartPATCH /api/cart/:productId- Update item quantityDELETE /api/cart/:productId- Remove item from cartDELETE /api/cart- Clear cart
GET /api/coupons- Get all coupons (admin only)POST /api/coupons- Create a new coupon (admin only)DELETE /api/coupons/:id- Delete a coupon (admin only)POST /api/coupons/validate- Validate a coupon
POST /api/payments/create-checkout-session- Create Stripe checkout sessionPOST /api/payments/checkout-success- Handle successful payment
GET /api/analytics/sales- Get sales data (admin only)GET /api/analytics/users- Get user data (admin only)GET /api/analytics/products- Get product data (admin only)
(Add screenshots of your application here)