Resources and scaffolding
A scaffold generates ordinary source for the database, API, test, and frontend:
bunway g scaffold Product name:string price:decimal active:boolean
API behavior
Collection routes support server-side pagination, text filtering, and whitelisted sorting:
GET /products?page=1&perPage=50&filter=shoe&sort=name&order=asc
Responses use { records, total }. perPage=all explicitly disables pagination. Create and update
bodies use Elysia validation, and IDs and multipart scalar values are normalized at the request boundary.
Collection interface
Generated collection pages provide:
- Create and edit dialogs opened from the
New Resourcebutton and row actions. - An explicit “Are you sure?” confirmation dialog before every scaffolded record deletion.
- Date, datetime/timestamp, and time inputs consistently use the generated shadcn-svelte
Input-basedDateFieldcomponent in create and edit forms. - Search with a short debounce.
- Server-side sorting and pagination.
- 50, 100, 250, and all-row page sizes.
- Row selection and column visibility controls.
- Humanized column headings.
- Draggable column widths stored in local storage per resource.
- Double-click column-width reset.
- Detail, edit, and delete row actions.
- An Edit button on every generated detail page when the scaffold includes the
updateaction. It opens an edit dialog on that detail page and updates the displayed record without navigating to the index. - Native row reordering when a
position:integerfield exists.
The UI uses Svelte 5 and source-installed shadcn-svelte components. Application code can modify every generated page without a Bunway frontend runtime.
Date and datetime columns and detail values use the application's saved timezone, date format, and time format. Database values remain unchanged; formatting occurs only at display time.
Generated detail pages use the same semantic card, foreground, muted, and border tokens as the application shell. Their content therefore follows light and dark mode without resource-specific color overrides.