Run It Locally
Table of Contents
Why Docker
The stack has four moving parts: a Java API, a Node web app, Postgres and a SoapUI mock. Installing those by hand is an afternoon. Docker Compose builds and starts all four from one file, so the only thing you need on your machine is Docker Desktop.
How: start the stack
- Install Docker Desktop and open it once so the engine is running.
- Clone the playground repository and enter it:
git clone https://github.com/syamilu/pizza-playground.git
cd pizza-playground
- Copy the settings file and start everything:
cp .env.example .env
docker compose up --build
- Wait. The first run downloads Postgres, builds the API with Maven, builds the web app and downloads SoapUI. Expect several minutes and a lot of log output. It is ready when the log shows
web-1 Started.
Later runs skip the builds and come up in under a minute.
How: check it is up
| What | URL |
|---|---|
| Shop | http://localhost:3000 |
| Admin login | http://localhost:3000/admin/login |
| API and Swagger UI | http://localhost:8080/swagger-ui.html |
| Mock payment gateway | http://localhost:8090 |
| Postgres | localhost:5432, user and password playground |
Quick proof from a terminal:
curl -s localhost:8080/actuator/health
# {"status":"UP"}
Then place an order in the browser: menu, Customize a pizza, Add to cart, Checkout, Place order. You land on the mock gateway's pay page. Click Pay and you are back on the confirmation page, which flips to PAID within a second.
How: stop and reset
docker compose down # stop, keep the database
docker compose down -v # stop and wipe the database
You rarely need -v. The API has a reset endpoint that clears orders in under a second without restarting anything; see Testing Against It.
Tips
- Ports in use. If 3000, 8080, 8090 or 5432 is taken, change the left side of the
ports:mapping indocker-compose.ymland the matching URL in.env. - The mock forgets bills on restart. Unpaid bills live in the mock's memory. If you restart only the
mock-gatewaycontainer, orders that were mid-payment stay PENDING. Reset them. - Browsers with many cookies. Everything on
localhostshares cookies across ports. The mock's Jetty server is old and used to reject large cookie headers with HTTP 413; the shipped version raises the buffer, so if you see a 413 you are on an old build. - Windows. Use PowerShell or Git Bash for the
cpline, or copy.env.exampleto.envin Explorer. Everything else is the same.