Giter Club home page Giter Club logo

replate's Introduction

Build Status Coverage Status Maintainability Language grade: JavaScript License: MIT

backend

API Service for replate application ๐Ÿš€.

Link to API: https://re-plate.herokuapp.com/

How to setup the project

  • Create an account on ElephantSQl
  • Create a database instance in ElephantSQL and copy the connection string (URL)
  • create a .env file at the root of the project, copy the content of .env.example into it.
  • Assign the URL above to the DB_URL in .env file
  • npm install or yarn install
  • npm migrate or yarn migrate
  • npm run dev or yarn dev

Built With

Testing Tools

Getting Started

Prerequisites

You need Nodejs Installed to be able to run this project on your machine.

Installing

  • Clone Repository
git clone https://github.com/re-plate/backend 


  • Change Directory To Backend
cd backend


  • Install Dependencies
npm install


  • Start Application
npm start


  • Run Test
npm test


  • Run Coverage Report
npm run coveralls

API Routes


DESCRIPTION HTTP METHOD ROUTES ACCESS
Register User POST /api/v1/auth/register PUBLIC
Login User POST /api/v1/auth/login PUBLIC
Create Request POST /api/v1/requests/ PRIVATE
Get All Requests GET /api/v1/requests/all PRIVATE
Get Request By Id GET /api/v1/requests/:id PRIVATE
Update Request PUT /api/v1/requests/:id PRIVATE
Delete Request DELETE /api/v1/requests/:id PRIVATE
Get Created Requests GET /api/v1/requests/ PRIVATE
Accept Request POST /api/v1/requests/:id/action PRIVATE
Search Business GET /api/v1/search/business?name=query PRIVATE
Search Request GET /api/v1/search/requests PRIVATE

Register Route

Access: Public Method: POST Route: /api/v1/auth/register Payload: { name: STRING (required), username: STRING (required), email: STRING (required), password: STRING (required), type: INTEGER (required), phone: STRING (optional) }

Login Route

Access: Public Method: POST Route: /api/v1/auth/login Payload: { username: STRING (required), password: STRING (required) }

Create Request Route

Access: Private Method: POST Route: /api/v1/requests headers: { Authorization: token } Payload: { name: STRING (required), food_type: STRING (required), pickup_date: STRING (required), pickup_time: STRING (required), comment: STRING (optional), instruction: STRING (optional), }

Get All Requests (Business)

Access: Private Method: GET Route: /api/v1/requests headers: { Authorization: token }

Get All Requests (Volunteer)

Access: Private Method: GET Route: /api/v1/requests/all headers: { Authorization: token }

Get Request By Id

Access: Private Method: GET Route: /api/v1/requests/:id headers: { Authorization: token }

Update Request Route

Access: Private Method: PUT Route: /api/v1/requests/:id headers: { Authorization: token } Payload: { name: STRING (required), food_type: STRING (required), pickup_date: STRING (required), pickup_time: STRING (required), comment: STRING (optional), instruction: STRING (optional), }

Delete Request By Id

Access: Private Method: DELETE Route: /api/v1/requests/:id headers: { Authorization: token }

Accept Request By Id (Volunteer)

Access: Private Method: POST Route: /api/v1/requests/:id/action headers: { Authorization: token } Payload: { status: INTEGER (required) }

Search Business (Volunteer)

Access: Private Method: GET Route: /api/v1/search/business?name=query headers: { Authorization: token }

replate's People

Contributors

easybuoy avatar

Watchers

 avatar  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.