Architecture

The QIYAS Compliance Mapper is a TanStack Start v1 (React 19, Vite 7) application backed by Lovable Cloud (managed Supabase) for storage, auth, realtime, and edge functions.

Stack

  • Frontend: TanStack Start + TanStack Router (file-based routing under src/routes/).
  • UI: Tailwind v4 + shadcn/ui primitives.
  • Backend: Lovable Cloud — Postgres with RLS, Storage, Realtime, Edge Functions (Deno).
  • AI: Lovable AI Gateway (Gemini) called from the analyze-file edge function.

Route map

/                   landing — choose a standard, recent projects
/p/$id              project workspace — upload, analyze, map files
/p/$id/report       printable compliance report
/docs/*             this documentation

Data model

standards   (code, title)
clauses     (standard_id → standards, code, title, requirements, sort_order)
projects    (id, standard_code, entity_name, cycle, created_at)
files       (id, project_id, name, storage_path, status, verdict, acceptance_score, recommendations)
mappings    (project_id, clause_id, file_id)

All public tables have RLS enabled. Reads/writes are scoped per project.

Realtime

The project workspace subscribes to Postgres changes on files and mappings filtered by project_id. A polling safety-net runs while any file is in uploaded or analyzing status in case the websocket drops.

Edge functions

  • analyze-file — extracts text, calls Lovable AI Gateway with the acceptance_verdict tool, writes verdict + score + recommendations to files.

See the API Reference for the request/response contract.