Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.
customers_crud.yaml · 1.2 KB · 60 lines
| 1 | # DBBasic CRUD Config - Customers Example |
| 2 | resource: customers |
| 3 | database: customers.db |
| 4 | |
| 5 | fields: |
| 6 | id: |
| 7 | type: primary_key |
| 8 | name: |
| 9 | type: string |
| 10 | required: true |
| 11 | searchable: true |
| 12 | max_length: 100 |
| 13 | email: |
| 14 | type: email |
| 15 | unique: true |
| 16 | searchable: true |
| 17 | required: true |
| 18 | phone: |
| 19 | type: string |
| 20 | max_length: 20 |
| 21 | credit_limit: |
| 22 | type: decimal |
| 23 | min: 0 |
| 24 | max: 100000 |
| 25 | default: 1000 |
| 26 | status: |
| 27 | type: select |
| 28 | options: [active, inactive, pending] |
| 29 | default: active |
| 30 | created_at: |
| 31 | type: timestamp |
| 32 | auto_now_add: true |
| 33 | updated_at: |
| 34 | type: timestamp |
| 35 | auto_now: true |
| 36 | |
| 37 | interface: |
| 38 | list_display: [name, email, status, credit_limit, created_at] |
| 39 | search_fields: [name, email] |
| 40 | filters: [status, created_at] |
| 41 | actions: [export_csv, bulk_delete] |
| 42 | per_page: 25 |
| 43 | |
| 44 | hooks: |
| 45 | before_create: validate_business_rules |
| 46 | after_create: send_welcome_email |
| 47 | before_update: check_permissions |
| 48 | after_update: sync_to_crm |
| 49 | before_delete: check_dependencies |
| 50 | |
| 51 | permissions: |
| 52 | create: public # Temporarily set to public for testing |
| 53 | read: public |
| 54 | update: owner_or_admin |
| 55 | delete: admin_only |
| 56 | |
| 57 | api: |
| 58 | base_path: /api/customers |
| 59 | enable_bulk: true |
| 60 | enable_export: true |