pnpm scaffold command through a visual interface.
Scaffolding Tab Structure




- Left Sidebar: Entity list and selection checkboxes
- Right Content: Code generation options (Model Class, Model Test, View)
Available Code Types
View component generation is currently under development. You can generate React components
through other Sonamu UI features.
Generating Model Class
1. Select Entity
Select the Entity to generate a Model for from the left Entity list. Single selection:2. Select Generation Option
Check the ☑ Model Class checkbox.3. Run Generate
Click the [Generate] button to create the following file:Generated Code
src/application/user/user.model.ts
- ✅ TypeScript type definitions
- ✅ Entity connection
- ✅ BaseModel inheritance
- ✅ Basic CRUD methods
Generating Model Test
1. Select Entity
Select Entity same as for Model.2. Select Generation Option
Check the ☑ Model Test checkbox.3. Run Generate
Click the [Generate] button to create the following file:Generated Code
src/application/user/user.model.test.ts
- ✅ A
bootstrap(vi)call (Sonamu init + per-test transaction wrapping) - ✅ An empty
describe.skipblock — you write the actual cases
Batch Generation
Generate for All Entities
- Click [Select All] button
- Select generation options
- Click [Generate]
Select Specific Entities Only
For all Entities during initial project setup:Checking Generation Results
Success Message
File Conflict
When trying to generate files that already exist, a confirmation modal appears:- Cancel: Cancel generation
- Backup & Overwrite: Backup existing files as
.bakthen overwrite - Overwrite: Overwrite directly (caution!)
View Generation
The TemplateKey list on the Scaffolding tab includes View templates in addition to the Model ones.The same templates are available from the CLI:
pnpm scaffold view_list, pnpm scaffold view_form.Post-Generation Workflow
1. Add Model Methods
Add business logic to the generated Model:src/application/user/user.model.ts
2. Add Tests
Add more tests to the generated test file:src/application/user/user.model.test.ts
3. Add API
Add API endpoints using the@api decorator on the Model:
Practical Tips
1. Initial Project Setup
2. Adding New Entity
3. When Regeneration is Needed
When Entity structure changes significantly and Model needs regeneration:Next Steps
Model
Learn more about Model classes
scaffold CLI
Generate code via CLI