Giter Site home page Giter Site logo

document-management-system's Introduction

Goldocs

CircleCI Coverage Status

Checkpoint Explanation

Goldocs is a document management system API built out in Javascript. It allows the end user to be able to create documents, and be able to share them with other people.

Requirements for setup

Usage

  • Clone the repository on your machine using the command:

git clone https://github.com/andela-skieha/document-management-system.git

  • Navigate to where you cloned the project and cd into it:

cd path/to/project/document-management-system

  • Run npm install to install the project's dependencies.

  • Create a .env file in the root of the project and set the environment variables needed to run the project:

MONGO_PROD_URL=mongodb://localhost/dms
MONGO_TEST_URL=mongodb://localhost/dms-test
MONGO_SECRET='this is super secret'
  • Run npm start to get the server running.

Tests

  • Navigate to where you cloned the project and cd into it:

cd path/to/project/document-management-system

  • Run npm test to seed the database and run tests for the system.

HTTP Verbs, Routes and Endpoints

Login/Signup

  • Signup

POST http://localhost:5000/api/users/signup

  • Login

POST http://localhost:5000/api/users/login

Users

  • Get all users

GET http://localhost:5000/api/users

  • Get user by id

GET http://localhost:5000/api/users/:user_id

  • Edit user details

PUT http://localhost:5000/api/users/:user_id

  • Delete user account

DELETE http://localhost:5000/api/users/:user_id

Documents

  • Create new document

POST http://localhost:5000/api/documents

  • Get all documents

GET http://localhost:5000/api/documents

  • Get document by id

GET http://localhost:5000/api/documents/:id

  • Edit document details

PUT http://localhost:5000/api/documents/:id

  • Delete document

DELETE http://localhost:5000/api/documents/:id

  • Get documents belonging to a particular user

GET http://localhost:5000/api/users/:user_id/documents

  • Get document by roles

GET http://localhost:5000/api/search?role=role_title

  • Get documents by creation date

GET http://localhost:5000/api/search?date=created_at_date

  • Get paginated documents

GET http://localhost:5000/api/documents?limit=set_limit&offset=set_offset

Roles

  • Create new role

POST http://localhost:5000/api/roles

  • Get all roles

GET http://localhost:5000/api/roles

  • Get role by id

GET http://localhost:5000/api/roles/:id

  • Edit role details

PUT http://localhost:5000/api/roles/:id

  • Delete role

DELETE http://localhost:5000/api/roles/:id

  • Get roles belonging to a particular user

GET http://localhost:5000/api/users/:user_id/roles

Testing with Postman

  • Run npm start to start up the server.

  • Open up Postman on your machine.

  • Visit the signup route above and create a new user with the POST verb.

POST http://localhost:5000/api/users/signup

  • Visit the login route above and with the new user's username and password, login to get a token:

POST http://localhost:5000/api/users/login

  • Take the token created, and set it in the Headers section of Postman in order to be able to access the rest of the routes:

x-access-token: token_received_on_login

Made with ❤️ by Njeri Kieha

document-management-system's People

Watchers

James Cloos avatar Njeri Kieha avatar

Forkers

wolfieorama

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.