Model-config web apps: describe the app in configuration instead of writing code. Built on Polars and DuckDB.
leads_crud.yaml · 1.1 KB · 61 lines
| 1 | # DBBasic CRM Template - Leads Management |
| 2 | resource: leads |
| 3 | database: crm.db |
| 4 | |
| 5 | fields: |
| 6 | id: |
| 7 | type: primary_key |
| 8 | first_name: |
| 9 | type: string |
| 10 | required: true |
| 11 | max_length: 50 |
| 12 | last_name: |
| 13 | type: string |
| 14 | required: true |
| 15 | max_length: 50 |
| 16 | email: |
| 17 | type: email |
| 18 | unique: true |
| 19 | required: true |
| 20 | phone: |
| 21 | type: string |
| 22 | max_length: 20 |
| 23 | company: |
| 24 | type: string |
| 25 | max_length: 100 |
| 26 | job_title: |
| 27 | type: string |
| 28 | max_length: 100 |
| 29 | status: |
| 30 | type: select |
| 31 | options: [new, contacted, qualified, proposal, negotiation, won, lost] |
| 32 | default: new |
| 33 | source: |
| 34 | type: select |
| 35 | options: [website, email, phone, referral, social_media, advertisement] |
| 36 | value: |
| 37 | type: decimal |
| 38 | precision: 10 |
| 39 | scale: 2 |
| 40 | ui: |
| 41 | prefix: "$" |
| 42 | assigned_to: |
| 43 | type: foreign_key |
| 44 | references: users |
| 45 | created_at: |
| 46 | type: timestamp |
| 47 | auto_now_add: true |
| 48 | |
| 49 | hooks: |
| 50 | before_create: validate_lead_data |
| 51 | after_create: assign_lead_automatically |
| 52 | before_update: log_status_change |
| 53 | after_update: trigger_follow_up_actions |
| 54 | |
| 55 | ui: |
| 56 | theme: bootstrap |
| 57 | variant: crm |
| 58 | components: |
| 59 | list: |
| 60 | variant: kanban |
| 61 | group_by: status |