ZELYRA
ZELYRA CRUD / EXAMPLE

Build an address book.
Without the detour.

One schema, one CRUD declaration and a complete starting point for a real business application. This page shows the path — and where your own design begins.

01 / THE MODEL

Start with the
information.

An address is more than a row in a table. Define the fields, their types and their rules first. Zelyra can then use that knowledge for validation, forms and the CRUD resource.

table addresses {
    id: Id primary auto
    first_name: String(80) required
    last_name: String(80) required
    street: String(160) required
    city: String(100) required
    email: Email?
    active: Bool default true
}
02 / THE CRUD RESOURCE

One declaration.
Many screens.

The short version

This is enough to get a useful, schema-aware CRUD resource started.

crud Address -> addresses
  • List and detail view
  • Create and edit forms
  • Search, filters and sorting
  • Pagination and CSRF-protected delete

Configure the experience

Make the important columns and entry points explicit. The schema remains the source of truth.

crud Address -> addresses {
    title: "Addresses"
    list { first_name last_name city email active }
    search { first_name last_name city }
    filter { city active }
}
Addresses
NameCityE-MailStatus
Anna WeberBerlinanna@example.test● Active⋯
Jonas KleinHamburgjonas@example.test● Active⋯
Lea HoffmannStaufenberglea@example.test○ Inactive⋯
03 / MAKE IT YOURS

The generator starts it.
You shape it.

Zelyra provides a safe, working foundation. Your design work lives in the view layer: hierarchy, spacing, color, interaction and responsive behavior.

01 / HIERARCHY

Start with priority.

Put search, the primary action and the table first. Secondary actions can stay quiet.

.crud-preview-head
02 / VISUAL SYSTEM

Use your tokens.

Change a small set of CSS variables instead of styling every button separately.

--purple / --acid
03 / COMPONENTS

Keep behavior stable.

Restyle the wrapper, table and form fields while keeping validation and permissions server-side.

view + schema
04 / DESIGN WORKFLOW

A practical order
of operations.

01Define dataFields, types, relationships and constraints.
02Generate & checkzelyra check before changing the database.
03Tune the viewLayout, typography, states, empty and error views.
04Verify the edgesTest search, permissions, CSRF, mobile and destructive actions.
# inspect the plan before applying changes
zelyra db plan addresses.zyl
zelyra check addresses.zyl
zelyra serve addresses.zyl
05 / FROM DEMO TO APPLICATION

What happens
behind the screens.

Create

The form collects the address data. Zelyra validates required fields and email formats before the record is written to the database.

Read

The list reads the records through the resource definition. Search, filters and pagination keep the view useful when the address book grows.

Update

An edit action loads one record into the same field structure. Changes pass through the same validation rules as creation.

Delete safely

Destructive actions should be explicit, protected against CSRF and restricted by permissions. In production, consider soft deletes and an audit trail.

The important principle

The schema describes the data, the CRUD resource describes the workflow and the view describes the experience. Keep these responsibilities separate and your application remains easy to extend.

06 / STEP BY STEP

Build the address book
in six clear steps.

Follow this sequence in a new Zelyra project. Run one step, check the result and only then continue.

01

Create the project

Start with the official repository and enter the project directory. This gives you the CLI, examples and the basic runtime.

git clone https://github.com/sf1976/zelyra.git
cd zelyra
	./install.sh

Windows with PowerShell and Docker Desktop
Install Git for Windows and Docker Desktop first. Open PowerShell, then run the following commands. The install script is executed inside the Linux container, so Windows users do not need a separate Linux installation.

git clone https://github.com/sf1976/zelyra.git
cd zelyra
docker compose -f docker-compose.mariadb.yml up -d --build
docker compose exec app ./install.sh
02

Describe the address data

Create an addresses schema. Decide which fields are required, which type they use and which values may be empty. This schema is the foundation for database and forms.

table addresses {
    first_name: String(80) required
    last_name: String(80) required
    email: Email?
    city: String(100) required
}
03

Check before changing the database

Let Zelyra inspect the schema and show the planned change. Read the plan carefully, especially when the project already contains data.

zelyra check addresses.zyl
zelyra db plan addresses.zyl
04

Declare the CRUD resource

Connect the resource to the addresses table. Define the title, visible columns, searchable fields and useful filters.

crud Address -> addresses {
    list { first_name last_name city email }
    search { first_name last_name city }
    filter { city }
}
05

Start and test the application

Start the local server and test the complete path: list, search, create, edit and delete. Also check empty results, invalid email addresses and mobile layout.

zelyra serve addresses.zyl
06

Customize the design

Only after the behavior works, change the view layer. Adjust spacing, typography, colors and table actions while keeping validation and permissions intact.

resources/views/addresses/index.blade.php
resources/css/addresses.css
A reliable working rhythm

Model first, inspect the plan, generate the resource, test the workflow and style last. This makes errors easy to locate and keeps the address administration maintainable.

07 / TRY THE FLOW

A CRUD resource
you can touch.

This small front-end demo runs entirely in your browser. Search, filter, create and delete records to see the interaction a generated resource can provide.

NameCityE-MailStatus
Anna WeberBerlinanna@example.testActive
Jonas KleinHamburgjonas@example.testActive
Lea HoffmannStaufenberglea@example.testInactive
No matching addresses.