0
Challenge · 14Data & Reads

Postgres + Prisma setup

Dataused in ~90% of apps

Your job board needs a real database the moment you stop hard-coding the jobs array. This is the concept where HireFlow grows a spine. Get the Prisma workflow wrong and you'll either ship a client with no types, exhaust your Postgres connections after ten hot-reloads, or wonder why your schema changes never reached the database.

Core idea. Prisma turns a single declarative `schema.prisma` file into a migration (the SQL that shapes Postgres) and a fully typed client (the API your code calls). The mental order is fixed: edit schema → `migrate` (write the SQL + apply it) → `generate` (rebuild the typed client) → import a singleton client. In dev you must reuse one PrismaClient across hot reloads or you'll open a new connection pool every time a file changes.
Playground, this isn't a screenshot
CRUD ↔ HTTP verb
POSTCreateGETReadPATCHUpdateDELETEDelete
local list (React state)2 items
#1Ship the feed
#2Review PRs
network — request / response
Add, edit, or delete an item. Watch the HTTP verb fire, then the local list update after the response.

Each mutation waits for the server's response, then updates the local list immutably (map / filter / spread) — no full refetch. Showing the change before the response is optimistic UI (#71).

↑ play a little first, then dig in