Skip to content

Replate-EU/Backend

Repository files navigation

Replate

Replate is a web project that aims to make the sharing of left over food, from restaurants to charities that deal with feeding the homeless, an easier experience.

Features

  • Businesses can create food 'pickups' which are then listed on the web page
  • Volunteers can accept available pickups which will remove them from public listings
  • Businesses can delete a pickup after a volunteer has collected the pickup from the business

Application Links

Trello API Link

Getting Started

NPM Scripts

To get the server running locally:

  • Clone this repo
  • npm install to install all required dependencies
  • npm run server to start the local server
  • test to start server using test enviromennt
  • npx knex migrate:latest to migrate the tables
  • npx knex seed:run to seed the tables
  • npx knex migrate:rollback to rollback all tables

Technologies

NodeJS - is a JavaScript runtime built on Chrome's V8 JavaScript engine.

The Express.js backend framework was used to build the server. Fast, unopinionated, minimalist web framework for Node.js

Why Express.js?

  • Fast
  • Efficient
  • Scalable
  • Lightweight(framework)

Supporting Technologies

Linter

  • ESLint - The pluggable linting utility for JavaScript and JSX

Test Tools

  • Jest - Jest is a delightful JavaScript Testing Framework with a focus on simplicity.
  • Supertest

API Documentation

Auth Routes

Method Endpoint Access Control Description
POST /auth/register all users Creates a new user account
POST /auth/login all users Returns a token

User Routers

Method Endpoint Access Control Description
GET /users/:id authenticated user Returns user of :id
PUT /users/:id authenticated user Updates an existing user
PUT /users authenticated user Updates an existing user's account
POST /users/details authenticated user Create user details
DELETE /users/:id authenticated user Removes an existing user
DELETE /users/remove/details authenticated user Remove account details of logged in

Pickup Routers

Method Endpoint Access Control Description
GET /pickups authenticated user Returns all uncompleted pickups
GET /pickups/:id/details authenticated user Returns pickup details at :id
POST /pickups authenticated user Creates a new pickup
GET /pickups/me authenticated user Returns all pickups of logged in
DELETE /pickups/:id authenticated user Removes an existing pickup at :id

About

Many businesses have leftover food at the end of the day. Replate is an easy to use app that lets them effortlessly have those extras picked up by a Replate volunteer and donated to one of our worthy partner organizations.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors