-
Notifications
You must be signed in to change notification settings - Fork 1
Setup.md
Follow this guide to prepare a development workstation, compile the codebase, and run the Banking System locally.
- Java Development Kit 17 (Temurin or compatible distribution)
- Git for cloning the repository
- Optional: Docker (for container-based workflows), MySQL client utilities (for JDBC deployments)
Windows users can reference the detailed setup checklist for IDE tooling, PATH configuration, and helper scripts.
git clone https://github.com/alphaZytx/Banking-System.git
cd Banking-SystemThe project uses vanilla javac compilation to keep the toolchain lightweight.
mkdir -p build/classes
find src -name '*.java' > sources.txt
javac -d build/classes @sources.txtThe resulting classes support both the console and API applications.
java -cp build/classes banking.BankingApplicationThe console guides you through creating accounts, performing transactions, and reviewing history. Exit gracefully through the provided menu option to flush persistence state.
java -cp build/classes banking.api.ApiApplicationOnce the server is running, obtain an operator token and interact with the endpoints:
TOKEN=$(curl -s -X POST "http://localhost:8080/auth/login" -d "username=admin&password=admin123!" | jq -r .token)
curl -H "Authorization: Bearer $TOKEN" "http://localhost:8080/accounts"Consult the Operations & Runbooks page for additional API workflows and post-start validation steps.
Key environment variables:
-
BANKING_STORAGE_MODE:snapshot(default) orjdbc -
BANKING_DATA_PATH: File path for snapshot persistence when using the in-memory repository -
BANKING_JDBC_URL: JDBC connection string (required for JDBC mode) -
BANKING_DB_USER/BANKING_DB_PASSWORD: Database credentials -
CACHE_PROVIDER:memory(default) ornone -
CACHE_TTL_SECONDS,CACHE_ACCOUNT_TTL_SECONDS,CACHE_BALANCE_TTL_SECONDS: Cache expiration tuning
Example JDBC configuration:
export BANKING_STORAGE_MODE=jdbc
export BANKING_JDBC_URL="jdbc:mysql://localhost:3306/banking?useSSL=true&serverTimezone=UTC"
export BANKING_DB_USER="bank_user"
export BANKING_DB_PASSWORD="ChangeMe123!"Run the built-in migration script before launching the API in JDBC mode:
bash deploy/scripts/run-migrations.shThe script skips JDBC migrations automatically when BANKING_JDBC_URL is unset.
The repository includes Dockerfiles for the console and API applications and a Docker Compose configuration for local orchestration:
docker compose -f deploy/compose/docker-compose.yml up --buildThis command provisions MySQL, builds the application images, and starts the services with compatible environment variables. Tear down with docker compose ... down when finished.