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
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
-
Decide whether to deploy to Heroku via Heroku CLI & Git or via Github Integration
-
Create an Atlas (MongoDB) account and setup and connect to your cluster. Make note of your username, password, and MongoDB URL
-
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 Varsmay be defined either using the Heroku CLI or directly on the Heroku website under settings. -
Follow the necessary Heroku instructions mentioned in (2) to sucessfully deploy the application.
Base URL: https://git-food.herokuapp.com
| Description | fetch menu for a particular restaurant based on menu id. |
|---|---|
| Method | get |
| Url | "/menu/:id" |
| Description | fetch orders for a specified user id. |
|---|---|
| Method | get |
| Url | “/orderhistory” |
| Params | { userId } |
| Description | fetch all restaurants available. |
|---|---|
| Method | get |
| Url | “/restaurant” |
| Description | fetch a shopping cart associated to a user id. |
|---|---|
| Method | get |
| Url | “/shoppingcartbyuser” |
| Params | { userid } |
| Description | put and order item into the shopping cart. |
|---|---|
| Method | put |
| Url | “/addorderitem” |
| Params | { userid, menuitem, specialnote, quantity } |
| Description | increment quantity of a particular order item already in the shopping cart. |
|---|---|
| Method | put |
| Url | “/incrementorderitem” |
| Params | { userid, orderitem } |
| Description | decrement quantity of a particular order item already in the shopping cart. |
|---|---|
| Method | put |
| Url | “/decrementorderitem” |
| Params | { userid, orderitem } |
| Description | Remove all items from a shopping cart. |
|---|---|
| Method | put |
| Url | “/clearshoppingcart” |
| Params | { userid } |
| Description | Executes checkout process. Clear shopping cart and create and Order. |
|---|---|
| Method | post |
| Url | “/checkout” |
| Params | { userid } |
A recent Gradle (>= 6.1.1 but < 7.0.0) and JDK 8.
./gradlew build
./gradlew test
./gradlew jacocoTestReport
./gradlew run
The server will start on port 5000 by default.
Configure as normal and use git push heroku main.
./gradlew build deployHeroku works to deploy without pushes...sometimes.
Spotless automatically formats code. If it detects errors, run ./gradlew spotlessApply
to automatically fix them. ./gradlew spotlessCheck can be used to directly invoke
Spotless.