Your first request
docker compose up, run the API, hit /api/health.
Time to bring the API up. Four commands. By the end you'll have a live JSON response in your terminal.
1. Start Postgres + friends
$cd bench-api$docker compose up -d
Brings up Postgres, Redis, MinIO, and Mailhog in the background. The -d means "detached"; check status with docker compose ps.
2. Run the API from the project root
Important: run from project root, not from inside apps/api/cmd/server/. The config loader looks for ./.env relative to your working directory, and .env lives at project root.
# from bench-api/$cd apps/api && go run ./cmd/server
Wait â that's also a non-root cwd. The trick: run from apps/api/ (because that's where go.mod lives), and the loader will find the project-root .env via the ../../.env path it tries.
cd apps/api/cmd/server first â from there, the loader can't find .env and the API exits with DATABASE_URL is required. This is the gotcha most new users hit. Always run from apps/api/.3. Watch the startup log
2026/06/01 09:00:00 Database connected successfully2026/06/01 09:00:00 Redis cache connected2026/06/01 09:00:00 File storage connected2026/06/01 09:00:00 Job queue connected2026/06/01 09:00:00 [sentinel] Mounted at /sentinel2026/06/01 09:00:00 Pulse observability mounted at /pulse2026/06/01 09:00:00 [GIN-debug] Listening and serving HTTP on :8080
Every battery wired in five lines. If any of these say "failed", scroll up â the error message tells you exactly what's missing (usually a env value or Docker service that didn't come up).
4. Hit /api/health
$curl http://localhost:8080/api/health
You should see:
{ "status": "ok", "version": "0.1.0" }
That's success. The API connected to every service it needs and is ready to handle requests.
The other URLs you can poke
http://localhost:8080/docsâ auto-generated OpenAPI documentationhttp://localhost:8080/studioâ GORM Studio (DB browser)http://localhost:8080/sentinel/uiâ Sentinel WAF dashboardhttp://localhost:8080/pulse/uiâ Pulse observabilityhttp://localhost:8025â Mailhog (captures all dev email)
Quick check
Try it
Get the API running end-to-end. From your scaffolded project:
docker compose up -dcd apps/api && go run ./cmd/server- In another terminal:
curl http://localhost:8080/api/health
Paste the curl response in notes.md. That completes chapter 1's assignment â the criteria are in the sidebar.
What's next
Chapter 2 â Modeling with GORM. You'll define your first model, see how AutoMigrate handles tables, and learn the GORM tags Grit assumes.
Spot a typo? Have an idea?
Help us improve this lesson. One click opens a GitHub issue with the lesson URL pre-filled â suggest clearer wording, report a bug, or request more depth. The course keeps improving thanks to learners like you.
Suggest an improvement on GitHub