A full-stack e-commerce application built with React and Node.js, featuring authentic Indian handcrafted products.
- Modern React application with Framer Motion animations
- Responsive design with mobile-first approach
- Product catalog with filtering and search
- Shopping cart functionality
- User authentication and registration
- Product detail pages
- Checkout process
- Error handling and loading states
- RESTful API built with Express.js
- MongoDB database with Mongoose ODM
- JWT authentication
- Password hashing with bcrypt
- CORS enabled for cross-origin requests
- Input validation and error handling
- Admin routes for product management
- Node.js (v14 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
- Navigate to the backend directory:
cd backend- Install dependencies:
npm install- Create a
.envfile in the backend directory:
NODE_ENV=development
PORT=5000
MONGO_URI=mongodb://localhost:27017/cherish-india
JWT_SECRET=your_jwt_secret_key_here_change_in_production
CLIENT_URL=http://localhost:3000- Start the backend server:
npm run devThe backend will run on http://localhost:5000
- Navigate to the frontend directory:
cd frontend- Install dependencies:
npm install- Create a
.envfile in the frontend directory:
REACT_APP_API_URL=http://localhost:5000/api- Start the frontend development server:
npm startThe frontend will run on http://localhost:3000
GET /api/products- Get all productsGET /api/products/:id- Get single productPOST /api/products- Create product (Admin only)PUT /api/products/:id- Update product (Admin only)DELETE /api/products/:id- Delete product (Admin only)
POST /api/users/register- Register new userPOST /api/users/login- Login userGET /api/users/profile- Get user profile (Protected)PUT /api/users/profile- Update user profile (Protected)
GET /api/health- Server health check
├── backend/
│ ├── middleware/
│ │ └── auth.js # Authentication middleware
│ ├── models/
│ │ ├── Product.js # Product model
│ │ └── User.js # User model
│ ├── routes/
│ │ ├── productRoutes.js # Product routes
│ │ └── userRoutes.js # User routes
│ ├── server.js # Main server file
│ └── package.json
├── frontend/
│ ├── public/
│ │ └── images/ # Static images
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── context/ # React contexts
│ │ ├── pages/ # Page components
│ │ ├── services/ # API services
│ │ └── config/ # Configuration files
│ └── package.json
└── README.md
- React 18
- React Router DOM
- Framer Motion
- Axios
- React Icons
- CSS3
- Node.js
- Express.js
- MongoDB
- Mongoose
- JWT
- bcryptjs
- CORS
- Morgan
- Start MongoDB service
- Run backend:
cd backend && npm run dev - Run frontend:
cd frontend && npm start
- Build frontend:
cd frontend
npm run build- Start backend in production:
cd backend
npm start- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
For support, email support@cherishindia.com or create an issue in the repository.