Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/udoy2/e-commerce-mern
An advanced MERN stack e-commerce platform for seamless online shopping 🛒✨.
https://github.com/udoy2/e-commerce-mern
bycrpt expressjs jtest mongodb mongodb-atlas nodejs reactjs supertest
Last synced: 6 days ago
JSON representation
An advanced MERN stack e-commerce platform for seamless online shopping 🛒✨.
- Host: GitHub
- URL: https://github.com/udoy2/e-commerce-mern
- Owner: Udoy2
- Created: 2024-08-03T17:39:04.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-08-28T16:17:23.000Z (3 months ago)
- Last Synced: 2024-08-28T20:01:45.069Z (3 months ago)
- Topics: bycrpt, expressjs, jtest, mongodb, mongodb-atlas, nodejs, reactjs, supertest
- Language: JavaScript
- Homepage:
- Size: 551 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# E-commerce mern
A mern application
## Project Structure
The project is organized as follows:
- **src**
- **server.js**: Initializes and starts the server.
- **app**: Contains the main application logic.
- **router**: Defines all the routes.
- **controller**: Contains all the controller functions.
- **model**: Defines the user schema and model.
- **config**
- **db.js**: Manages the database connection using Mongoose.
- **middleware**
- **errorHandler.js**: Handles all the errors.
- **.env**: Stores crucial environment variables like MongoDB connection string.
- **secret.js**: Manages the .env file and makes the data available to all project files.## Setup Instructions
1. **Install Dependencies**: Run `npm install` to install the required packages.
2. **Start the Server**: Use `npm run dev` to start the server with nodemon.## Key Packages Used
- **morgan**: Logs incoming requests.
- **xss-clean**: Filters XSS requests (note: this package is out of date).
- **express-rate-limit**: Limits the number of requests that can be sent in a particular time frame.
- **http-errors**: Generates and handles HTTP errors.
- **dotenv**: Manages environment variables.## Routes
- **GET /users**: Retrieves users with pagination, search, and limiting functionality.
- **GET /users/:id**: Retrieves a particular user by ID.## Environment Variables
Make sure to set the following variables in the `.env` file:
- `MONGODB_URI`: Your MongoDB connection string.
---