Hello World — First API Call¶
This guide walks you through making your first call to the Coaching App backend API.
Prerequisites¶
- Docker running with
docker compose -f docker-compose.yml -f docker-compose.dev.yml up - Database seeded:
cd backend && pnpm db:migrate && pnpm db:seed
Service URLs¶
| Service | URL | Description |
|---|---|---|
| Backend API | http://localhost:3001 | Hono REST API |
| Mailpit | http://localhost:8025 | Catch all dev emails |
| MinIO Console | http://localhost:9001 | Object storage UI |
| Drizzle Studio | http://localhost:4983 | Visual database browser |
1. Health Check¶
2. Sign In¶
curl -X POST http://localhost:3001/api/auth/sign-in/email \
-H "Content-Type: application/json" \
-c /tmp/cookies.txt \
-d '{"email":"platformadmin@coaching.test","password":"PlatformAdmin1234!"}'
Response:
{
"user": { "id": "...", "email": "platformadmin@coaching.test", "name": "Platform Admin" },
"session": { ... }
}
3. Get Your Profile¶
Response:
{
"id": "...",
"email": "platformadmin@coaching.test",
"name": "Platform Admin",
"profile": { "role": "platform_admin", "organizationId": null }
}
4. List Organizations (Platform Admin only)¶
Response:
5. Sign Out¶
Troubleshooting¶
Connection refused:
401 Unauthorized:
- Make sure you're passing the cookie jar (
-b /tmp/cookies.txt) - Re-run the sign-in step to get a fresh session
403 Forbidden:
- The endpoint requires a role the signed-in user doesn't have
- Try signing in with a
platform_adminaccount
Next Steps¶
- Explore the full API Reference
- Read about Permissions and Roles
- Set up the Frontend