Building an app
Every asasvirtuais app is built in the same order. Rules coded at the start would change every time something simple changes in the front-end, so the advanced parts come last.
- Data modeling, by feature. Each feature's tables become packages:
packages/{model}/schema.ts, the schemas in Zod. What the relational database already answers is not a column. - Layout. Routes, layouts and page skeletons, each page providing the tables it shows with the rows it fetched.
- Pages, forms and server actions. Each page gets its forms (
CreateForm,UpdateForm,FilterForm), its pagination, and the server actions it needs. - Middleware and authorization. Authentication, authorization, and each table's middleware, once the features are defined.
- Workflows and custom features. What needs a hand-written state management or a state machine. See Workflows.
A team working by hand runs the same order as a four-week sprint, presenting at the end of each week: planning and setup, then stages 1 and 2, then stage 3, then stages 4 and 5. A coding agent develops much faster, but it follows the same order.
Recommended project files#
Building with a coding agent works best when the project keeps its context in a few Markdown files:
| File | What it holds |
|---|---|
brief.md | what the client asked for |
specs.md | how it's built, technically, kept up to date as things change |
plan.md | the initial plan for the project |
changelog.md | what has been developed so far |
roadmap.md | ideas for the future of the project |
README.md | written at the end: what was done, how, and how to start using it |
AGENTS.md | the framework rules, copied from AGENTS.example.md (explained in The rules) |
Naming conventions#
| Concept | Pattern | Example |
|---|---|---|
| Table | lowercase plural | 'todos' |
| Fields | {Field}Field | TitleField |
| Hooks | use{Model}s(), use{Model}() | useTodos(), useTodo() |
| Providers | {Model}sProvider (table), {Model}Provider (row) | TodosProvider, TodoProvider |
| Forms | Create{Model}, Update{Model}, Filter{Model}s, Delete{Model} | UpdateTodo |
| One-click update | {Verb}{Model} | ToggleTodo |
| Components | {Model}Item, Single{Model} | TodoItem |
Rather not build it yourself?#
Fast Track BTA builds custom business tools and apps on asasvirtuais, following exactly this process, and delivers in 1 to 5 business days. See Hire us.