Makefile Command Reference
Run make help to see all targets with descriptions.
Development
make up # Start all local services (docker-compose up -d)
make down # Stop all services
make build # Rebuild Docker images
make restart # Restart backend container (after code changes)
make logs # Tail all service logs
make logs-backend # Tail backend logs only
make logs-nginx # Tail nginx logs only
make shell # Open bash inside backend container
make ps # Show container status
Database / Migrations
make migrate-up # Apply all pending Alembic migrations
make migrate-down # Revert last migration
make migrate-new msg="add_feature" # Create new migration file
make migrate-current # Show current migration version
make migrate-history # Show full migration history
make db-seed # Run init_db.py (seed admin + sample data)
make db-shell # Open psql prompt in the local postgres container
make db-reset # Drop + recreate schema (WARNING: destroys data)
Testing
make test # Run pytest inside backend container
make test-v # Verbose pytest output
make test-cov # Run with coverage report
make test-file f=tests/test_auth.py # Run a specific test file
Smoke Tests
make smoke-test # Run smoke-test.sh against production (mvp-api.zafarsaidov.uz)
make smoke-test-local # Run smoke-test.sh against localhost:8000
# Override credentials:
make smoke-test ADMIN_PASSWORD=mysecret
The smoke test script (scripts/smoke-test.sh) runs 32 checks covering health, auth, lessons, exams, labs, dashboard, profile, and admin endpoints. It exits with code 1 on any failure.
Production
make deploy # Full deploy: pull → build → migrate → smoke test
make prod-logs # Tail all production logs
make prod-logs-backend # Tail production backend logs
make prod-shell # Open bash in production backend container
make prod-migrate # Run alembic upgrade head on production
make prod-ps # Show production container status
LXD
make lxd-list # Run "lxc list" on 65.109.236.163
make lxd-check # Test LXD connection from backend container
make lxd-images # List available LXD images