Skip to content

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.

Notifications You must be signed in to change notification settings

furkan-dogu/ProductAPI

Repository files navigation

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

Table of Contents

Live Demo

Product API

Technologies Used

  • express
  • cors
  • dotenv
  • mongoose
  • express-async-errors
  • cookie-session
  • swagger-ui-express
  • redoc-express

Documentation

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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published