Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kyrylodevshyrokov/mongodb-express-react-shop-app
This project is a small online store where registered only users can view, purchase, add, and modify products.
https://github.com/kyrylodevshyrokov/mongodb-express-react-shop-app
express mongodb mongodb-atlas react
Last synced: about 1 month ago
JSON representation
This project is a small online store where registered only users can view, purchase, add, and modify products.
- Host: GitHub
- URL: https://github.com/kyrylodevshyrokov/mongodb-express-react-shop-app
- Owner: kyrylodevshyrokov
- Created: 2024-06-09T11:47:21.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T08:03:30.000Z (7 months ago)
- Last Synced: 2024-06-10T09:12:43.790Z (7 months ago)
- Topics: express, mongodb, mongodb-atlas, react
- Language: JavaScript
- Homepage:
- Size: 982 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Online Shop Application
## About
This project is a small online store where registered users can view, purchase, add, and modify products.
## Features
- Users can register, log in and log out in the online store.
- Registered users can perform full CRUD operations on store products.## Technologies
- **Express:** a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.
- **MongoDB:** a source-available, cross-platform, document-oriented database program.
- **MongoDB Atlas:** the Cloud-Native Document Database as a Service.
- **React:** a free and open-source front-end JavaScript library for building user interfaces based on components.## Getting Started
1. Clone the repository locally to your machine.
2. Run the command `npm install` to download all project dependencies.
3. Fill `.env` file. Here is an example:
```javascript
PORT=3000
MONGO_DB_URL=your_mongo_db_atlas_url
```
4. Start the server side of the application with the command `npm run start:server`.
5. In a new terminal, start the client side of the application with the command `npm start`. The frontend part of the application will be available on port 3100.## API Endpoints
### _Auth And Users_
### Register
- Method: **POST**
- URL: {{URL}}/signup
- Data:
```javascript
{
"email": "[email protected]",
"password": "password"
}
```
- Requires Auth: **NO**
- Description: This endpoint enables users to register by sending a POST request containing their chosen email and password.### Authenticate
- Method: **POST**
- URL: {{URL}}/login
- Data:
```javascript
{
"email": "[email protected]",
"password": "password"
}
```
- Requires Auth: **NO**
- Description: This endpoint enables users authenticate by sending a POST request with their email and password; upon successful authentication, the server returns a JSON object containing an access token.### _Products_
### Get All Products
- Method: **GET**
- URL: {{URL}}/products
- Requires Auth: On the backend - **NO**, on the frontend - **YES**
- Description: This endpoint allows authenticated users to get list of all products in the shop.### Get Product By ID
- Method: **GET**
- URL: {{URL}}/products/:id
- Requires Auth: On the backend - **NO**, on the frontend - **YES**
- Description: This endpoint allows authenticated users to get details about one product by ID.### Add New Product
- Method: **POST**
- URL: {{URL}}/products
- Data:
```javascript
{
"name": "A book",
"price": "20.50",
"image": "book.jpg",
"description": "That is a must-read book!"
}
```
- Requires Auth: On the backend - **NO**, on the frontend - **YES**
- Description: This endpoint allows authenticated users to add a new product to online shop with filled following fields: name, price, image, and description.### Edit Product By ID
- Method: **PATCH**
- URL: {{URL}}/products/:id
- Data:
```javascript
{
"name": "A book",
"price": "20.50",
"image": "book.jpg",
"description": "That is a must-read book!"
}
```
- Requires Auth: On the backend - **NO**, on the frontend - **YES**
- Description: This endpoint allows authenticated users to edit the product by changing name, price, image, or/and description.### Delete Product By ID
- Method: **DELETE**
- URL: {{URL}}/products/:id
- Requires Auth: On the backend - **NO**, on the frontend - **YES**
- Description: This endpoint allows authenticated users to delete the product by ID.