Commons
A social platform on one shared, newest-first timeline. Posts, likes, comments, follows.
- Idempotent by schema
- Likes and follows upsert against composite unique constraints, so a double-tap cannot create a duplicate row. The button rolls its optimistic update back if the request fails.
- One query per feed
- Per-viewer likedByMe resolves inside the same findMany through a filtered relation include, against an explicit descending index on createdAt — no second round trip.
- Redeploys keep your posts
- A build-time provisioning script pushes the schema and seeds only when the users table is empty, so anything visitors wrote survives the next deploy.