pandaclose is a sustainability-driven feature for a food delivery app that helps reduce food waste. Vendors can list closing deals on dishes nearing expiration, while consumers can explore these deals via a list view or map view. The backend powers the mySQL database hosted on Docker.
This repository contains the backend implementation built using Golang, MySQ, and containerized with Docker Compose and Colima.
- Frontend Repository (React, Tailwind CSS)
- Backend Repository (Golang, MySQL, Docker Compose, Colima)
Follow these steps to run the backend server and database locally:
- Go (
brew install go
) - Docker & Docker Compose (
brew install docker docker-compose
) - Colima (
brew install colima
)
-
Start colima
colima start
-
Navigate to the
/backend/goapp
directorycd backend/goapp go mod tidy
-
Navigate to the
/backend
directorycd backend docker-compose up --build -d
-
Test the server health with
curl http://localhost:8080/ping
There are 5 endpoint routes on backend service running on port 8080, accessible via frontend service running on port 5173:
Each query should be prefixed with curl http://localhost:8080
, following by the following suffix commands:
/ping
(GET): server health-check/vendors
(GET): fetch vendors/dishes
(GET): fetch dishes/vendors/{id}
(GET): fetch vendors by id/dishes/vendors/{id}
(GET): fetch dishes by vendor id
Supermarkets and products are currently unused attributes that could be included in future builds.
The MySQL database schema supports vendors, dishes, supermarkets, and products, capturing relationships between food vendors, listed dishes, and supermarkets offering rescue products.
For detailed changes or future edits, refer to the Mermaid.js source file.