{"id":16456894,"url":"https://github.com/oyinda-subair/doc-management","last_synced_at":"2026-04-29T21:03:56.476Z","repository":{"id":88786103,"uuid":"83533069","full_name":"oyinda-subair/doc-management","owner":"oyinda-subair","description":"A full stack document management system","archived":false,"fork":false,"pushed_at":"2017-05-16T10:00:43.000Z","size":8773,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"staging","last_synced_at":"2025-02-27T01:17:44.412Z","etag":null,"topics":["dms","javascript","postgres","react","redux"],"latest_commit_sha":null,"homepage":"https://doc-management.herokuapp.com/login","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oyinda-subair.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-01T08:50:32.000Z","updated_at":"2018-08-07T14:26:17.000Z","dependencies_parsed_at":"2023-06-15T07:15:39.708Z","dependency_job_id":null,"html_url":"https://github.com/oyinda-subair/doc-management","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oyinda-subair/doc-management","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyinda-subair%2Fdoc-management","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyinda-subair%2Fdoc-management/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyinda-subair%2Fdoc-management/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyinda-subair%2Fdoc-management/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oyinda-subair","download_url":"https://codeload.github.com/oyinda-subair/doc-management/tar.gz/refs/heads/staging","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oyinda-subair%2Fdoc-management/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32443576,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T20:22:27.477Z","status":"ssl_error","status_checked_at":"2026-04-29T20:22:26.507Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dms","javascript","postgres","react","redux"],"created_at":"2024-10-11T10:28:08.653Z","updated_at":"2026-04-29T21:03:56.462Z","avatar_url":"https://github.com/oyinda-subair.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Coverage Status](https://coveralls.io/repos/github/andela-osubair/doc-management/badge.svg?branch=staging)](https://coveralls.io/github/andela-osubair/doc-management?branch=staging) [![Build Status](https://travis-ci.org/andela-osubair/doc-management.svg?branch=master)](https://travis-ci.org/andela-osubair/doc-management) [![Code Climate](https://codeclimate.com/github/andela-osubair/doc-management/badges/gpa.svg)](https://codeclimate.com/github/andela-osubair/doc-management)\n\n# Document Management System\nDocument Management System is a react redux application based on RESTful API for users to create and manage documents giving different privileges based on user roles and managing authentication using JWT.\n\n## Development\nThis application was developed using the following frameworks.\n\n*   [NodeJs](https://nodejs.org)\n*   [React Redux](http://redux.js.org/docs/basics/UsageWithReact.html)\n*   [express](https://expressjs.com/)\n*   [Sequelize](https://sequelizejs.org) as [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping)\n\n## Application Features\n###### User Authentication\nUsers are authenticated and validated us JWT web token. Generating tokens on signup and login ensures documents and API endpoints are protected.\n\n###### Document Management\n*   Create an account\n*   Login with your credentials\n*   Create new document with specifying document title, content and document access\n*   Edit Documents\n*   Delete documents\n*   View public documents created by other users.\n*   View documents created by his access group with access level set as `role`.\n*   Search a users public documents.\n*   View `public` and `role` access level documents of other regular users.\n*   Logout\n\n-   In addition to the general user functions, an admin user can:\n    -   View all users.\n    -   View all created documents except documents with access set to private.\n    -   Delete any user.\n    -   Update any user's record.\n    -   Create a new role.\n    -   View all created roles.\n    -   Search for any user.\n\n## Installation\n-   Ensure that you have NodeJs and Postgres installed on your machine\n-   Clone the repository `$ git clone https://github.com/andela-osubair/doc-management.git`\n-   Change into the directory `$ cd doc-management`\n-   Install all required dependencies with `$ npm install`\n-   Create a `.env` file in your root directory as described in `.env.sample` file\n\n## Usage\n-   Run DB Migrate command with  `sequelize  db:migrate`\n-   Seed you DB by running this command `npm run db:seed`, this seeds Admin Role and Regular Role.\n-   Run `npm run start:dev` to start the application on development environment\n\n## Testing\n-   Run DB migrate command with `npm run db:migrate:test`.\n-   Run Test `npm test`\n-   You can undo your migrations by running this command `npm run db:migrate:test:undo`.\n\n` I strongly suggest using separate DB for testing and development `\n\n## API Documentation\n-----\nThe API has routes, each dedicated to a single task that uses HTTP response codes to indicate API status and errors.\n#### API Features\n\nThe following features make up the Document Management System API:\n\n###### Authentication\n-   It uses JSON Web Token (JWT) for authentication.  \n\n-   It generates a token on successful login or account creation and returns it to the consumer.  \n\n-   It verifies the token to ensures a user is authenticated to access protected endpoints.\n\n###### Users\n\n-   It allows users to be created.  \n\n-   It allows users to login and obtain a token  \n\n-   It allows authenticated users to retrieve and update their information.  \n\n-   It allows the admin to manage users.\n\n###### Roles\n\n-   It ensures roles can be created, retrieved, updated and deleted by an admin user.\n-   A non-admin user cannot create, retrieve, modify, or delete roles.  \n-   it allows for assignment of roles to users\n\n###### Documents\n\n-   It allows new documents to be created by authenticated users.  \n\n-   It ensures all documents are accessible based on the permission specified.  \n\n-   It allows admin users to create, retrieve, modify, and delete documents.\n\n\n-   It ensures users can delete, edit and update documents that they own.  \n\n-   It allows users to retrieve all documents they own as well as public documents.\n\n###### Search\n\n-   It allows users to search public documents for a specified search term.\n\n-   It allows admin to retrieve all documents that matches search term.\n\n-   It allows admin to search users based on a specified search term\n\n#### Available API Endpoints and their Functionality\n\nEndPoint                    |   Functionality\n----------------------------|------------------------\nPOST /users/login           |   Logs a user in.\nPOST /users/logout          |   Logs a user out.\nPOST /users/                |   Creates a new user.\nGET /users/                 |   Find matching instances of user.\nGET /users/\u003cid\u003e             |   Find user.\nPUT /users/\u003cid\u003e             |   Update user attributes.\nDELETE /users/\u003cid\u003e          |   Delete user.\nGET /users/?limit={interger}\u0026offset={interger}| Pagination for users\nPOST /documents/            |   Creates a new document instance.\nGET /documents/             |   Find matching instances of document.\nGET /documents/\u003cid\u003e         |   Find document.\nGET /documents/?limit={interger}\u0026offset={interger}| Pagination for documents\nPUT /documents/\u003cid\u003e         |   Update document attributes.\nDELETE /documents/\u003cid\u003e      |   Delete document.\nGET /users/\u003cid\u003e/documents   |   Find all documents belonging to the user.\nGET /search/users/?q={username}   |   Gets all users with username contain the search term\nGET /search/documents/?q={doctitle}| Get all documents with title containing the search query\nGET /users/:id/alldocuments|   Get all document owned or accessible by `userId`\nGET /api/users/:identifier|Find user with email or username containing the identifier parameter\n\n#### Role\n\n###### POST HTTP Request\n-   `POST /roles`\n-   Requires: Admin Authentication\n    ###### HTTP Response\n-   HTTP Status: `201: created`\n-   JSON data\n```json\n{\n  \"id\": \"1\",\n  \"title\": \"normal\",\n  \"createdAT\": \"2017-04-04T14:22:46.984z\",\n  \"updatedAT\": \"2017-04-04T14:22:46.984z\"\n}\n```\n\n###### GET HTTP Request\n-   `GET /roles`\n-   Requires: Admin Authentication\n    ###### HTTP Response\n-   HTTP Status: `200: OK`\n-   JSON data\n```json\n{\n  \"id\": \"1\",\n  \"title\": \"normal user\",\n  \"createdAT\": \"2017-04-04T14:22:46.984z\",\n  \"updatedAT\": \"2017-04-04T16:22:46.984z\"\n}\n```\n\n#### Users\n###### POST HTTP Request\n-   `POST /users`\n    ###### HTTP response\n-   HTTP Status: `201: created`\n-   JSON data\n```json\n{\n  \"id\": \"1\",\n  \"name\": \"Loral Denzel\",\n  \"username\": \"lorri\",\n  \"email\": \"denzel.lorri@email.com\",\n  \"password\": \"password\",\n  \"roleId\": \"2\",\n  \"createdAT\": \"2017-04-04T14:22:46.984z\",\n  \"updatedAT\": \"2017-04-04T16:22:46.984z\"\n}\n```\n###### Login HTTP Request\n-   `POST /users/login`\n    ###### HTTP Response\n-   HTTP status: `200: OK`\n-   JSON Data\n```json\n{\n  \"message\": \"User authenticated successfully\"\n}\n```\n\n#### Get Users\n###### GET HTTP Request\n-   `GET /users`\n-   Requires: Admin Authentication\n    ###### HTTP Response\n-   HTTP status: `200: OK`\n-   JSON Data\n```json\n{\n  \"id\": \"1\",\n  \"name\": \"Loral Denzel\",\n  \"username\": \"lorri\",\n  \"email\": \"denzel.lorri@email.com\",\n  \"password\": \"password\",\n  \"roleId\": \"2\",\n  \"createdAT\": \"2017-04-04T14:22:46.984z\",\n  \"updatedAT\": \"2017-04-04T16:22:46.984z\"\n}\n```\n\n#### Documents\n###### POST HTTP Request\n-   `POST /documents`\n    ###### HTTP response\n-   HTTP Status: `201: created`\n-   JSON data\n```json\n{\n  \"id\": \"1\",\n  \"title\": \"My First Online Diary\",\n  \"docContent\": \"This is my first diary created on this application\",\n  \"viewAccess\": \"private\",\n  \"role\": \"1\",\n  \"userId\": \"1\",\n  \"createdAT\": \"2017-04-05T14:22:46.984z\",\n  \"updatedAT\": \"2017-04-05T14:22:46.984z\"\n}\n```\n###### GET HTTP Request\n-   `GET /documents/1`\n    ###### HTTP response\n-   HTTP Status: `200: 0k`\n-   JSON data\n```json\n{\n  \"id\": \"1\",\n  \"title\": \"My First Online Diary\",\n  \"docContent\": \"This is my first diary created on this application\",\n  \"viewAccess\": \"private\",\n  \"role\": \"1\",\n  \"userId\": \"1\",\n  \"createdAT\": \"2017-04-05T14:22:46.984z\",\n  \"updatedAT\": \"2017-04-05T14:22:46.984z\"\n}\n```\n\n#### Contribution\n### Prerequisites includes\n-   [Postgresql](https://www.postgresql.org/) and\n-   [Node.js](http://nodejs.org/) \u003e= v6.8.0.\n\n### Procedure\n1.  Clone this repository from a terminal `git clone https://github.com/andela-osubair/doc-management.git`.\n2.  Move into the project directory `cd doc-management`\n3.  Install project dependencies `npm install`\n4.  Create Postgresql database and run migrations `npm run db:migrations`.\n5.  Start the express server `npm run start:dev`.\n6.  Run test `npm test`.\n7.  Branch out of master `git checkout -b [new-branch-name]`\n8.  Make changes and commit your changes\n9.  Git push and make a pull request to my repo\n\n#### Limitations\nCurrently, we can't say our API can handle larger requests, this may be a problem when our user base grows to over million.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyinda-subair%2Fdoc-management","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foyinda-subair%2Fdoc-management","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foyinda-subair%2Fdoc-management/lists"}