ecomm/README.md

74 lines
1.5 KiB
Markdown
Raw Normal View History

2023-06-11 09:57:27 +00:00
# Ecomm Backend
2023-06-11 09:10:49 +00:00
2023-06-11 09:57:27 +00:00
This repository contains the backend implementation for the Ecomm e-commerce application.
2023-06-11 09:10:49 +00:00
2023-06-11 09:57:27 +00:00
## Description
2023-06-11 09:10:49 +00:00
2023-06-11 09:57:27 +00:00
This is a simple e-commerce backend application built with Node.js, TypeScript, Express.js, MongoDB, and Docker. It provides API endpoints to manage users and products.
2023-06-11 09:10:49 +00:00
2023-06-11 09:57:27 +00:00
## Table of Contents
2023-06-11 09:10:49 +00:00
2023-06-11 09:57:27 +00:00
- [Technologies Used](#technologies-used)
- [How to Run](#how-to-run)
- [API Documentation](#api-documentation)
- [Users](#users)
- [Create a New User](#create-a-new-user---post-users)
- [Login](#login---post-userslogin)
- [Products](#products)
- [Get All Products](#get-all-products---get-products)
## Technologies Used
- Node.js
- TypeScript
- Express.js
- MongoDB
- Mongoose ORM
- Docker (docker-compose)
- bcrypt
- JWT
## How to Run
To run the Ecomm backend application, follow these steps:
1. Clone the repository.
2. Ensure that you have Docker and Docker Compose installed.
3. Implement the required environment variables by creating an `.env` file.
4. Run the following command in the root directory:
```shell
docker-compose up
The application will be running on port 3000, and the database will be running on port 27017.
API Documentation
Users
Create a New User - POST /users
Creates a new user.
Request Body
2023-06-11 09:50:33 +00:00
```
{
2023-06-11 09:57:27 +00:00
"name": "string",
"email": "string",
"password": "string"
2023-06-11 09:50:33 +00:00
}
```
2023-06-11 09:57:27 +00:00
Response Body
2023-06-11 09:50:33 +00:00
```
{
2023-06-11 09:57:27 +00:00
"user": {
"_id": "string",
"name": "string",
"email": "string",
"password": "string",
"createdAt": "string",
"updatedAt": "string",
"__v": "number"
},
"token": "string"
2023-06-11 09:58:01 +00:00
}
2023-06-11 09:50:33 +00:00
```