Kavex Intelligence · Developer discipline
Frontend & Backend
Interfaces people trust and backends that enforce the rules.
Architecture
Validation happens on the server; the interface only helps people get it right the first time.
Server-rendered pages keep first load fast; interactive parts hydrate where they are needed.
Implementation flow
- Contract
Agree request and response shapes.
- Validate
Schema checks at the boundary.
- Render
Accessible, responsive UI.
- Observe
Errors and timings reported.
Trade-offs
Client vs server state
Keep the source of truth on the server and cache it on the client with explicit invalidation.
Optimistic updates
Feel instant, but need a clear rollback path when the server disagrees.
Validate at the boundary
Illustrative code · ts
const Input = z.object({ sku: z.string().min(1), qty: z.number().int().positive() });
export const addLine = createServerFn({ method: "POST" })
.validator((d) => Input.parse(d))
.handler(async ({ data }) => saveLine(data));