Data Model

Everything stores account-bound product data in Convex. All platform apps use the same owner-scoped records, with stable client IDs for migration and idempotent writes.

Tables

  • users: Clerk-backed account records keyed by issuer plus subject or tokenIdentifier. Users are tombstoned and owner-owned product data is removed on Clerk user.deleted.
  • areas: high-level containers owned by a user. Areas can be archived and can optionally archive projects or detach tasks.
  • projects: focused containers that can belong to an area. Moving a project can move active task area links.
  • tasks: the primary work item record. Tasks support status, priority, due/scheduled dates, reminders, recurrence, tags, source, client IDs, soft deletion, and indexed search/listing.
  • devices: per-installation records for platform targeting, sync diagnostics, and future push notification routing.
  • syncEvents: owner-scoped journal entries for user, area, project, task, and device changes. Clients use these for incremental reconciliation after an initial snapshot.
  • aiRequests: owner-scoped AI request metadata for provider/model, request kind, token counts, and completion status. Detailed provider errors are not returned to clients.
  • featureFlags: lightweight Convex-backed flags with optional platform overrides and rollout percentages.

Identity

Every user-owned table stores ownerId. Client code must never pass an owner ID directly; the backend derives it from the authenticated Clerk/Convex identity.

Sync

Clients should generate stable clientId values for locally created areas, projects, and tasks. The backend uses those IDs to make imports and retries idempotent across Apple, Android, Windows, web, and future clients.

Querying

Use cursor pagination for large task lists. The backend has indexes for owner, status, area, project, deletion state, and updatedAt, plus a search_title full-text index for task title search.

Retention

Sync events are retained for 90 days by a Convex cron job. Deleted tasks are purged after 30 days; the event journal is only for efficient incremental sync. AI request metadata is also retained for 90 days. It intentionally stores usage and operational metadata, not full prompts or full model outputs.