Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/furkan-dogu/productapi
This project is a backend application developed using Express.js and MongoDB. The application is capable of performing basic CRUD (Create, Read, Update, Delete) operations such as managing products and users. Additionally, it handles common needs like session management and error handling.
https://github.com/furkan-dogu/productapi
cookie-session cors dotenv express-async-errors expressjs mongoose nodejs redoc-express swagger-ui-express
Last synced: about 6 hours ago
JSON representation
This project is a backend application developed using Express.js and MongoDB. The application is capable of performing basic CRUD (Create, Read, Update, Delete) operations such as managing products and users. Additionally, it handles common needs like session management and error handling.
- Host: GitHub
- URL: https://github.com/furkan-dogu/productapi
- Owner: furkan-dogu
- Created: 2024-04-12T14:31:49.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-05-01T16:14:29.000Z (7 months ago)
- Last Synced: 2024-05-02T11:18:34.117Z (7 months ago)
- Topics: cookie-session, cors, dotenv, express-async-errors, expressjs, mongoose, nodejs, redoc-express, swagger-ui-express
- Language: JavaScript
- Homepage: https://product-api-kappa.vercel.app/
- Size: 155 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Product API
This project is a backend application developed using Express.js and MongoDB. The application is capable of performing basic CRUD (Create, Read, Update, Delete) operations such as managing products and users. Additionally, it handles common needs like session management and error handling.
### ERD
![ERD](./erd.png)
## Table of Contents
- [Technologies Used](#technologies-used)
- [Documentation](#documentation)
- [Endpoints](#endpoints)
- [Project Skeleton](#project-skeleton)## Live Demo
[Product API](https://product-api-kappa.vercel.app/)
## Technologies Used
- express
- cors
- dotenv
- mongoose
- express-async-errors
- cookie-session
- swagger-ui-express
- redoc-express### Documentation
- Swagger UI: [https://product-api-kappa.vercel.app/documents/swagger](https://product-api-kappa.vercel.app/documents/swagger)
- Redoc: [https://product-api-kappa.vercel.app/documents/redoc](https://product-api-kappa.vercel.app/documents/redoc)
- JSON Documentation: [https://product-api-kappa.vercel.app/documents/json](https://product-api-kappa.vercel.app/documents/json)## Endpoints
### Users
- `GET /user`: Lists all users.
- `POST /user`: Creates a new user.
- `GET /user/:userId`: Displays a specific user.
- `PUT /user/:userId`: Updates information of a specific user.
- `DELETE /user/:userId`: Deletes a specific user.
- `POST /user/login`: Logs a user in.
- `POST /user/logout`: Logs a user out.### Product Categories
- `GET /categories`: Lists all product categories.
- `POST /categories`: Creates a new product category.
- `GET /categories/:categoryId`: Displays a specific product category.
- `PUT /categories/:categoryId`: Updates information of a specific product category.
- `DELETE /categories/:categoryId`: Deletes a specific product category.### Products
- `GET /products`: Lists all products.
- `POST /products`: Creates a new product.
- `GET /products/:productId`: Displays a specific product.
- `PUT /products/:productId`: Updates information of a specific product.
- `DELETE /products/:productId`: Deletes a specific product.## Project Skeleton
```
Product API (folder)
│
├── src
│ ├── configs
│ │ └── dbConnection.js
│ ├── controllers
│ │ ├── categoryController.js
│ │ ├── productController.js
│ │ └── userController.js
│ ├── helpers
│ │ └── passwordEncrypt.js
│ ├── middlewares
│ │ ├── errorHandler.js
│ │ ├── queryHandler.js
│ │ └── userControl.js
│ ├── models
│ │ ├── categoryModel.js
│ │ ├── productModel.js
│ │ └── userModel.js
│ ├── routes
│ │ ├── categoryRouter.js
│ │ ├── productRouter.js
│ │ └── userRouter.js
│ └── sync.js
├── .env
├── .gitignore
├── index.js
├── package.json
├── swagger.json
├── swaggerAutogen.js
└── README.md
```