Skip to content

Welcome to Tata 1mg Clone, a full-stack e-commerce app using React, Node.js, Express.js, and MongoDB. It features seamless user authentication and efficient cart management, mirroring the Tata 1mg platform.

Notifications You must be signed in to change notification settings

imoamo/1mg_clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tata 1mg Clone

Welcome to Tata 1mg Clone, a full-stack e-commerce application designed to replicate the functionality of the Tata 1mg platform. This project utilizes React for the frontend, Node.js and Express.js for the backend, and MongoDB for data storage. Experience seamless user authentication and cart management in this robust application.

Homepage Product Page Cart Page Checkout User Profile Order Summary

🚀 Features

  • User Authentication: Create accounts, log in, and log out with ease.
  • Secure Cart Access: Only logged-in users can access and modify their cart.
  • Cart Management: Add items to your cart seamlessly once logged in.

🛠 Technologies Used

  • Frontend: React
  • Backend: Node.js, Express.js
  • Database: MongoDB

🏗 Installation

  1. Clone the repository:

    git clone https://github.com/imoamo/1mg_clone.git
  2. Navigate to the project directory:

    cd 1mg_clone
  3. Install the dependencies:

    npm install
  4. Run the application in development mode:

    npm run dev

🌐 Usage

  1. Ensure MongoDB is running and accessible.
  2. Start the application using the provided development server commands.
  3. Open your browser and navigate to http://localhost:5173 to explore the application.

📡 API Endpoints

Authentication Routes

Signup

  • URL: /api/user/signup
  • Method: POST
  • Description: Register a new user account.
  • Request Body:
    {
      "name": "string",
      "email": "string",
      "password": "string"
    }
  • Response:
    {
      "message": "User created successfully",
      "user": user
    }

Login

  • URL: /api/user/login
  • Method: POST
  • Description: Authenticate a user and return a JWT token.
  • Request Body:
    {
      "email": "string",
      "password": "string"
    }
  • Response:
    {
      "token": "JWT token"
    }

Logout

  • URL: /api/auth/logout
  • Method: POST
  • Description: End the user session.
  • Response:
    {
      "message": "User logged out successfully"
    }

Product Routes

Add to Cart

  • URL: /api/product/create
  • Method: POST
  • Description: Add a product to the cart.
  • Request Body:
    {
      "productId": "string",
      "quantity": "number"
    }
  • Response:
    {
      "message": "Product added to cart",
      "cart": cart
    }

Get Cart

  • URL: /api/product
  • Method: GET
  • Description: Retrieve the user's cart.
  • Response:
    {
      "cart": cart
    }

🤝 Contributing

We welcome contributions! Feel free to submit a pull request or open an issue for any changes or improvements.


Feel free to update the image paths and any other details as needed. If there’s anything else you need, just let me know!

About

Welcome to Tata 1mg Clone, a full-stack e-commerce app using React, Node.js, Express.js, and MongoDB. It features seamless user authentication and efficient cart management, mirroring the Tata 1mg platform.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published