A modern, full-stack ecommerce application built with React, Node.js, and MongoDB. This platform includes a customer-facing store, admin dashboard, and robust backend API with payment integration.
- Product Browsing: Browse products with categories and search functionality
- Shopping Cart: Add/remove items with real-time updates
- User Authentication: Secure login/registration system
- Order Management: Track order history and status
- Payment Integration: Support for Razorpay and Stripe payments
- Responsive Design: Mobile-friendly interface with Tailwind CSS
- Product Management: Add, edit, and delete products
- Order Management: View and manage customer orders
- Image Upload: Cloudinary integration for product images
- Dashboard: Comprehensive admin panel
- RESTful API: Well-structured backend with Express.js
- Database: MongoDB with Mongoose ODM
- Authentication: JWT-based authentication
- File Upload: Multer for handling file uploads
- Cloud Storage: Cloudinary for image management
- Payment Gateway: Multiple payment options
Full-stack-ecommerce/
βββ π Backend/ # Node.js API Server
β βββ π config/ # Database and service configurations
β βββ π controllers/ # Business logic controllers
β βββ π middleware/ # Authentication and validation
β βββ π models/ # MongoDB schemas
β βββ π routes/ # API routes
β βββ π server.js # Main server file
βββ π Frontend/ # Customer-facing React app
β βββ π src/
β β βββ π components/ # Reusable UI components
β β βββ π pages/ # Page components
β β βββ π context/ # React context for state management
β β βββ π assets/ # Images and static files
β βββ π package.json
βββ π admin/ # Admin dashboard React app
β βββ π src/
β β βββ π components/ # Admin-specific components
β β βββ π pages/ # Admin pages
β βββ π package.json
βββ π README.md
- Node.js (v16 or higher)
- MongoDB Atlas account or local MongoDB
- Cloudinary account (for image storage)
- Razorpay/Stripe account (for payments) - Optional: Code is ready but keys not configured
-
Clone the repository
git clone https://github.com/yourusername/Full-stack-ecommerce.git cd Full-stack-ecommerce -
Backend Setup
cd Backend npm installCreate a
.envfile in the Backend directory:MONGODB_URI=your_mongodb_connection_string JWT_SECRET=your_jwt_secret_key CLOUDINARY_CLOUD_NAME=your_cloudinary_cloud_name CLOUDINARY_API_KEY=your_cloudinary_api_key CLOUDINARY_API_SECRET=your_cloudinary_api_secret RAZORPAY_KEY_ID=your_razorpay_key_id RAZORPAY_KEY_SECRET=your_razorpay_key_secret STRIPE_SECRET_KEY=your_stripe_secret_key
-
Frontend Setup
cd ../Frontend npm installCreate a
.envfile in the Frontend directory:VITE_BACKEND_URL=http://localhost:4000
-
Admin Setup
cd ../admin npm installCreate a
.envfile in the admin directory:VITE_BACKEND_URL=http://localhost:4000
-
Start the Backend Server
cd Backend npm run serverServer will run on
http://localhost:4000 -
Start the Frontend (Customer App)
cd Frontend npm run devApp will run on
http://localhost:5173 -
Start the Admin Dashboard
cd admin npm run devAdmin panel will run on
http://localhost:5174
- React 19 - UI library
- Vite - Build tool and dev server
- Tailwind CSS - Styling framework
- React Router DOM - Client-side routing
- Axios - HTTP client
- React Toastify - Notifications
- Node.js - Runtime environment
- Express.js - Web framework
- MongoDB - Database
- Mongoose - ODM for MongoDB
- JWT - Authentication
- Bcrypt - Password hashing
- Multer - File upload handling
- Cloudinary - Image storage
- Razorpay & Stripe - Payment gateways (Code implemented, keys not configured)
POST /api/user/register- User registrationPOST /api/user/login- User login
GET /api/product- Get all productsGET /api/product/:id- Get product by IDPOST /api/product- Add new product (Admin)PUT /api/product/:id- Update product (Admin)DELETE /api/product/:id- Delete product (Admin)
GET /api/cart/:userId- Get user's cartPOST /api/cart/add- Add item to cartPUT /api/cart/update- Update cart itemDELETE /api/cart/remove- Remove item from cart
GET /api/order/:userId- Get user's ordersPOST /api/order/place- Place new orderPUT /api/order/:id- Update order status (Admin)
- JWT-based authentication
- Password hashing with bcrypt
- Protected routes for admin functions
- Multiple payment gateways (Razorpay & Stripe)
- Note: Payment gateway code is implemented but API keys are not configured
- To enable payments, add your Razorpay/Stripe keys to the
.envfile - Secure payment processing
- Order confirmation system
- Cloudinary integration for image storage
- Multiple image upload support
- Automatic image optimization
- Real-time cart updates
- Persistent cart storage
- Quantity management
The application includes comprehensive test scenarios for:
- User authentication flows
- Product management operations
- Cart functionality
- Order processing
- Payment integration
- Admin dashboard features
Initial test data includes:
- Sample products with various categories
- Test user accounts
- Sample orders for testing
- Deploy to platforms like Heroku, Railway, or DigitalOcean
- Set up MongoDB Atlas for production database
- Configure environment variables
- Set up Cloudinary for image storage
- Build the production version:
npm run build - Deploy to Vercel, Netlify, or similar platforms
- Configure environment variables for production
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the ISC License.
- wpc41205 - Initial work -(https://github.com/wpc41205)
- React team for the amazing framework
- MongoDB for the database solution
- Cloudinary for image management
- Payment gateway providers (Razorpay & Stripe)
If you have any questions or need help, please:
- Open an issue on GitHub
- Contact: loomaflex44@gmail.com
β Star this repository if you found it helpful!