Core Concepts & ERD Modeling
Perlite builds enterprise applications from visual models designed inside Perlite Studio. As you model entities, relationships, security classifications, traits, action points, and multi-panel screens visually, the compiler generates matching Prisma schemas, NestJS backend services, and React interfaces cleanly on demand.
1. Perlite Studio Four-Zone Tour
Perlite Studio organizes every modeling, UI composition, security, and publishing tool into four coordinated zones:
Zone 1 · Object Browser (Right Panel)
The Object Browser is the central command hub of Perlite Studio. Every building block in your system lives here across four categorized groups on the right rail (Data & Domain: Entities, Traits, Types, Primitives; User Interface: Screens, Panels; Architecture & Integration: Diagrams, State Machines, Interfaces, Roles, Suites; Operations & Quality: Testing, Performance, Environments, Migrations), along with Dependency Explorer (Deps) and the AI Assistant (AI).
Toggle ☑️ Base to inspect reusable platform panels and traits alongside your domain artifacts, or expand any entity row to manage its attributes, traits, relations, screens, and functions directly — and drag any item onto an open diagram canvas.

Object Browser with WorkOrder expanded to show attached Traits, Attributes, Relations, and Functions.
Zone 2 · Main Workspace (Center Multi-Tab Canvas)
The Main Workspace lets you work across multiple visual designers simultaneously in tabs — ERD Diagrams, Screen Stitcher layouts, State Machines, Action Point editors, Role Matrices, and Suite Studio. Use ? (F1) on the tab bar for immediate contextual help or toggle the left and right sidebars whenever you want extra canvas space.

Main Workspace showing Diagram View alongside a Screen Stitcher tab and interactive ERD notation controls.
Zone 3 · Application Menu (Left Sidebar)
The Application Menu renders your application’s live navigation hierarchy while you design. Switch groups open, jump straight to composite screens or entity registers with Cmd+K, or click ⚙️ Edit to reorganize menu groups and drag screens into place.

Application Menu showing searchable navigation groups for Dispatch Operations and Core Domain Registers.
Zone 4 · Change Control Bar (Bottom Bar)
The Change Control Bar anchors version governance across the bottom of Studio. Switch between published state and sandbox drafts, confirm real-time system health (Published System State (Safe)), open ⌃ Review Changes to inspect diffs element-by-element, or merge and publish cleanly via Review & Merge.

