Kredal Docs

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

PagePurpose
tutorials/getting-started.mdClone the repo, set env vars, run the app locally.
tutorials/seed-demo-data.mdPopulate a realistic demo company for testing or a demo.
tutorials/run-tests.mdRun the scoring/report unit tests and typecheck.

How-to — task-oriented runbooks

PagePurpose
how-to/deploy-to-vercel.mdDeploy the app and docs site to Vercel.
how-to/apply-db-migrations.mdApply Supabase schema migrations (CLI-only; MCP cannot see this project).
how-to/rotate-supabase-keys.mdFetch and rotate Supabase keys safely into .env.local.
how-to/verify-rls.mdProve cross-tenant isolation and RLS correctness.
how-to/add-a-scoring-rule.mdAdd a rule to the scoring engine and keep docs + tests in sync.
how-to/add-a-questionnaire-question.mdAdd a question to the readiness questionnaire.
how-to/deploy-docs-rag.mdEnable semantic (pgvector hybrid) search for the docs.
how-to/configure-ai-extraction.mdEnable Gemini document extraction, consistency flags, and narrative drafts.
how-to/grant-platform-admin.mdGive an account access to the /admin area (SQL-only, by design).
how-to/set-up-pilot-payments.mdTurn on Stripe payment links and finish the go-live env steps.

Reference — information-oriented

PagePurpose
reference/architecture.mdSystem context, containers, and request flow (C4 + Mermaid).
reference/database-schema.mdTables, columns, RLS policies, storage (GENERATED from migration SQL).
reference/scoring-engine.mdCategories, weights, every rule and fix, risk bands (GENERATED from engine.ts).
reference/design-tokens.mdColour, type, spacing, and risk-colour tokens.
reference/routes-and-actions.mdRoute tree and server-action inventory.
reference/environment-variables.mdEvery env var, where it is used, and safety rules.

Explanation — understanding-oriented

PagePurpose
explanation/why-kredal.mdThe problem, the thesis, and the wedge.
explanation/domain-glossary.mdUAE SME banking terms: UBO, KYC, WPS, Ejari, source-of-funds.
explanation/security-model.mdRLS design, roles, private storage, signed URLs, audit log.

ADRs — architecture decision records

PageDecision
adr/0001-rebuild-instead-of-extending-loanready.mdRebuild from scratch rather than extend LoanReady.
adr/0002-nextjs-supabase-stack.mdNext.js 16 + Supabase stack.
adr/0003-deterministic-scoring-before-ai.mdDeterministic scoring engine before any AI scoring.
adr/0004-workspace-scoped-rls.mdWorkspace-scoped RLS with security-definer helpers.
adr/0005-risk-colour-token-system.mdRisk-colour tokens bound to score bands.
adr/0006-proxy-not-middleware.mdproxy.ts (Next.js 16 middleware rename).
adr/0007-cli-managed-supabase-project.mdSeparate Supabase account, CLI-managed project.
adr/0008-markdown-first-reports.mdMarkdown-first report generation.
adr/0009-ai-advisory-deterministic-score.mdAI extracts, deterministic rules decide.
adr/0010-visual-identity-v2.mdVisual Identity v2 — warm ink/cream system replacing Kredal Navy.
adr/0011-platform-admin.mdPlatform admin via allowlist + service-role reads behind a guard.
adr/0012-deterministic-first-agents.mdAgents 8–10 (bank-match, recovery, compliance) as pure deterministic functions.

On this page