Skip to content

averygan/bon-appetea-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pandaclose - foodpanda Hackathon (Backend)

Overview

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.

Table of Contents

  1. Installation and Setup
  2. Performing Database Queries
  3. Database Schema

Installation & Setup

Follow these steps to run the backend server and database locally:

Install the following on your machine

  • Go (brew install go)
  • Docker & Docker Compose (brew install docker docker-compose)
  • Colima (brew install colima)

Hosting the database

  1. Start colima

    colima start
  2. Navigate to the /backend/goapp directory

    cd backend/goapp
    go mod tidy
  3. Navigate to the /backend directory

    cd backend
    docker-compose up --build -d
  4. Test the server health with

    curl http://localhost:8080/ping

Performing Database Queries

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.

Database Schema

The MySQL database schema supports vendors, dishes, supermarkets, and products, capturing relationships between food vendors, listed dishes, and supermarkets offering rescue products.

Database Schema

For detailed changes or future edits, refer to the Mermaid.js source file.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published