https://github.com/coderooz/ecommerce-backend
This is a Node.js backend for an e-commerce application using Express and MongoDB.
https://github.com/coderooz/ecommerce-backend
Last synced: 12 months ago
JSON representation
This is a Node.js backend for an e-commerce application using Express and MongoDB.
- Host: GitHub
- URL: https://github.com/coderooz/ecommerce-backend
- Owner: coderooz
- License: mit
- Created: 2024-07-19T16:11:58.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T08:18:05.000Z (about 1 year ago)
- Last Synced: 2025-02-04T14:36:19.949Z (about 1 year ago)
- Language: JavaScript
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# E-commerce Backend
This is a Node.js backend for an e-commerce application using Express and MongoDB.
## Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
### Prerequisites
You need to have Node.js, npm, and MongoDB installed on your local machine.
- [Node.js](https://nodejs.org/)
- [npm](https://www.npmjs.com/)
- [MongoDB](https://www.mongodb.com/)
### Installing
1. Clone the repository:
```bash
git clone https://github.com/coderooz/ecommerce-backend.git
cd ecommerce-backend
```
2. Install the dependencies:
```bash
npm install express mongoose body-parser bcryptjs jsonwebtoken
```
3. Start MongoDB:
```bash
mongod
```
4. Start the server:
```bash
node index.js
```
5. The API will be available at `http://localhost:3000`.
### API Endpoints
- `POST /api/register` - Register a new user
- `POST /api/login` - Login a user and get a token
- `GET /api/products` - Retrieve all products
- `POST /api/products` - Create a new product (protected)
### Built With
- [Express](https://expressjs.com/) - The web framework used
- [Mongoose](https://mongoosejs.com/) - MongoDB object modeling tool
- [Body-parser](https://www.npmjs.com/package/body-parser) - Node.js body parsing middleware
- [Bcryptjs](https://www.npmjs.com/package/bcryptjs) - Library to hash passwords
- [Jsonwebtoken](https://www.npmjs.com/package/jsonwebtoken) - Library to sign and verify tokens
### Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on our code of conduct, and the process for submitting pull requests to us.
### Authors
- **Ranit Saha** - *Initial work* - [Coderooz](https://github.com/coderooz)
### License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details
---