Skip to content

About

No description, website, or topics provided.

Resources

Stars

10 stars

Watchers

1 watching

Forks

Latest commit

 

History

30 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mern-e-commerce

Collecting workspace informationHere’s a detailed and professional README.md and .env file template for your e-commerce project:

README.md

# MERN E-Commerce Platform

This is a full-stack e-commerce platform built using the MERN stack (MongoDB, Express.js, React.js, Node.js). It provides a robust backend API and a modern frontend interface for managing and interacting with an online store.

## Features

### Backend
- **Authentication & Authorization**: JWT-based authentication with role-based access control (Admin/User).
- **Product Management**: Add, update, delete, and view products.
- **Order Management**: Place, track, and manage orders.
- **Cart Functionality**: Add/remove items to/from the cart.
- **Search & Filters**: Search products and apply filters.
- **Swagger API Documentation**: Available at `/api-docs`.

### Frontend
- **Responsive Design**: Fully responsive UI built with React and TailwindCSS.
- **User Dashboard**: Manage orders, profile, and cart.
- **Admin Dashboard**: Manage products, orders, and users.
- **Real-Time Updates**: Dynamic updates using modern React features.

## Project Structure
.
├── api/                # Backend code
│   ├── Controllers/    # API controllers
│   ├── Middlewares/    # Middleware functions
│   ├── Models/         # Mongoose models
│   ├── Routes/         # API routes
│   ├── Swagger/        # Swagger documentation setup
│   └── Utils/          # Utility functions
├── client/             # Frontend code
│   ├── public/         # Static assets
│   └── src/            # React components and logic
├── dashboard/          # Admin dashboard (if separate)
├── .gitignore          # Git ignore rules
├── LICENSE             # License file
└── README.md           # Project documentation


## Installation

### Prerequisites
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn

### Backend Setup
1. Navigate to the `api` directory:
   ```bash
   cd api
  1. Install dependencies:
    npm install
  2. Create a .env file in the api directory and configure it (see below for .env file format).
  3. Start the backend server:
    npm start

Frontend Setup

  1. Navigate to the client directory:
    cd client
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev

Admin Dashboard Setup (Optional)

  1. Navigate to the dashboard directory:
    cd dashboard
  2. Install dependencies:
    npm install
  3. Start the development server:
    npm run dev

Environment Variables

Backend .env File

Create a .env file in the api directory with the following content:

# filepath: \api\.env
PORT=5000
MONGO_URI=mongodb://localhost:27017/Mern-e-commerce
JWT_SECRET=your_jwt_secret
JWT_EXPIRES_IN=7d
NODE_ENV=development
CLOUDINARY_NAME=your_cloudinary_name
CLOUDINARY_API_KEY=your_cloudinary_api_key
CLOUDINARY_API_SECRET=your_cloudinary_api_secret

Frontend .env File

Create a .env file in the client directory with the following content:

# filepath: .env
VITE_API_URL=http://localhost:5000

Admin Dashboard .env File (Optional)

Create a .env file in the dashboard directory with the following content:

# filepath: .env
VITE_API_URL=http://localhost:5000

API Documentation

The API documentation is available at http://localhost:5000/api-docs after starting the backend server.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

Contact

For any inquiries, please contact the project owner at [alireza.aghaee70@gmail.com].


Let me know if you need further adjustments!

About

No description, website, or topics provided.

Resources

Stars

10 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages