This project's purpose is to show the code to Berkeley Assets technical team. It's a simple API built with node.js(express) and mongoDB.
- DTO
- Authentication with JSON Web token
- MongoDB
- CRUD (postman collection provided)
- Post(create, getOne, getAll, updateOne, deleteOne)
- Config environment
.
├── config # Environment variable check
├── controllers # Instructions
├── dto # Data transfer object
├── middlewares # Actions before controllers
├── models # Mongoose Schema
├── routes # Routing(post, get, patch, delete)
├── services # All the logics
├── app.js # Entry of the application
- Create env file variables with
touch .env
PORT=3001
JWT_KEY=12345
MONGO_URI=localhost:27017/berkeley
- Run
yarn
yarn dev
- Import
Berkeley.postman_collection.json
into postman{{HOST_BERKELEY}}
ishttp://localhost:3001
orhttp://localhost:3001
- Lint
yarn eslint:check
oryarn prettier:check
yarn eslint:fix
oryarn prettier:fix
yarn lint:check
oryarn lint:fix