A VeloIQ module is a Python package that lives underDocumentation Index
Fetch the complete documentation index at: https://docs.veloiq.dev/llms.txt
Use this file to discover all available pages before exploring further.
backend/app/modules/. Each module owns one domain concept — its models, generated API, custom endpoints, and admin views. On startup, the framework scans app/modules/*/ and registers every module it finds automatically. You never add import statements to main.py.
Module directory layout
Creating a module
Use the CLI to scaffold a new module:| Flag | Effect |
|---|---|
--with-custom-api | Creates custom_api.py with a starter router |
--with-admin | Creates admin/admin_views.py with a starter ModelView |
models.py
Define your entities by inheriting from one of the framework base classes (FrameworkModel, TimestampedModel, or StandardModel). See Models for the full reference on base classes, field types, and relationships.
api.py — generated CRUD endpoints
After runningveloiq generate, each module has an api.py that creates a complete CRUD router for your model:
create_crud_router generates these endpoints automatically:
| Method | Path | Action |
|---|---|---|
| GET | /order | Paginated list (?_start=0&_end=25) |
| GET | /order/{id} | Single record |
| POST | /order | Create |
| PUT | /order/{id} | Full update |
| DELETE | /order/{id} | Delete |
x-total-count and content-range headers to support the Refine data provider pagination convention.
custom_api.py — custom endpoints
For business-specific endpoints, createcustom_api.py in the module directory and import router from the generated api.py. Add routes to that router and the framework loader picks them up automatically.
api.py and custom_api.py on startup — you don’t need to register the router anywhere else.
admin/admin_views.py — back-office views
Add an SQLAdminModelView to expose your model in the admin panel at /admin/.
Frontend schema files
veloiq generate creates a TypeScript schema file for each module that the DynamicResource UI component reads to render list, detail, create, and edit views.
| File | Description |
|---|---|
{module}Schema.gen.ts | Auto-generated field definitions — do not edit |
{module}Schema.manual.ts | Your overrides and extensions — you write this |
{module}Schema.manual.ts in the same directory and merge it into {module}Schema.ts. Refer to the @veloiq/ui documentation for the ModelDef and FieldDef type reference.
Module auto-loading
On every startup,create_veloiq_app() scans app/modules/*/ and, for each subdirectory that contains an __init__.py, imports models.py, api.py, and custom_api.py (if present) and registers any ModelView classes found in admin/admin_views.py.
Because of this automatic discovery, main.py never grows beyond a single line:
Pass a
VeloIQConfig instance to create_veloiq_app() when you need to configure roles, the database URL, or other settings. The defaults work for local development with SQLite.Models
Define fields, base classes, and relationships
Access Control
Apply RBAC and ReBAC to your modules and fields