Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ujjwal-kr/node-user-api
A basic user management api
https://github.com/ujjwal-kr/node-user-api
express mongodb nodejs
Last synced: about 1 month ago
JSON representation
A basic user management api
- Host: GitHub
- URL: https://github.com/ujjwal-kr/node-user-api
- Owner: ujjwal-kr
- Created: 2022-06-27T11:38:48.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-06-29T14:47:05.000Z (over 2 years ago)
- Last Synced: 2023-03-07T06:26:14.374Z (almost 2 years ago)
- Topics: express, mongodb, nodejs
- Language: JavaScript
- Homepage: https://node-api-xyz.herokuapp.com
- Size: 447 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Node User API
A simple user management API written using javascript. The client is written in react and is deployed to https://node-user-api.vercel.app## Structure
- Stack: Backend: Nodejs and expressjs, Front End: Reactjs with vite
- Testing: jest and supertest
- Database: MongoDB (Atlas)
- Other tools:
- `nodemon` for dev server
- `morgan` for logging
- `helmet` to set security headers
- `dotenv` to manage environment variables
- `cors` to set cross site headers
- `prettier` to format codeThe client resides in the `/client` folder
The API is deployed using heroku on https://node-api-xyz.herokuapp.com
## Demo Video
[![Demo Video](https://img.youtube.com/vi/jSceqqxiCVU/0.jpg)](https://www.youtube.com/watch?v=jSceqqxiCVU)## How to setup
- Make sure to have nodejs and git installed
- Clone the repo using `git clone https://github.com/ujjwal-kr/node-user-api`
- `cd` into the project folder and run `npm i` to install the dependencies
- Rename the `.env.example file to .env` and input your mongodb URI
- Run `npm run dev` to start the development server
- Run `npm run test` to run all the tests## Endpoints
```
GET /users [Gets all the users]
GET /users/id [Gets a single user with the specified id]
POST /users [Adds a new user] { name: string, email: string, password: string }
PATCH /users [Updates existing user with the specified id] { name: string, email: string, password: string } // data can be partial
DELETE /users/id [Deletes user with the specified id]
```