Starbucks-Backend ©️ Build Status

This repository provides a sample backend code for creating a ☕ ordering REST application like Starbucks.


Local Setup: 💻

Pre-requisites: 👀

  • Java-8
  • mysql 5.7 & above
  • IntelliJ IDE (Optional)

How to Compile: 🔨

  • Go to the parent project directory cd starbucks-backend
  • Run mvn clean install

How to Run: 🔥

  • Go to API directory cd /starbucks-backend/api
  • Run mvn jetty:run

How to Test: 🔧

  • Go to parent project directory cd /starbucks-backend
  • Run mvn clean test

Database Setup: ✅

  • Install MySql on your local
  • Create a database with name starbucks
  • Go to the directory starbucks-backend/common/src/main/resources
  • Change the following parameters in the config.json file
    • "username": "Your Username Here"
    • "access": "Your Password Here"

Docker Setup: ☁️

  • Run following commands to do a docker setup

    • docker-compose up -d
    • Database Setup (Use Separate terminal) 🔥
      • docker cp ./initDB.sql mysql-server:/
      • docker exec -it mysql-server /bin/bash
      • mysql < initDB.sql
    • API Setup (Use Separate terminal) 🔨
      • docker exec -it starbucks-backend /bin/bash
      • mvn clean install
      • cd api && mvn jetty:run
  • Run following commands to do a docker tear down

    • docker compose down
  • For a fresh start

    • docker compose stop
    • docker system prune

List of available API:

SwaggerApiList.png

Database Schema:

DBSchemas.png

How to generate Swagger documentation: