This Document Management System allows users to manage documents and the administrator to create and manage users & roles. Each User has a role while documents have owners and permissions. The Administrator can view all documents, however users can only view their own documents and public ones. The default permission for documents is public. To make a document private toggle the button at the bottom of the form.
- React
- Material UI
- Mongoose
- Node
- Install Node JS.
- Install MongoDB .
- Clone the repository here
- [cd] into the root of the Docman project directory.
- Run
npm installon the terminal.
Run npm test on the terminal while within the project root directory for
front end tests and npm testBend for backend tests.
In the project root, run npm start.
http://127.0.0.1:8080/
Click the login button on the home page. Successful login redirects you to the
dashboard.
to logout, click on the logout button on the top-right of the dashboard.
-
to view users, click on the users button on the left side menu. These brings a list of all the users and their roles.
To create a user, click on the users button on the left menu then click on the green floating button. The default permissions for new users is 'User'.
-
To create a document, click on the document button on the left menu then click on the green floating button. The default permissions for new documents is 'Public'.
To update a document choose edit on the drop down menu on the specific document. P.S. you can only update your own document.
To delete a document choose delete on the drop down menu on the specific document. P.S. you can only delete your own document.
To see a users document, click on the user and all the documents will be displayed. scroll to see them all.
NB Make sure all tests pass before running the System.
Three models are defined: Roles, Users and Documents. Roles must have a unique title on their creation. A User must have a Role defined for them. The routes are defined under server/models.
Testing is achieved through use of enzyme, mocha and chai packages. enzyme is used to simulate react events while testing. mocha is the testing framework and chai is the exception library. They will both be installed when you run npm install and the tests will run with the command npm test.
The routes are defined using react-router.
Ensure that you have installed mongodb locally or substitute with one of the available
cloud mongo databases. Before you go ahead to run the tests or work with the api, run mongod on a separate tab on your terminal. Add the configuration to the db connection in your .env file. Each time tests are run or the app is run, the database is dropped and seeded.