Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mahabubr/onthread-codding-problem
https://github.com/mahabubr/onthread-codding-problem
crud expressjs mongodb typescript
Last synced: 10 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/mahabubr/onthread-codding-problem
- Owner: mahabubr
- Created: 2024-04-07T18:08:56.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-07T19:52:22.000Z (10 months ago)
- Last Synced: 2024-12-10T01:12:50.604Z (2 months ago)
- Topics: crud, expressjs, mongodb, typescript
- Language: TypeScript
- Homepage:
- Size: 46.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OneThread NodeJS Developer [ Coding Problem ]
### This is a crud operation in the orders section. I use the MVC pattern to do this backend with an organized code structure. There is a validation guard with route control.
## Technologies
1. Node
2. Express
3. Mongoose/Mongodb
4. Typescript
5. Zod## live link : https://onethread-codding-problem.vercel.app/
### Endpoints
1. /orders [ POST ] to create orders
2. /orders [ GET ] to get all data also filter by (product_id, quantities, user_id)
3. /orders/:id [ GET ] to get single data
4. /orders/:id [ PATCH ] to update order
5. /orders/:id [ DELETE ] to delete order### Create json
```
{
"user_id": "adfvc@#",
"product_id": 140,
"quantities": 50,
"payments": "636fb270d368236db763481d"
}
```
### Get response
```
{
"message": "Orders placed Successful",
"data": {
"user_id": "adfvc@#",
"product_id": 140,
"quantities": 50,
"payments": "636fb270d368236db763481d",
"_id": "6612f7b1dcdd105843616660",
"createdAt": "2024-04-07T19:44:49.680Z",
"updatedAt": "2024-04-07T19:44:49.680Z",
"__v": 0
}
}
```## How to setup in local machine
1. Clone the repository
```
git clone https://github.com/mahabubr/onthread-codding-problem.git
```
2. Open the folder in code editor and install dependencies
```
npm install
```
3. Run the Server
```
npm run dev
```
4. For build
```
npm run build
```ensure that you have install nodejs