A Docker-based exercise logging stack with Angular frontend, FastAPI backend, PostgreSQL, and Caddy reverse proxy.
- Docker
- Docker Compose
- Python 3.12+ and project virtualenv at
.venv(for host-based backend work) - Node.js 22+ (for local frontend development without Docker)
-
Install frontend dependencies:
cd frontend npm install -
Install backend dependencies (host mode):
source .venv/bin/activate pip install -r backend/requirements.txt -
Optional: override compose defaults via environment variables:
POSTGRES_USER/POSTGRES_PASSWORD/POSTGRES_DBAUTO_SEED(true/false)
# Terminal 1: backend
source .venv/bin/activate
cd backend
alembic -c alembic.ini upgrade head
python seed.py
uvicorn app.main:app --reload
# Terminal 2: frontend
cd frontend
npm start
# Access at http://localhost:4200# Local stack (recommended for day-to-day)
docker compose -f docker-compose.local.yml up -d --build
# Production-like stack
docker compose up -d --buildAccess at:
http://localhost:8003
/-> Angular app/api/*-> FastAPI API
docker compose -f docker-compose.local.yml up -dThis starts:
- Frontend container
- Backend container (
uvicorn --reload) - PostgreSQL
- Caddy (on port
8003)
docker compose up -dUse scripts/deploy-prod.sh for the full deploy flow (pull latest main, run tests, back up DB, rebuild/restart stack).
# Start local stack
docker compose -f docker-compose.local.yml up -d
# View logs
docker compose -f docker-compose.local.yml logs -f
# Stop local stack
docker compose -f docker-compose.local.yml down
# Rebuild all services
docker compose -f docker-compose.local.yml up -d --build
# Rebuild backend only
docker compose -f docker-compose.local.yml up -d --build backend
# Rebuild frontend only
docker compose -f docker-compose.local.yml up -d --build frontendAlembic config is in backend/alembic.ini and revisions are in backend/alembic/versions/.
# Preferred in local Docker mode
make migrate
# Or directly in the container
docker compose -f docker-compose.local.yml exec backend alembic -c alembic.ini upgrade head
# Host-based option
source .venv/bin/activate
cd backend
alembic -c alembic.ini upgrade head
# Create a new migration
alembic -c alembic.ini revision --autogenerate -m "describe change"Preferred unified entrypoint:
make test SERVICE=all BACKEND_MODE=host FRONTEND_MODE=localMode options:
SERVICE=backend|frontend|allBACKEND_MODE=host|containerFRONTEND_MODE=local|cached
source .venv/bin/activate
cd backend
pytest
# equivalent unified command
make test SERVICE=backend BACKEND_MODE=hostRun a single backend file:
cd backend
pytest tests/test_api.pycd frontend
npm test
# dockerized cached dependency mode
make test SERVICE=frontend FRONTEND_MODE=cachedWatch mode:
cd frontend
npm run test:watchRun a single frontend spec file:
cd frontend
npm test -- src/app/shared/value-format.spec.tsl-sit(duration_seconds)pullups(reps)weighted-pullups(reps_plus_weight_lbs)mace-swings(reps)
See SHORTCUTS.md for the NFC/iPhone automation payloads and workflow details.
make up
make logs
make down
make rebuild
make rebuild-backend
make rebuild-frontend
make migrate
make seed
make test
make test SERVICE=backend BACKEND_MODE=container
make test SERVICE=frontend FRONTEND_MODE=cached
make prune-test-cache
make deploy