This is a Turbo Repo for a MERN (MongoDB, Express, React, Node.js) web application that serves as an e-commerce platform. It includes user authentication, product listings, shopping cart functionality, and order management.
To run the application:
- Clone the repository:
git clone https://github.com/your-username/mern-ecommerce-app.git
- Navigate to the project folder:
cd mern-ecommerce-app
- Install the dependencies for the entire project:
npm install
- Set up the environment variables in
.env
files as needed for the backend and frontend. - Start the development server:
npm run dev
This command will start both the backend and frontend development servers simultaneously.
The backend contains the following API routes:
POST /api/user/register
: Register a new user.POST /api/user/login
: User login.GET /api/user/profile
: Get user profile details.PUT /api/user/profile
: Update user profile.DELETE /api/user/profile
: Delete user profile.
GET /api/products
: Get all products.POST /api/products
: Add a new product.GET /api/products/:id
: Get a product by ID.PUT /api/products/:id
: Update a product.DELETE /api/products/:id
: Delete a product.
GET /api/cart
: Get the shopping cart items.POST /api/cart
: Add an item to the shopping cart.PUT /api/cart/:id
: Update an item quantity in the shopping cart.DELETE /api/cart/:id
: Remove an item from the shopping cart.
GET /api/orders
: Get all orders.POST /api/orders
: Place a new order.GET /api/orders/:id
: Get an order by ID.PUT /api/orders/:id
: Update the status of an order.
- Frontend: React,TypeScript,Recoil,Next js
- Backend: Node.js, Express.js,TypeScript,Zod
- Database: MongoDB (Mongoose ORM)
- Authentication: JWT (JSON Web Tokens)
- Fork the repository.
- Create a new branch:
git checkout -b feature/your-feature-name
- Make your changes and commit them:
git commit -m "Add your feature description"
- Push to the branch:
git push origin feature/your-feature-name
- Create a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
Website: https://anupamac.me