Giter VIP home page Giter VIP logo

nc-group-project's Introduction

Linkage Back-End

Table of contents

About

This is a RESTful API for Linkage Back-End database. The database is MongoDB Atlas, interacted with via Mongoose and Express.js. It contains data on users, visits and passwords, which are accessible via the endpoints provided and appropriate GET, POST, PATCH and DELETE methods. A complete list of endpoints and methods is accessible in the endpoints.json file.

Testing was carried out using Jest and Supertest.

API has been hosted with Heroku here.

Prerequisites

Please ensure the following are installed:

  • node: v17.8.0
  • express: 4.17.3,
  • mongoose: 6.2.7
  • npm: v8.1.2

Getting Started

To run this project you will need to do the following:

  1. Clone this repository onto your local machine.
git clone https://github.com/imevanc/nc-group-project

  1. Navigate inside the folder
cd nc-group-project

  1. Open the directory in your code editor.
code . (for VScode)
  1. Install all dependencies
npm install
  1. Create a .env file in order to successfully connect to the two databases locally. Inside, add PORT=5000,MONGO_URI and MONGO_TEST - to connect to test and development databases,TOKEN_SECRET- to encript passwords.

  2. Finally to run the server locally enter the following command in your terminal:

npm start

This will run the server on port 9090. All endpoints can be found locally on http://localhost:5000.

Testing

To test the API navigate to the project directory and enter the following command:

npm test

API Routes

GET /api/users

returns a list of all users

GET /api/visits

returns a list of all visits

GET /api/users/:userId

returns a user object from the id requested

PATCH /api/users/:userId

returns a user object with the updated properties

POST /api/auth/signup

returns a new user object

POST /api/auth/login

returns a user object with a unique access token

DELETE /api/users/:userId

deletes selected user from the array of all users

GET /api/users/:userId/visits

returns an array of all visits corresponding to a user

POST /api/visits

returns a new visit object

GET /api/visits/:visitId

returns a visit object from the id requested

DELETE /api/visits/:visitId

deletes selected visit from the array of all visits

GET /api

returns a json object of the path above, with example responses

nc-group-project's People

Contributors

katechern avatar bertf1966 avatar pimmy17 avatar freddiestoker7 avatar jpfinlay avatar imevanc avatar bitkoda avatar

Stargazers

 avatar

Watchers

 avatar

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.