Tutorial 2: Create Your First CRUD
BasicIn this tutorial, one prompt lets AI turn the new module into its first real business thread by generating a student CRUD workflow.
Goal
By the end of this tutorial, you will understand:
- why Cabloy prefers CRUD generation over hand-written boilerplate
- what the generated backend thread usually includes
- how the generated entity and DTO surface becomes the contract foundation for later tutorials
- why this step does not generate any frontend code, but already gives you a complete CRUD admin page through Cabloy’s existing schema-driven surface
AI Prompt
Give AI a prompt like this:
Please generate the first CRUD flow for the Student resource.Why this step matters
Once the module exists, this is the next useful step because the prompt can drive the CRUD generator instead of hand-building controller, service, model, entity, DTO, metadata, locale, and tests one by one.
That keeps the conversation focused on the generated business thread rather than on repetitive scaffolding details.
NOTE
This tutorial continues the standalone demo-student sandbox from Tutorial 1. That sandbox is intentional: it lets you run the full tutorial flow without colliding with the repo's real suite-owned a-training/training-student implementation.
CLI commands to inspect/use
Inspect the CRUD family first:
npm run vona :tools
npm run vona :tools:crud --help
npm run vona :tools:crudBasic --helpGenerate the student CRUD thread:
npm run vona :tools:crud student -- --module=demo-studentEquivalent Basic-specific entrypoint:
npm run vona :tools:crudBasic student -- --module=demo-studentUsage notes:
:tools:crudis the public entrypoint beginners should prefer:tools:crudBasicis useful when you want to inspect the Basic-specific underlying path directly- after generation, verify the result from the admin UI instead of stopping at file inspection
Generated or affected files
After generation, inspect the resulting backend thread before refining anything.
By the end of this tutorial, your demo-student backend thread should have a representative shape under vona/src/module/demo-student/src/:
controller/student.tsservice/student.tsmodel/student.tsentity/student.tsxdto/studentCreate.tsxdto/studentUpdate.tsxdto/studentView.tsxdto/studentSelectReq.tsxdto/studentSelectRes.tsxdto/studentSelectResItem.tsxbean/meta.version.ts
There is also a test anchor at:
vona/src/module/demo-student/test/student.test.ts
What those files mean in the business thread
As you inspect the generated files, pay attention to the division of responsibility:
controller/student.tsexposes the HTTP contractservice/student.tsowns orchestrationmodel/student.tsowns persistence behaviorentity/student.tsxdefines the field-oriented contract surface- the DTO files define operation-specific request and response contracts
bean/meta.version.tsanchors the module schema/version threadtest/student.test.tsgives you a verification anchor for the generated backend flow
This is the backend contract thread that later tutorials will extend with level, mobile, render metadata, OpenAPI output, and row actions.
Verification
- make sure the local dev workflow is running:
npm run dev- open
http://localhost:7102/admin/ - enter the Student list page from the Student menu
- trigger create, read, update, and delete operations from the page
- inspect the generated backend files and confirm that the CRUD layers are present:
vona/src/module/demo-student/src/entity/student.tsxvona/src/module/demo-student/src/controller/student.tsvona/src/module/demo-student/src/dto/studentSelectResItem.tsx
Read more
Next step
Continue to Tutorial 3: Frontend Metadata Sharing.