With Thanks is a small full-stack app built on TanStack Start, where backend capabilities are expressed as type-safe server functions instead of a separate API service.
I chose TanStack (Start + Router) for strong end-to-end type-safety at the routing boundary and its ergonomics for layering in middleware-style enforcement over time (planned). Zod fits cleanly into this: routes can validate and type search params, and server functions validate incoming payloads at the request boundary before any business logic runs.
At a high level, routes render UI and delegate data loading and mutations to hooks (TanStack Query + useServerFn). Those hooks call server functions (createServerFn), which validate inputs and enforce authorisation before executing database reads/writes.
The client never talks to the database directly. All database reads and writes run server-side through Drizzle against Neon Postgres using server environment credentials. Client tokens are used strictly for request authorisation, not for database access.
A key product-specific detail is that the app supports two access modes (session dashboard vs share-link collaboration), but the architecture remains consistent: both modes still flow through the same server-function boundary.
Route layer: file-based routes compose UI and local state.
Hook layer: TanStack Query caching/invalidation + useServerFn calls.
Server boundary: server functions validate inputs and authorise capabilities.
Data layer: Drizzle queries against Neon Postgres (server-side env creds).