Real-time Data Foundation
Tiquo’s data layer is built on Convex, providing a real-time, reactive database that eliminates the complexity of traditional polling or WebSocket implementations.Core Concepts
Live Queries
Every query in Tiquo is a live subscription. When data changes anywhere in the system, all connected clients update automatically:Optimistic Updates
Mutations update the UI immediately, before the server confirms:1
User Action
User clicks “Create Customer”
2
Immediate Update
UI shows the new customer instantly
3
Server Processing
Convex processes the mutation
4
Confirmation
Server confirms or rolls back if failed
This pattern provides sub-100ms perceived latency for most operations.
Database Schema
Core Tables
customers
customers
Customer profiles and contact information:
| Field | Type | Description |
|---|---|---|
firstName | string | Customer’s first name |
lastName | string | Customer’s last name |
email | string | Primary email address |
phone | string? | Phone number |
clerkOrganizationId | string | Organization isolation |
lifecycle | enum | lead, active, at-risk, churned |
clv | number? | Customer lifetime value |
notes | string? | Internal notes |
tags | array | Customer tags |
customFields | object | Dynamic custom fields |
orders
orders
All order types (bookings, enquiries, purchases):
| Field | Type | Description |
|---|---|---|
customerId | id | Reference to customer |
locationId | id | Reference to location |
type | enum | booking, enquiry, purchase |
status | enum | pending, confirmed, completed, cancelled |
items | array | Line items with services/products |
total | number | Order total |
paidAmount | number | Amount paid |
scheduledAt | number? | Appointment time |
notes | string? | Order notes |
services
services
Service definitions and configurations:
| Field | Type | Description |
|---|---|---|
name | string | Service name |
description | string | Service description |
categoryId | id | Reference to category |
duration | number | Duration in minutes |
price | number | Base price |
locationId | id | Reference to location |
isActive | boolean | Availability status |
resources | array | Required resources |
locations
locations
Physical or virtual business locations:
| Field | Type | Description |
|---|---|---|
name | string | Location name |
address | object | Address details |
timezone | string | Location timezone |
operatingHours | object | Hours by day |
settings | object | Location-specific settings |
floorPlanId | id? | Associated floor plan |
memberships
memberships
Loyalty and membership programs:
| Field | Type | Description |
|---|---|---|
customerId | id | Reference to customer |
programId | id | Reference to program |
tier | string | Current tier level |
points | number | Accumulated points |
startDate | number | Membership start |
expiryDate | number? | Expiration date |
walletPassId | string? | Apple/Google Wallet ID |
Analytics Tables
analytics
analytics
Pre-aggregated metrics for fast dashboards:
| Field | Type | Description |
|---|---|---|
date | string | Aggregation date |
locationId | id | Location reference |
metric | string | Metric name |
value | number | Metric value |
dimensions | object | Additional dimensions |
activity
activity
Activity timeline for customers and orders:
| Field | Type | Description |
|---|---|---|
entityType | enum | customer, order, etc. |
entityId | id | Reference to entity |
action | string | Action type |
userId | string | User who performed action |
timestamp | number | When it occurred |
metadata | object | Additional details |
Query Patterns
Filtered Lists
Aggregations
Indexes
Tiquo uses strategic indexes for query performance:File Storage
Convex provides built-in file storage for:- Customer profile photos
- Product images
- Document attachments
- Email campaign assets
- Floor plan exports