Documentation
This guide explains where we collect and enter data in our application, and what types of data we should use on the frontend. By keeping our frontend inputs strictly matched with our database, we prev
This guide explains where we collect and enter data in our application, and what types of data we should use on the frontend. By keeping our frontend inputs strictly matched with our database, we prev
Frontend Data Ingestion Typings Guide
This guide maps where we collect data in our application to the exact types expected by our database. Keeping frontend inputs strictly aligned with back-end schemas prevents messy data and maintains system integrity.
This guide explains where we collect and enter data in our application, and what types of data we should use on the frontend. By keeping our frontend inputs strictly matched with our database, we prevent messy data entries and keep our system perfectly clean.
2. How it works — operational workflow
In professional property management, data enters our system through two main doors: automatic background pipelines (like Companies House scrapes or bank syncs) and manual human inputs on the frontend UX (like staff members entering new landlords, tenancies, or contractor invoices). To guarantee data integrity, manual data entry must occur at specific designated surfaces, utilizing strict input typings (e.g., dropdowns instead of free text) to prevent spelling mismatches and garbage inputs.
Step-by-Step Data Entry & Flow
-
1Operator Triggers Form
An operator opens a designated modal (e.g., "Add New Landlord") to manually input record details.
-
2Strict UI Type Enforcement
The form fields enforce strict data constraints. Phone fields accept only numbers; email inputs must contain '@'; and names are split into separate first/last inputs to prevent formatting slop.
-
3Programmatic Dropdown Enums
Instead of manual text entry, the UI utilizes strict selection boxes linked directly to our database reference lists (like
tbl_document_typesortbl_channels). -
4Human-In-The-Loop Validation
For sensitive or high-risk edits (like changing banking details), the system triggers a mandatory out-of-band verification loop (like SMS OTP) and logs the event to the audit trail.
-
5Real-Time Database Upsert
The validated payload is sent to our Supabase backend API, updating the active tenant dashboards instantly and notifying connected agents.
A Day in the Life of Data Entry
The table below walks through real-life hourly moments of how an operator enters data on the frontend, which database table is updated, and what the user sees in real-time:
| Time | Operational Action | Target Frontend UX Surface | Data Types Applied | Target Database Table |
|---|---|---|---|---|
| 09:30 | Onboard a New Landlord | Landlords Dashboard $\rightarrow$ Add Landlord Form |
Split text (first/last), Email format, Country Code phone | tbl_persons + tbl_persons_channels |
| 10:15 | Upload Sign-off Agreement | Documents Section $\rightarrow$ File Dropzone |
Blob payload, Auto-extracted metadata JSONB | tbl_documents + tbl_document_links |
| 11:45 | Draft Tenancy Contract | Tenancies Dashboard $\rightarrow$ Draft Contract Form |
UUID reference, Numeric PCM rent, Date ISO strings | tbl_tenancies + tbl_tenancies_persons |
| 14:30 | served Section 13 Notice | Compliance Board $\rightarrow$ Serve Notice Modal |
Date (ISO 8601), Numeric Rent, Selection Enum list | tbl_rent_reviews + tbl_audit_log |
| 16:00 | Audit Banking Change | Admin Panel $\rightarrow$ Bank Details Modal |
AES-256-GCM Encrypted payload, SMS OTP Verification code | tbl_api_credentials + tbl_audit_log |
Operational Data Entry Flow
3. Technical — how it works in code
In our Next.js/React portal codebase, all frontend data structures must mirror our Supabase PostgreSQL schemas bit-for-bit. We use TypeScript interfaces to model these payloads, and implement client-side schemas (such as zod) to enforce constraints before payloads leave the browser.
Repository Code
The primary directories and interfaces managing database synchronization and frontend form typings are:
Active Code Implementation (Zod & TS)
Below is an example of our standard frontend schema validator (Zod) enforcing strict typings before submission:
import { z } from "zod";
// Strict Zod schema enforcing database-compatible typings
export const landlordFormSchema = z.object({
firstName: z.string().min(2, "First name is too short").max(50),
lastName: z.string().min(2, "Last name is too short").max(50),
email: z.string().email("Invalid email format"),
phone: z.string().regex(/^\+?[1-9]\d{1,14}$/, "Phone number must be in E.164 format"),
organizationId: z.string().uuid("Invalid organization reference UUID"),
preferredChannel: z.enum(["whatsapp", "email", "sms", "phone"]),
});
export type LandlordFormInput = z.infer<typeof landlordFormSchema>;
Target Database Schema Alignment
The fields validated on the frontend maps directly to our strict PostgreSQL schema:
-- Structure for public.tbl_persons
CREATE TABLE public.tbl_persons (
person_id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
first_name text NOT NULL,
last_name text NOT NULL,
is_test_record boolean DEFAULT false,
created_at timestamp with time zone DEFAULT now()
);
-- Structure for public.tbl_persons_channels
CREATE TABLE public.tbl_persons_channels (
channel_id uuid DEFAULT gen_random_uuid() PRIMARY KEY,
person_id uuid REFERENCES public.tbl_persons(person_id) ON DELETE CASCADE,
channel_type text CHECK (channel_type IN ('whatsapp', 'email', 'sms', 'phone')),
channel_value text NOT NULL,
is_preferred boolean DEFAULT false
);
Frontend Data Flow & API Integration
This sequence diagram shows the step-by-step path of data typed by an operator on the frontend UX, validated by the browser, and sent to Supabase:
Cross-References & Connected Systems
This guide works hand-in-hand with our database typings and validation systems. See these related specifications for details:
- See 3.5c Person Data Architecture for tbl_persons details.
- See 3.5b PII Data Lifecycle (Tier 0/1/2) for identity storage policies.
Architecture Details
The data architecture is built on a layered pipeline model: raw ingestion → transformation → storage → access. Each layer enforces schema validation, data quality checks, and audit trails. The system uses PostgreSQL (Supabase) as the primary datastore with Redis for caching and S3-compatible storage for blobs.
- Core Component: Data pipeline engine with ETL orchestration
- Data Flow: Source → Ingestion → Validation → Transformation → Storage → Query
- Integration Points: Supabase PostgreSQL, Redis cache, S3 blob storage, event bus
Configuration Reference
Key configuration parameters for this system:
| Parameter | Type | Default | Description |
|---|---|---|---|
| batch_size | integer | 1000 | Number of records per batch operation |
| schema_version | string | v1 | Target schema version for data transformation |
| retention_days | integer | 90 | Data retention period in days |
Figure 2: Data pipeline architecture — component interaction and data flow.
Troubleshooting
| Issue | Cause | Resolution |
|---|---|---|
| Schema migration conflicts | Concurrent DDL operations on shared tables | Use migration scripts with 'IF NOT EXISTS' guards |
| Slow query performance | Missing index on join columns | Add composite indexes for common query patterns |
This component is part of the RAIA (Real estate Artificial Intelligence Agent) platform mono-repo. Implementation details, API contracts, and integration tests are available in the repository.