A small Twitter-like HTTP API written in Go. Users can sign up, log in, post chirps, and read them. Built as a learning project for backend fundamentals: routing, JWT auth, refresh tokens, and webhooks.
- Go with
chifor routing - JSON file (
database.json) for storage - JWT access tokens + refresh tokens
- Polka webhook integration for paid-user upgrades
go run .Server listens on :8080. Use -debug to wipe the database on startup.
Required env vars (in .env):
JWT_SECRETPOLKA_API_KEY
GET /api/healthzGET /api/chirps— supports?author_id=and?sort=GET /api/chirps/{id}POST /api/chirpsDELETE /api/chirps/{id}POST /api/users,PUT /api/usersPOST /api/login,/api/refresh,/api/revokePOST /api/polka/webhooksGET /admin/metrics