Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rezoanulhasan/express-mongooes-crud-opperation
https://github.com/rezoanulhasan/express-mongooes-crud-opperation
Last synced: 6 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/rezoanulhasan/express-mongooes-crud-opperation
- Owner: RezoanulHasan
- Created: 2023-11-22T17:26:01.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2023-12-12T08:56:23.000Z (11 months ago)
- Last Synced: 2023-12-12T09:43:40.380Z (11 months ago)
- Language: TypeScript
- Size: 81.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# express-mongooes-typescript-CRUD-opperation
## project: Data Base Design
## live link: https://users-orders.vercel.app/## Technology use
- Node js
- Express js
- Mongoose
- typescript
- bcrypt (validation)
- Zod (validation)
- eslint ( code formatting and quality checking )
- prettier (maintain code structure)## Table of Contents
- [API Endpoints](#api-endpoints)
- [Create User](#create-user)
- [Get All Users](#get-all-users)
- [Get User by ID](#get-user-by-id)
- [Update User](#update-user)
- [Delete User](#delete-user)
- [Add Order to User](#add-order-to-user)
- [Get Orders for User](#get-orders-for-user)
- [Calculate Total Price of Orders for User](#calculate-total-price-of-orders-for-user)## API Endpoints
### Create User
- **Endpoint:** `/api/users`
- **HTTP Method:** POST
- **Controller Method:** `UserController.createUser`### Get All Users
- **Endpoint:** `/api/users`
- **HTTP Method:** GET
- **Controller Method:** `UserController.getAllUsers`### Get User by ID
- **Endpoint:** `/api/users/:userId`
- **HTTP Method:** GET
- **Controller Method:** `UserController.getUserById`### Update User
- **Endpoint:** `/api/users/:userId`
- **HTTP Method:** PUT
- **Controller Method:** `UserController.updateUser`### Delete User
- **Endpoint:** `/api/users/:userId`
- **HTTP Method:** DELETE
- **Controller Method:** `UserController.deleteUser`### Add Order to User
- **Endpoint:** `/api/users/:userId/orders`
- **HTTP Method:** PUT
- **Controller Method:** `UserController.addOrder`### Get Orders for User
- **Endpoint:** `/api/users/:userId/orders`
- **HTTP Method:** GET
- **Controller Method:** `UserController.getOrders`### Calculate the Total Price of Orders for User
- **Endpoint:** `/api/users/:userId/orders/total-price`
- **HTTP Method:** GET
- **Controller Method:** `UserController.calculateTotalPrice`## Getting Started
to set up and run projects locally
- Colen this repository
- npm install
- npm run build
- npm run start: dev