Document management system is a simple API used to track, manage and store documents.
The application was developed with NodeJs while using Express for routing. The Postgres database was used with sequelize as the ORM
Make sure that you have NodeJs and Postgres installed
- Clone the repository
git@github.com:puritybirir/CP2-DMS.git
- Navigate to the directory.
- Install the project dependencies using
npm install
- Run tests
npm test
- create an environment file that will be read by the project everytime it starts up by running and set the secret key and salt rounds
SECRET="coolSecret"
SALTROUNDS=10
Users
Request | Endpoint | Description |
---|---|---|
POST | /users/login | Logs a user in. |
POST | /users/logout | Logs a user out. |
POST | /users | Creates a new user. |
GET | /users | Find matching instances of user. |
GET | /users/?limit={integer}&offset={integer} | Pagination for users. |
GET | /users/:id | Find user. |
PUT | /users/:id | Update user attributes. |
DELETE | /users/:id | Delete user. |
GET | /search/users/?q={username} | Search for a user. |
POST | /documents | Creates a new document instance. |
GET | /documents | Find matching instances of document. |
GET | /documents/?limit={integer}&offset={integer}} | Pagination for docs. |
GET | /documents/:id | Find document. |
PUT | /documents/:id | Update document attributes. |
DELETE | /documents/:id | Delete document. |
GET | /users/:id/documents | Find all documents belonging to the user. |
GET | /search/documents/?q={doctitle}} | Search for a doc. |
POST | /role | Creates a new role |
GET | /roles/:id | Finds one specific role |
UPDATE | /roles/:id | Updates a role |
GET | /roles | Lists all the roles |
DELETE | /roles/:id | Deletes a specific role by id. |