Two primary approaches for local development:
- Colima + docker-compose - Containerized (recommended for consistency)
- Makefile - Native execution on Mac (recommended for speed)
Lightweight container runtime for Mac. Works exactly like Docker but without the overhead.
brew install colima# Start Colima (one-time per session)
colima start
# Then use docker-compose as usual
docker-compose up
# Stop when done
colima stopThe existing docker-compose.yml works unchanged. All docker and docker-compose commands work normally.
- ✅ Drop-in Docker replacement (same CLI)
- ✅ Lightweight and fast
- ✅ Free and open-source
- ✅ Works with your existing docker-compose.yml
- ✅ Better resource usage than Docker Desktop on Mac
Once running:
- Swagger UI: http://localhost:8080/
- Health Check: http://localhost:8080/api/health
- API: http://localhost:8080/api/*
Already installed on every Mac. No additional tools needed.
# Show all available commands
make
# One-time setup
make setup
# Start API
make api
# Start API with hot-reload
make api-dev
# View database location and status
make db-info
# Reset database
make db-reset
# Open SQLite shell
make db-shell
# Start full stack (API + UI)
make full-dev
# Start UI dev server (separate terminal)
make ui
# Build UI for production
make ui-build- ✅ Already on your Mac (no installation)
- ✅ Simple and straightforward
- ✅ All tasks in one place
- ✅ Fast, lightweight, native execution
First time:
make setup # Create cache directory, download dependencies
make api # Start API serverEvery other time:
make apiThen visit: http://localhost:8080/
First time:
colima start # Start container runtime (one-time per session)
docker-compose up # Start API and databaseEvery other time:
colima start # Resume container runtime
docker-compose up # Resume servicesThen visit: http://localhost:8080/
Native (Makefile):
make full-dev # Runs API (8080) and UI (5173) together
# Visit http://localhost:5173Containerized (Colima):
colima start
docker-compose up # API on 8080
# In another terminal:
cd ui && npm run dev # UI on 5173| Goal | Makefile (Native) | Colima (Container) |
|---|---|---|
| Start services | make api |
docker-compose up |
| Hot-reload | make api-dev |
N/A (rebuild container) |
| Build binary | make api-build |
docker build api |
| Run tests | make api-test |
docker-compose exec api go test ./... |
| Reset DB | make db-reset |
docker-compose down -v |
| DB shell | make db-shell |
docker-compose exec api sqlite3 ... |
| DB info | make db-info |
docker-compose logs api |
| Full stack | make full-dev |
docker-compose up + cd ui && npm run dev |
Makefile supports hot-reload via air, which auto-rebuilds when you change code:
make api-dev # Auto-installs air if needed, then runs with hot-reloadRequires: go install github.com/cosmtrek/air@latest (installed automatically by make api-dev)
- Location:
~/.cache/sochoa.dev/api.db(Makefile/native) - Type: SQLite 3
- Auto-created: Migrations run automatically on first API start
- Reset: Run
make db-resetor delete the file directly
make db-shell # Open SQLite shell
make db-info # Show database status and table countOr directly:
sqlite3 ~/.cache/sochoa.dev/api.dbDatabase is inside the container volume. Access it via:
docker-compose exec api sqlite3 /home/api/.cache/sochoa.dev/api.dbOnce running at http://localhost:8080:
- Swagger UI: http://localhost:8080/
- Health Check: http://localhost:8080/api/health
- API: http://localhost:8080/api/*
Automatically set by task/make:
DEV_MODE=true- Skip CognitoDEV_USER_ROLE=admin- Full API accessLOG_LEVEL=debug- Verbose logging
Override in your shell:
LOG_LEVEL=info task apiUse Makefile (Native) if you want:
- ✅ Fastest iteration (no container startup overhead)
- ✅ Zero additional installation (already on Mac)
- ✅ Direct IDE integration and debugging
- ✅ File changes instantly reflected
- Recommended for daily development
Use Colima (Containers) if you want:
- ✅ Production-like environment (containers match deployment)
- ✅ Full isolation from system dependencies
- ✅ docker-compose workflow you're familiar with
- ✅ Consistent behavior across machines
- Recommended for testing before deployment
Both are equally valid. Pick what works for your workflow!
make full-devThis starts:
- API on http://localhost:8080 (Swagger UI at /)
- UI dev server on http://localhost:5173 (or next available port)
- Both running natively, sharing the local database
Visit http://localhost:5173 to access the UI and make API requests.
Terminal 1:
colima start
docker-compose upTerminal 2:
cd ui && npm run devThis starts:
- API on http://localhost:8080 (in container)
- UI dev server on http://localhost:5173 (native)
Check database file isn't corrupted:
make db-reset
make apiAir not installed. Install it:
go install github.com/cosmtrek/air@latestStart API on custom port:
cd api && go build -o api ./ && DEV_MODE=true DEV_USER_ROLE=admin LOG_LEVEL=debug ./api --port 3000Update docker-compose.yml ports section:
ports:
- "3000:8080" # Map 3000 to container's 8080Check virtualization support on your Mac:
colima start --vm-type vz # Recommended for M1/M2/M3 Macs (vfkit)
# or for Intel:
colima start --vm-type qemuIncrease or decrease resource limits:
colima stop
colima start --cpu 4 --memory 8 --disk 60 # Adjust based on your Maccolima stop
colima delete # Deletes VM and all containers
colima start
docker-compose up --build # Rebuild imagesIf services can't communicate:
colima ssh # SSH into the VM
docker ps # Check running containers
docker logs <name> # Check container logs
exit # Exit SSH