Skip to content

Git-Food/delivery

Repository files navigation

Git-Food API

Overview

This repository includes the relevant code base used to deploy the back-end API on Heroku.

Deployed API: https://git-food.herokuapp.com/

To find the complimentary UI code base, its deployment instructions, and deployment location, please visit the following repository:

https://github.com/Git-Food/delivery-ui

Relevant Project Documentation & Presentation

Presentation: Video linked here

All relevant Project documentation can be viewed in our sharepoint Project Documentation Folder. The Project Documentation Folder includes the following documents:

  • Regular Meeting Notes
  • Design Document
  • UML Activity Diagram
  • UML Class Diagram
  • User Stories
  • UI Wireframe

Deployment Instructions:

  1. Clone repository

  2. Decide whether to deploy to Heroku via Heroku CLI & Git or via Github Integration

  3. Create an Atlas (MongoDB) account and setup and connect to your cluster. Make note of your username, password, and MongoDB URL

  4. If you plan to run the application on your localhost:5000, it is best advised to set up a local environmental variable so that you can connect to the database easily. The environmental variable should match the URL provided by Atlas:

    MONGODB_URI=<MongoDB URL>
    

    This variable needs to also be configured within Heroku to ensure the application connects to the Database correctly when depoyed. These Config Vars may be defined either using the Heroku CLI or directly on the Heroku website under settings.

  5. Follow the necessary Heroku instructions mentioned in (2) to sucessfully deploy the application.


APIs used for Git-Food Application

Menu API

Description fetch menu for a particular restaurant based on menu id.
Method get
Url "/menu/:id"

Orders API

Description fetch orders for a specified user id.
Method get
Url “/orderhistory”
Params { userId }

Restaurants API

Description fetch all restaurants available.
Method get
Url “/restaurant”

Shopping cart by user API

Description fetch a shopping cart associated to a user id.
Method get
Url “/shoppingcartbyuser”
Params { userid }

Add order item to shopping cart API

Description put and order item into the shopping cart.
Method put
Url “/addorderitem”
Params { userid, menuitem, specialnote, quantity }

Increment order item quantity on shopping cart API

Description increment quantity of a particular order item already in the shopping cart.
Method put
Url “/incrementorderitem”
Params { userid, orderitem }

Decrement order item quantity on shopping cart API

Description decrement quantity of a particular order item already in the shopping cart.
Method put
Url “/decrementorderitem”
Params { userid, orderitem }

Clear shopping cart API

Description Remove all items from a shopping cart.
Method put
Url “/clearshoppingcart”
Params { userid }

Checkout API

Description Executes checkout process. Clear shopping cart and create and Order.
Method post
Url “/checkout”
Params { userid }

Requirements

A recent Gradle (>= 6.1.1 but < 7.0.0) and JDK 8.

Building

./gradlew build

Testing

./gradlew test

Testing JaCoCo

./gradlew jacocoTestReport

Running

./gradlew run

The server will start on port 5000 by default.

Deploying to Heroku

Configure as normal and use git push heroku main.

./gradlew build deployHeroku works to deploy without pushes...sometimes.

Spotless?

Spotless automatically formats code. If it detects errors, run ./gradlew spotlessApply to automatically fix them. ./gradlew spotlessCheck can be used to directly invoke Spotless.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages