This repository provides a sample backend code for creating a ☕ ordering REST application like Starbucks.
- Java-8
- mysql 5.7 & above
- IntelliJ IDE (Optional)
- Go to the parent project directory
cd starbucks-backend
- Run
mvn clean install
- Go to API directory
cd /starbucks-backend/api
- Run
mvn jetty:run
- Go to parent project directory
cd /starbucks-backend
- Run
mvn clean test
- 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"
-
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
- Run the project
- Install the chrome plugin : https://bit.ly/2wIiKOw
- Go to the url : http://localhost:8080/api/swagger.json
- Click on the plugin icon in the browser