← The stack
STACK GUIDE · TYPESCRIPT
The web app
Everything people see and click is one Next.js app in TypeScript: the pages, the API, the admin area and the reports.
Build with
- Next.js App Router, TypeScript in strict mode
- Tailwind CSS and shadcn/ui so screens look finished on the first day
- React Hook Form with Zod for forms and validation, the same Zod schemas shared with workers and the phone app
- TanStack Table for work queues, Recharts for dashboards
- Server actions and route handlers for the API, so there is no second server
Organise it
- apps/web/app for pages, one folder per module
- apps/web/lib for business rules, each with a Vitest test
- rules.yaml for rules that came from research, each with its source link
- packages/shared for types and the API client
Avoid
- Pages that only work with demo data hard coded
- A separate Express or Flask API server
- Copying screens from a template without changing them to the real workflow
LEARN HOW IT WORKS
Four ideas to understand.
You direct the agent, so you need these in your head. Ask the agent to teach them with your own code.
- 1Request and response. What happens between a click and a page: the browser asks, the server answers.
- 2Server and client components. Which code runs on the server and which in the browser, and why it matters for speed and secrets.
- 3Forms and validation. Why the same rule is checked in the browser and again on the server.
- 4State. Where the data on a screen lives and how it changes.
Explain how the web app works in our product, in plain words, for someone who will direct the code but not type it. Use our own repo as the example. Cover: request and response, server and client components, forms and validation, state. Then ask me three questions to check I understood.
ASK YOUR AGENT TO BUILD IT
A brief to start from.
Fill in the brackets with your product and paste it into your agent.
In apps/web, add the [module] module to our Next.js app: a work queue page with filters, a detail page, and an approve action that writes to the audit log. Use shadcn/ui, TanStack Table, React Hook Form and Zod schemas from packages/shared. Server actions only, no extra server. Write Vitest tests for the rules and one Playwright test for the main path. Explain the plan first.