This guide describes the exact way this project is started and torn down in this repository.
The repo uses setup.sh as the startup script and teardown.sh as the shutdown script. If you were expecting a file named startup.sh, use setup.sh instead.
After unzipping or cloning the repo, you should have this structure at the top level:
developer-psd/
setup.sh
teardown.sh
docker-compose.yml
db/
schema.sql
expense-splitter/
expense-splitter.standalone/
documents/
postman/
All commands below assume you are inside the project root:
cd developer-psdThe repository startup flow is script-driven. Running setup.sh does all of the following:
- Starts PostgreSQL through Docker Compose.
- Waits for the database health check to pass.
- Applies
db/schema.sql. - Unit Tests and Builds the standalone module.
- Unit Tests and Builds the Spring Boot webservice module.
- Builds the webservice Docker image.
- Starts the application container on port
8080.
So you do not need to manually create the database, manually run the schema, or manually build the JARs if you are using this script.
Install these first:
- Docker Desktop (or Docker Engine + Docker Compose support)
- Git or a way to copy the project onto the machine
- Node.js and npm (needed only for the automated Newman/Postman verification flow)
- Postman Desktop App (needed only if you want to import and inspect the collection visually)
Before running the project scripts, make sure the Docker daemon is running.
On Docker Desktop, open Docker Desktop and wait until Docker shows as running.
From the project root:
cd developer-psd
chmod +x setup.sh teardown.sh
./setup.shExpected result:
- PostgreSQL container starts
- schema is applied
- Maven build runs in Docker
- application image is built
- application container starts
- API becomes available on:
http://localhost:8080
Run:
docker psYou should see containers similar to:
expense_splitter_databaseexpense_splitter_container
You can quickly verify the application is reachable:
curl http://localhost:8080/trip/allIf the app is running properly, you should get an HTTP response from the service.
The automated API verification must be run from:
/developer-psd/documents/postman
So do this exactly:
cd developer-psd/documents/postman
npm install
BASE_URL=http://localhost:8080 bash run-newman.shWhat this does:
- uses the Postman collection inside
documents/postman/Postman/ - creates a runtime environment
- runs the end-to-end API flow against your local backend
- produces reports in:
documents/postman/reports/
After a successful run, inspect:
documents/postman/reports/junit/results.xml
documents/postman/reports/html/report.html
This step is for users who want to browse the API flow and request documentation visually inside Postman.
Open Postman Desktop and do the following:
- Click Import.
- Import this collection file:
developer-psd/documents/postman/Postman/Expense Splitter - Automated E2E.postman_collection.json - Import this environment file:
developer-psd/documents/postman/Postman/Expense Splitter - Local.postman_environment.json - In Postman, select the imported environment.
- Confirm
baseUrlis set to:http://localhost:8080 - Open the collection and review the folders and requests.
Once imported into Postman:
- Select the Expense Splitter - Local environment.
- Open the collection.
- Start from the top of the collection.
- Click Run collection.
- Execute the collection against
http://localhost:8080.
This lets you:
- see the request sequence
- inspect request/response payloads
- understand variable propagation
- use the collection as API documentation and verification
Inside Postman, the collection acts as executable documentation:
- each folder represents a functional flow
- each request shows the actual endpoint, method, body, and expected response shape
- the Docs section shows the request payloads and response payloads and their descriptions
- the request ordering shows how the system is expected to be used end to end
- the embedded tests show what the application considers a successful response
For this project, the most useful way to understand the API is:
- read the request name
- inspect the request body
- send the request
- inspect the response
- look at the test tab / collection flow to see what is asserted next
Here is the minimal exact flow to get productive fast:
cd developer-psd
./setup.sh
cd docs/postman
npm install
BASE_URL=http://localhost:8080 bash run-newman.shIf that succeeds, the application is up and the API suite has verified the main flows.
From the project root:
cd developer-psd
./teardown.shThis brings down the Docker Compose stack defined in docker-compose.yml.
Install Docker first.
Make sure Docker daemon / Docker Desktop is running before invoking ./setup.sh.
Run:
chmod +x setup.sh teardown.sh
chmod +x docs/postman/run-newman.shInstall Node.js and npm, then rerun:
cd developer-psd/docs/postman
npm install
BASE_URL=http://localhost:8080 bash run-newman.shCheck:
docker ps- app is listening on
http://localhost:8080 - you ran Newman from
developer-psd/docs/postman BASE_URLis set tohttp://localhost:8080
Use:
cd developer-psd
./teardown.sh
./setup.sh
cd docs/postman
BASE_URL=http://localhost:8080 bash run-newman.sh./setup.sh= bring up everythingBASE_URL=http://localhost:8080 bash run-newman.shfrom/docs/postman= verify everything./teardown.sh= bring it all down