An open API service indexing awesome lists of open source software.

https://github.com/devhabeeblateef/ecommerce-app-with-mernstack

This is a full-stack e-commerce application built using the MERN (MongoDB, Express, React, Node.js) stack. It includes authentication using JWT and password hashing with bcrypt, and is styled with Tailwind CSS.
https://github.com/devhabeeblateef/ecommerce-app-with-mernstack

Last synced: about 1 year ago
JSON representation

This is a full-stack e-commerce application built using the MERN (MongoDB, Express, React, Node.js) stack. It includes authentication using JWT and password hashing with bcrypt, and is styled with Tailwind CSS.

Awesome Lists containing this project

README

          

# E-Commerce App

This is a full-stack e-commerce application built using the MERN (MongoDB, Express, React, Node.js) stack. It includes authentication using JWT and password hashing with bcrypt, and is styled with Tailwind CSS.

# Tech Stack

- **MongoDB**: NoSQL database for storing user and product information
- **Express**: Backend framework for creating RESTful APIs
- **React**: Frontend framework for building the user interface
- **Node.js**: Backend environment for executing JavaScript on the server
- **JWT**: JSON Web Tokens for secure authentication and authorization
- **bcrypt**: For hashing and salting passwords before saving them to the database
- **Bootstrap**: Utility-first CSS framework for building responsive designs quickly

# Installation

# Prerequisites

Ensure you have the following installed:

- [Node.js](https://nodejs.org/en/download/) (v14 or higher)
- [MongoDB](https://www.mongodb.com/try/download/community)
- [npm](https://www.npmjs.com/get-npm) (Node Package Manager)

# Steps to Run the Application

1. Clone the repository:

```bash
git clone https://github.com/your-username/ecommerce-mern-app.git
cd ecommerce-mern-app
```

2. Install dependencies for both frontend and backend:

```bash
# Backend
cd server
npm install

# Frontend
cd ../client
npm install
```

3. Set up environment variables:

Create a `.env` file in the `server` folder with the following content:

```bash
# MongoDB connection string
MONGO_URI=your_mongo_db_connection_string

# JWT Secret
JWT_SECRET=your_jwt_secret

# Bcrypt salt rounds
BCRYPT_SALT_ROUNDS=10

# Port for server
PORT=5000
```

4. Run the development server:

- **Backend**: Start the Express server
```bash
cd server
npm run dev
```

- **Frontend**: Start the React app
```bash
cd client
npm start
```

The frontend should be running on `http://localhost:3000` and the backend on `http://localhost:5000`.

# Contributing

Feel free to fork this repository, make your changes, and submit a pull request. Contributions are welcome!

# License

This project is licensed under the MIT License.