Getting Started
This quickstart helps you sign up, obtain a token, and call protected APIs.
Prerequisites
- Docker Compose stack running (
fastapi,nginx,docs) - Base URLs:
- API gateway (nginx):
http://localhost:${NGINX_HTTP_PORT:-85} - Docs:
http://localhost:${DOCS_PORT:-3001}
- API gateway (nginx):
Step 1 — Register a user
- Endpoint:
POST /auth/register - Example (curl):
curl -X POST "http://localhost:85/auth/register" \
-H "content-type: application/json" \
-d '{"email":"[email protected]","name":"Ada","password":"P@ssw0rd!Strong"}'
Step 2 — Login to get tokens
- Endpoint:
POST /auth/login - Example:
curl -X POST "http://localhost:85/auth/login" \
-H "content-type: application/json" \
-d '{"email":"[email protected]","password":"P@ssw0rd!Strong"}'
- Sample response:
{"access_token":"<ACCESS>","refresh_token":"<REFRESH>"}
Step 3 — Use the access token
- Add header:
Authorization: Bearer <ACCESS> - Example protected call (favorites list):
curl -X GET "http://localhost:85/v1/favorites/list" \
-H "authorization: Bearer <ACCESS>"
Step 4 — Explore interactively (Swagger)
- Open API Explorer in the docs sidebar or visit:
http://localhost:85/docs - In the top-right, click Authorize, paste the access token (without the
Bearerprefix) - Try any endpoint directly from Swagger UI
Common tips
- Refresh token:
POST /auth/login/refreshwith{ "refresh_token": "<REFRESH>" } - All protected endpoints require the Bearer token
- Satellite endpoints live under
/v1, news under/v1/news, favorites under/v1/favorites