# joekaltho/kaltrix-os architecture

> Architecture diagram of the GitHub repository joekaltho/kaltrix-os, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/joekaltho/kaltrix-os
- Repository: https://github.com/joekaltho/kaltrix-os

## Overview

KaltrixOS is a small-business operating platform combining public business discovery and profiles with an owner dashboard for managing listings, customers, bookings, invoices, messages, expenses, and subscriptions. Public visitors can contact businesses and submit or report reviews; owners monitor business performance and trust signals, while plan status gates dashboard features. The graph focuses on these product stages and their Supabase-backed runtime. Several page and integration implementations were not sampled, so those branches are shown only where paths or relationships are supported by the index.

Main entry points: [`src/lib/supabase/client.ts`](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/supabase/client.ts) (Supabase browser access), [`src/app/(dashboard)/dashboard/page.tsx`](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(dashboard)/dashboard/page.tsx) (Owner dashboard), [`src/lib/supabase/service.ts`](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/supabase/service.ts) (Supabase service access), [`src/app/api/reviews/route.ts`](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/reviews/route.ts) (Review submission)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public discovery"]
  node_discover["Discover businesses<br/>[page.tsx]"]
  node_profile["Public business profile<br/>[page.tsx]"]
  node_signup["Account signup<br/>[page.tsx]"]
end

subgraph group_dashboard["Business workspace"]
  node_dashboard["Owner dashboard<br/>[page.tsx]"]
  node_overview["Overview metrics<br/>[OverviewPanel.tsx]"]
  node_pulse["Business pulse"]
  node_listings["Listing management<br/>[ListingsPanel.tsx]"]
  node_bookings["Booking management<br/>[BookingsPanel.tsx]"]
  node_customers["Customer management<br/>[CustomersPanel.tsx]"]
  node_invoices["Invoice management<br/>[InvoicesPanel.tsx]"]
  node_inbox["Business inbox<br/>[InboxPanel.tsx]"]
  node_new_records["Create records"]
end

subgraph group_trust["Trust and engagement"]
  node_review_submit["Review submission<br/>[route.ts]"]
  node_review_report["Review reporting<br/>[route.ts]"]
  node_message_submit["Message submission<br/>[route.ts]"]
  node_trust_score["Trust scoring<br/>[trust-score.ts]"]
end

subgraph group_platform["Plans and payments"]
  node_subscription["Subscription state<br/>[check-plan.ts]"]
  node_upgrade["Plan upgrade<br/>[page.tsx]"]
  node_paystack["Paystack webhook<br/>[route.ts]"]
  node_resend["Email service"]
end

subgraph group_data["Data and access"]
  node_validation["Input validation<br/>[validation.ts]"]
  node_api_guard["API safeguards<br/>[api-guard.ts]"]
  node_browser_db["Supabase browser access<br/>[client.ts]"]
  node_service_db["Supabase service access<br/>[service.ts]"]
  node_supabase[("Supabase")]
end

node_visitor(("Visitor"))
node_owner(("Business owner"))

node_visitor -.->|"browses"| node_discover
node_visitor -.->|"views"| node_profile
node_visitor -->|"submits review"| node_review_submit
node_visitor -->|"reports review"| node_review_report
node_visitor -->|"sends message"| node_message_submit
node_owner -.->|"registers"| node_signup
node_owner -.->|"manages business"| node_dashboard
node_dashboard -->|"renders"| node_overview
node_dashboard -->|"renders"| node_pulse
node_dashboard -->|"renders"| node_listings
node_dashboard -->|"renders"| node_inbox
node_dashboard -->|"uses plan checks"| node_overview
node_overview -->|"uses scoring"| node_trust_score
node_pulse -->|"reads and writes"| node_browser_db
node_listings -->|"reads and writes"| node_browser_db
node_invoices -.->|"loads invoice data"| node_browser_db
node_bookings -.->|"loads booking data"| node_browser_db
node_customers -.->|"loads customer data"| node_browser_db
node_inbox -.->|"loads messages"| node_browser_db
node_new_records -.->|"creates records"| node_browser_db
node_profile -->|"reads business data"| node_browser_db
node_review_submit -->|"validates input"| node_validation
node_review_submit -->|"rate limits"| node_api_guard
node_review_submit -->|"inserts review"| node_service_db
node_review_report -->|"validates input"| node_validation
node_review_report -->|"rate limits"| node_api_guard
node_review_report -->|"submits report"| node_service_db
node_message_submit -->|"validates input"| node_validation
node_message_submit -->|"rate limits"| node_api_guard
node_message_submit -->|"stores message"| node_service_db
node_api_guard -->|"uses client"| node_service_db
node_service_db -.->|"connects"| node_supabase
node_browser_db -.->|"connects"| node_supabase
node_subscription -->|"queries subscription"| node_browser_db
node_dashboard -->|"checks plan"| node_subscription
node_upgrade -.->|"resolves plan"| node_subscription
node_paystack -->|"updates subscription"| node_service_db
node_paystack -->|"uses plan definitions"| node_subscription
node_supabase -.->|"waitlist email flow"| node_resend

