https://github.com/swapnilwakchaure/octet_design_studio_backend_assignment
Design the data structure and build a RESTful API which provides the job related data and able to do crud operation on it.
https://github.com/swapnilwakchaure/octet_design_studio_backend_assignment
cors expressjs mongodb mongoose nodejs
Last synced: 2 months ago
JSON representation
Design the data structure and build a RESTful API which provides the job related data and able to do crud operation on it.
- Host: GitHub
- URL: https://github.com/swapnilwakchaure/octet_design_studio_backend_assignment
- Owner: swapnilwakchaure
- Created: 2023-08-02T03:01:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-03T11:55:17.000Z (almost 3 years ago)
- Last Synced: 2025-06-28T01:02:32.306Z (12 months ago)
- Topics: cors, expressjs, mongodb, mongoose, nodejs
- Language: JavaScript
- Homepage: https://octet-design-studio-backend-assignment.vercel.app
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Octet_Design_Studio_Backend_Assignment
Design the data structure and build a RESTful API which provides the job related data and able to do crud operation on it.
## Deployed url of backend API below
`https://octet-design-studio-backend-api-url.vercel.app`
### Authentication Routes (register / login)
1. For REGISTRATION URL
`/auth/register` route accepts
`name` (String)
`email` (String)
`password` (String)
and hash the password into a long string and provided a success message to the user
2. For LOGIN URL
`/auth/login` route accepts
`email` (String)
`password` (String)
and provided the token to the login user
## PRODUCT Routes
## Below sample data when you fetch get request to the API
```js
{
"name": "Specialist", ( String )
"location": "Colmbo, India", ( String )
"posted": "23rd May", ( String )
"status": "Published", ( String )
"applied": 40, ( Number )
"jobViews": 100, ( Number )
"daysLeft": 7, ( Number )
"premium": false, ( Boolean )
"dateFormat": "2023-05-23" ( String )
}
```
### to fetch the requests to API
1. GET Route
`/jobs`
by fetch will get the data
2. POST Route
`/jobs/addjobs`
we need to provide all the detailed related data and it takes care about the required fields
```js
let example,
const payload = { name, location, posted, status, applied, jobViews, daysLeft, premium, dateFormat };
fetch(`api-url`, payload)
.then((res) => {
console.log('res: ',res);
})
.catch((error) => {
console.log('error: ',error);
})
```
3. PATCH Route
`/jobs/update/:id`
for update the data we need to provide an id as a params and data as a body.
4. DELETE Route
`/jobs/delete/:id`
for delete a unique element from the database, so need to provide an id as query params and it will automatically handled by backend code.
## Thank you for reading.