Documentation Index
Machine-readable map of every Kredal documentation page with a one-line purpose. Read this first.
Every documentation page, with a one-line purpose. AI agents: read this first, then use
docs_search(query) to retrieve specific chunks instead of reading whole files.
Tutorials — learning-oriented
| Page | Purpose |
|---|---|
| tutorials/getting-started.md | Clone the repo, set env vars, run the app locally. |
| tutorials/seed-demo-data.md | Populate a realistic demo company for testing or a demo. |
| tutorials/run-tests.md | Run the scoring/report unit tests and typecheck. |
How-to — task-oriented runbooks
| Page | Purpose |
|---|---|
| how-to/deploy-to-vercel.md | Deploy the app and docs site to Vercel. |
| how-to/apply-db-migrations.md | Apply Supabase schema migrations (CLI-only; MCP cannot see this project). |
| how-to/rotate-supabase-keys.md | Fetch and rotate Supabase keys safely into .env.local. |
| how-to/verify-rls.md | Prove cross-tenant isolation and RLS correctness. |
| how-to/add-a-scoring-rule.md | Add a rule to the scoring engine and keep docs + tests in sync. |
| how-to/add-a-questionnaire-question.md | Add a question to the readiness questionnaire. |
| how-to/deploy-docs-rag.md | Enable semantic (pgvector hybrid) search for the docs. |
| how-to/configure-ai-extraction.md | Enable Gemini document extraction, consistency flags, and narrative drafts. |
| how-to/grant-platform-admin.md | Give an account access to the /admin area (SQL-only, by design). |
| how-to/set-up-pilot-payments.md | Turn on Stripe payment links and finish the go-live env steps. |
Reference — information-oriented
| Page | Purpose |
|---|---|
| reference/architecture.md | System context, containers, and request flow (C4 + Mermaid). |
| reference/database-schema.md | Tables, columns, RLS policies, storage (GENERATED from migration SQL). |
| reference/scoring-engine.md | Categories, weights, every rule and fix, risk bands (GENERATED from engine.ts). |
| reference/design-tokens.md | Colour, type, spacing, and risk-colour tokens. |
| reference/routes-and-actions.md | Route tree and server-action inventory. |
| reference/environment-variables.md | Every env var, where it is used, and safety rules. |
Explanation — understanding-oriented
| Page | Purpose |
|---|---|
| explanation/why-kredal.md | The problem, the thesis, and the wedge. |
| explanation/domain-glossary.md | UAE SME banking terms: UBO, KYC, WPS, Ejari, source-of-funds. |
| explanation/security-model.md | RLS design, roles, private storage, signed URLs, audit log. |
ADRs — architecture decision records
| Page | Decision |
|---|---|
| adr/0001-rebuild-instead-of-extending-loanready.md | Rebuild from scratch rather than extend LoanReady. |
| adr/0002-nextjs-supabase-stack.md | Next.js 16 + Supabase stack. |
| adr/0003-deterministic-scoring-before-ai.md | Deterministic scoring engine before any AI scoring. |
| adr/0004-workspace-scoped-rls.md | Workspace-scoped RLS with security-definer helpers. |
| adr/0005-risk-colour-token-system.md | Risk-colour tokens bound to score bands. |
| adr/0006-proxy-not-middleware.md | proxy.ts (Next.js 16 middleware rename). |
| adr/0007-cli-managed-supabase-project.md | Separate Supabase account, CLI-managed project. |
| adr/0008-markdown-first-reports.md | Markdown-first report generation. |
| adr/0009-ai-advisory-deterministic-score.md | AI extracts, deterministic rules decide. |
| adr/0010-visual-identity-v2.md | Visual Identity v2 — warm ink/cream system replacing Kredal Navy. |
| adr/0011-platform-admin.md | Platform admin via allowlist + service-role reads behind a guard. |
| adr/0012-deterministic-first-agents.md | Agents 8–10 (bank-match, recovery, compliance) as pure deterministic functions. |