Run
Please make sure you have a mongodb running on your machine and PORT is 27017
And this project will running on PORT 5000
.
yarn install
yarn run server
- Import
postman_collection.json
of root directory to POSTMAN. or Check swagger ui address: http://localhost:5000/docs/ - This project is using JWT authentication, request almost every API should provided Token.
Test
yarn test
DATA SSTRUCTURE:
Doc
- [Field]
- [Container]
- Field
DATA MODEL DESIGN:
User {
name:string,
id:string,
}
Doc {
[Field] onetomany
[Container] onetomany
}
Container {
[Field]
ViewPermissions [User] onetomany
EditPermissions [User] onetomany
OwnerId - User.id
}
Field {
name: string,
value: string,
ViewPermissions [User] onetomany
EditPermissions [User] onetomany
OwnerId - User.id
}
TASK LIST DESCRIPTION:
- Create User API ✔️
- Login API ✔️
- Global Token Authentication ✔️
- Global Error Handling Middleware ✔️
- Doc/Field/Container/User Models ✔️
- Doc create API ✔️
- Doc view API(According to the authority to display the Field/Container) ✔️
- Field create API(put Field into Container and Doc after created) ✔️
- Field view API ✔️
- Field update API (Check whether the operation can be performed according to the authority) ✔️
- Field delete API (Check whether the operation can be performed according to the authority) ✔️
- Container create API ✔️
- Container view API ✔️
- Container update API(Check whether the operation can be performed according to the authority) ✔️
- Container delete API(Check whether the operation can be performed according to the authority) ✔️
- API description document (Swagger) ✔️
- Test coverage > 75%
- Set view and update permissions for user ✔️