click node_discover "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(public)/discover/page.tsx"
click node_profile "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(public)/business/%5Bslug%5D/page.tsx"
click node_signup "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/signup/page.tsx"
click node_dashboard "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(dashboard)/dashboard/page.tsx"
click node_overview "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/OverviewPanel.tsx"
click node_pulse "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/BusinessPulsePanel.tsx"
click node_listings "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/ListingsPanel.tsx"
click node_bookings "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/BookingsPanel.tsx"
click node_customers "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/CustomersPanel.tsx"
click node_invoices "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/InvoicesPanel.tsx"
click node_inbox "https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/InboxPanel.tsx"
click node_new_records "https://github.com/joekaltho/kaltrix-os/tree/main/src/app/(dashboard)/dashboard"
click node_review_submit "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/reviews/route.ts"
click node_review_report "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/review-reports/route.ts"
click node_message_submit "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/messages/route.ts"
click node_trust_score "https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/trust-score.ts"
click node_subscription "https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/check-plan.ts"
click node_upgrade "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(dashboard)/dashboard/upgrade/page.tsx"
click node_paystack "https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/webhooks/paystack/route.ts"
click node_validation "https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/validation.ts"
click node_api_guard "https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/api-guard.ts"
click node_browser_db "https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/supabase/client.ts"
click node_service_db "https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/supabase/service.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_discover,node_profile,node_signup toneBlue
class node_dashboard,node_overview,node_pulse,node_listings,node_bookings,node_customers,node_invoices,node_inbox,node_new_records toneAmber
class node_review_submit,node_review_report,node_message_submit,node_trust_score toneMint
class node_subscription,node_upgrade,node_paystack,node_resend toneRose
class node_validation,node_api_guard,node_browser_db,node_service_db,node_supabase,node_visitor,node_owner toneIndigo
```

## Components

### Public discovery

- [Discover businesses](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(public)/discover/page.tsx): `src/app/(public)/discover/page.tsx`
- [Public business profile](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(public)/business/%5Bslug%5D/page.tsx): `src/app/(public)/business/[slug]/page.tsx`
- [Account signup](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/signup/page.tsx): `src/app/signup/page.tsx`

### Business workspace

- [Owner dashboard](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(dashboard)/dashboard/page.tsx): `src/app/(dashboard)/dashboard/page.tsx`
- [Overview metrics](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/OverviewPanel.tsx): `src/components/dashboard/OverviewPanel.tsx`
- [Business pulse](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/BusinessPulsePanel.tsx): `src/components/BusinessPulsePanel.tsx`
- [Listing management](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/ListingsPanel.tsx): `src/components/ListingsPanel.tsx`
- [Booking management](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/BookingsPanel.tsx): `src/components/dashboard/BookingsPanel.tsx`
- [Customer management](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/CustomersPanel.tsx): `src/components/dashboard/CustomersPanel.tsx`
- [Invoice management](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/InvoicesPanel.tsx): `src/components/dashboard/InvoicesPanel.tsx`
- [Business inbox](https://github.com/joekaltho/kaltrix-os/blob/main/src/components/dashboard/InboxPanel.tsx): `src/components/dashboard/InboxPanel.tsx`
- [Create records](https://github.com/joekaltho/kaltrix-os/tree/main/src/app/(dashboard)/dashboard): `src/app/(dashboard)/dashboard`

### Trust and engagement

- [Review submission](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/reviews/route.ts): `src/app/api/reviews/route.ts`
- [Review reporting](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/review-reports/route.ts): `src/app/api/review-reports/route.ts`
- [Message submission](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/messages/route.ts): `src/app/api/messages/route.ts`
- [Trust scoring](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/trust-score.ts): `src/lib/trust-score.ts`

### Plans and payments

- [Subscription state](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/check-plan.ts): `src/lib/check-plan.ts`
- [Plan upgrade](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/(dashboard)/dashboard/upgrade/page.tsx): `src/app/(dashboard)/dashboard/upgrade/page.tsx`
- [Paystack webhook](https://github.com/joekaltho/kaltrix-os/blob/main/src/app/api/webhooks/paystack/route.ts): `src/app/api/webhooks/paystack/route.ts`
- **Email service**

### Data and access

- [Input validation](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/validation.ts): `src/lib/validation.ts`
- [API safeguards](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/api-guard.ts): `src/lib/api-guard.ts`
- [Supabase browser access](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/supabase/client.ts): `src/lib/supabase/client.ts`
- [Supabase service access](https://github.com/joekaltho/kaltrix-os/blob/main/src/lib/supabase/service.ts): `src/lib/supabase/service.ts`
- **Supabase**

### Other components

- **Visitor**
- **Business owner**

## Connections

- Visitor → Discover businesses: browses
- Visitor → Public business profile: views
- Visitor → Review submission: submits review (evidence: `src/app/api/reviews/route.ts`)
- Visitor → Review reporting: reports review (evidence: `src/app/api/review-reports/route.ts`)
- Visitor → Message submission: sends message (evidence: `src/app/api/messages/route.ts`)
- Business owner → Account signup: registers
- Business owner → Owner dashboard: manages business
- Owner dashboard → Overview metrics: renders (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Owner dashboard → Business pulse: renders (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Owner dashboard → Listing management: renders (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Owner dashboard → Business inbox: renders (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Owner dashboard → Overview metrics: uses plan checks (evidence: `src/components/dashboard/OverviewPanel.tsx`)
- Overview metrics → Trust scoring: uses scoring (evidence: `src/components/dashboard/OverviewPanel.tsx`)
- Business pulse → Supabase browser access: reads and writes (evidence: `src/components/BusinessPulsePanel.tsx`)
- Listing management → Supabase browser access: reads and writes (evidence: `src/components/ListingsPanel.tsx`)
- Invoice management → Supabase browser access: loads invoice data
- Booking management → Supabase browser access: loads booking data
- Customer management → Supabase browser access: loads customer data
- Business inbox → Supabase browser access: loads messages
- Create records → Supabase browser access: creates records (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Public business profile → Supabase browser access: reads business data (evidence: `src/app/(public)/business/[slug]/page.tsx`)
- Review submission → Input validation: validates input (evidence: `src/app/api/reviews/route.ts`)
- Review submission → API safeguards: rate limits (evidence: `src/app/api/reviews/route.ts`)
- Review submission → Supabase service access: inserts review (evidence: `src/app/api/reviews/route.ts`)
- Review reporting → Input validation: validates input (evidence: `src/app/api/review-reports/route.ts`)
- Review reporting → API safeguards: rate limits (evidence: `src/app/api/review-reports/route.ts`)
- Review reporting → Supabase service access: submits report (evidence: `src/app/api/review-reports/route.ts`)
- Message submission → Input validation: validates input (evidence: `src/app/api/messages/route.ts`)
- Message submission → API safeguards: rate limits (evidence: `src/app/api/messages/route.ts`)
- Message submission → Supabase service access: stores message (evidence: `src/app/api/messages/route.ts`)
- API safeguards → Supabase service access: uses client (evidence: `src/lib/api-guard.ts`)
- Supabase service access → Supabase: connects
- Supabase browser access → Supabase: connects
- Subscription state → Supabase browser access: queries subscription (evidence: `src/lib/check-plan.ts`)
- Owner dashboard → Subscription state: checks plan (evidence: `src/app/(dashboard)/dashboard/page.tsx`)
- Plan upgrade → Subscription state: resolves plan
- Paystack webhook → Supabase service access: updates subscription (evidence: `src/app/api/webhooks/paystack/route.ts`)
- Paystack webhook → Subscription state: uses plan definitions (evidence: `src/app/api/webhooks/paystack/route.ts`)
- Supabase → Email service: waitlist email flow