Change Control Bar displaying sandbox status, validation health, Review Changes, and Review & Merge controls.
2. Sample Datasets & Live Database Previews
Perlite tests every screen and workflow against real data stored in your local SQLite or PostgreSQL database:
- Load any named Sample Dataset (
FieldOpsDemo,ClinicalCareDemo) from Test & Scenario Studio to seed relational records across entities automatically. - Preview screens inside Studio query that live database over REST so sorting, searching, encryption, foreign-key lookups, and pagination match production behavior immediately.
3. Modeling Entities & Relationships on the ERD Canvas
Open any diagram from Object Browser -> Diagrams to shape your domain visually:
+ Add Entity: Creates a PascalCase entity card on the canvas and validates naming uniqueness cleanly across entities and traits.- Attribute Types & Classifications: Add strongly typed attributes (
UUID,String,Int,Decimal,Boolean,DateTime,Email,Enum) and apply governance badges directly on sensitive columns:PII: Identifies personal attributes (firstName,nhsNumber,primaryContactEmail) subject to redaction and privacy policies.CONF: Marks confidential values (siteAccessPin, sensitive clinical values) eligible for field encryption and strict role access.State: Connects workflow status fields directly to State Machine transitions.
- Notations, Traits Overlay & Layout: Toggle between Crow’s Foot, UML, and Chen notations, switch
🧩 Traitson to preview inherited fields (tenantId,deletedAt,parentId, timestamps) directly inside entity cards, and run Auto-Arrange to organize complex diagrams cleanly. - Connecting Relationships: Drag relationship connectors (
OneToMany,ManyToOne,OneToOne) between entities to bind foreign keys visually across the schema.
4. Action Points & Business Logic
Action Points are the key locations across your application where you insert your own custom business logic — without editing generated platform code by hand. Perlite places named Action Points at critical moments inside every generated entity function, state transition, and composite screen panel so you have dedicated, predictable places to plug in:
- Custom validations & guardrails — enforce domain rules, SLA or credit checks, and authorization policies before data is saved.
- Derived calculations & field defaults — compute totals, normalize inputs, or enrich payloads automatically.
- Database lookups & atomic updates — query related records or update child rows inside the active database transaction.
- Notifications, integrations & UI actions — trigger post-commit events, control button visibility, or broadcast signals across screen panels.
Whether you assemble rules visually with blocks or write custom TypeScript, your logic runs directly alongside standard platform behavior and stays intact across every rebuild.
Key Locations Where You Can Insert Custom Logic
- Backend Entity Lifecycles: Functions (
CreateOne,UpdateOne,DeleteOne,FetchOne,FetchMany,ExecuteAction,TransitionState) expose named Action Points across three execution stages:- Pre-Transaction (
ON_REQUEST_INIT,ON_AUTHORIZE,PRE_VALIDATE,POST_VALIDATE): Normalize incoming inputs, check authorization rules, validate business invariants, or return structured validation responses (400,403,409,422). - In-Transaction (
PRE_CREATE,PRE_UPDATE,EXECUTE,PRE_CHILD_CREATE,POST_CREATE,POST_UPDATE): Compute derived values and run atomic database lookups or related record updates inside the active database transaction. - Post-Commit (
AFTER_COMMIT,ON_SUCCESS,ON_FAILURE): Trigger downstream notifications, audit entries, or structured error handling once persistence completes.
- Pre-Transaction (
- Screen & Panel Action Points: Composite screen panels and custom toolbar or row buttons expose client-side Action Points (
EVALUATE_ACTION_STATE,ON_BEFORE_CLOSE,ON_AFTER_OPEN, and custom⚡panel actions) that evaluate in-memory to control button state, advance filter or date state, or broadcast signals across sibling panels.
Visual Action Point Logic Studio & Custom TypeScript
- Open Any Action Point: Expand
🎯action points under Object Browser -> Entities -> Functions (or directly inside an Entity Card on the ERD canvas, in State Machine Studio, or via⚙ Edit Logicon a panel action in Screen Stitcher) and click⚡ Visual Editor. - Build Visual Logic Flows: Assemble steps from the Add Block palette (
If / Else,Set Variable,Query Database,Save / Mutate,Reject with Error,Decision Matrix,Switch / Case,For Each,Append to List,Call Function,Screen / UI Action,Log / Audit,Return / Finish) paired withLiteral/Variabletoggles,+ {Var}schema pickers, and the live bottom Code Preview drawer. - TypeScript Escape Hatch: Expand
Advanced / Developer -> TypeScript Code(or open the protectedPERLITE_ACTION_POINTregion in your code editor) whenever custom TypeScript is needed; both visual flows and handwritten TypeScript weave cleanly into generated services and stay intact across rebuilds. See Action Point Logic Studio & Custom TypeScript for the full block reference and guided walkthrough.

Action Point Logic Studio editing WorkOrder.CreateOne (PRE_VALIDATE) with the Add Block palette, structured conditional steps, Literal/Variable selectors, and live Code Preview.
5. How Perlite Stores & Compiles Your Model
Perlite stores your visual model in clean, version-controlled YAML files inside the project’s model/ folder so every design change diffs cleanly in Git. When you build, the Perlite Compiler combines your domain model with reusable platform panels and traits (base/) to generate the complete TypeScript, Prisma, and React production codebase inside runtime/:
| Layer | Purpose | Managed By |
|---|---|---|
base/ |
Domain-agnostic 16 Base Panels, 17 Base Traits, and reusable platform primitives (Record, Resource, Event). |
Platform runtime library |
model/ |
Version-controlled YAML model files for your entities, traits, diagrams, screens, menus, datasets, and custom TypeScript logic hooks. | Perlite Studio visual editors (and Git) |
runtime/ |
Generated NestJS modules, split-function CRUD services, Prisma database schemas, and React screens. | Perlite Compiler output |