A small REST API for managing movies, built in Go to actually understand how token auth, background jobs, and PostgreSQL work under the hood — not just how to call a library that does it for you.
Not JWT — something simpler, and easier to revoke. The server never stores a token it could hand back to an attacker.
Authorization: Bearer <token>. The server hashes it again and looks for a match — same principle as a password check. Delete the row, and the token is dead instantly. No expiry logic, no denylist needed.
Add, view, update, and delete movie records through a clean JSON API.
Register a user, activate the account with a token sent by email, then log in.
Requests are throttled per client, so the API can't be spammed into the ground.
Activation emails send in the background, so they never hold up the response.
Random tokens, hashed at rest — revoke access instantly by deleting a row.
Consistent, predictable response shapes across every endpoint.
Needs Go 1.20+ and a PostgreSQL instance you can connect to, local or remote.
Make sure PostgreSQL is running and you have a database ready. The schema lives in the migrations folder — copy it over and it's easy to follow.
The API is now running locally, ready to take requests.
Still a work in progress — adding to it as I learn more.