# asterisksinc/boq-saas architecture

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

- Interactive diagram: https://gitdiagram.com/asterisksinc/boq-saas
- Repository: https://github.com/asterisksinc/boq-saas

## Overview

BOQ SaaS is a web application for managing construction projects, bills of quantities, costs, templates, and related business operations. The visible user workflow runs from dashboard screens through client API helpers to a versioned server API backed by Supabase. Other substantial product areas include activity tracking, billing, support, settings, and integrations. The README provides no feature detail, so capability coverage is based mainly on the source tree and SOURCE INDEX; several subsystem links remain unverified because their implementation was not sampled.

Main entry points: [`app/api/v1/[...path]/route.ts`](https://github.com/asterisksinc/boq-saas/blob/main/app/api/v1/%5B...path%5D/route.ts) (Versioned API), [`lib/api/auth.ts`](https://github.com/asterisksinc/boq-saas/blob/main/lib/api/auth.ts) (Client API helpers), [`app/boqs/page.tsx`](https://github.com/asterisksinc/boq-saas/blob/main/app/boqs/page.tsx) (Bills of quantities), [`app/costs/page.tsx`](https://github.com/asterisksinc/boq-saas/blob/main/app/costs/page.tsx) (Cost workspace)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Product workflows"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_projects["Projects<br/>[page.tsx]"]
end

subgraph group_costing["BOQ and costing"]
  node_boqs["Bills of quantities<br/>[page.tsx]"]
  node_costs["Cost analysis<br/>[AnalysisTab.tsx]"]
  node_costsui["Cost workspace<br/>[page.tsx]"]
  node_templates["Templates<br/>[page.tsx]"]
end

subgraph group_platform["API and data"]
  node_clientapi["Client API helpers<br/>[auth.ts]"]
  node_route["Versioned API<br/>[route.ts]"]
  node_supabase["Supabase server client<br/>[server.ts]"]
  node_costapi["Costing API<br/>[costing.ts]"]
  node_templatesapi["Template API<br/>[templates.ts]"]
  node_settingsadapter["Settings adapter<br/>[adapter.ts]"]
end

subgraph group_workspace["Workspace features"]
  node_activities["Activities<br/>[page.tsx]"]
  node_documents["Documents<br/>[page.tsx]"]
  node_proposals["Proposals<br/>[page.tsx]"]
  node_invoices["Invoices<br/>[page.tsx]"]
  node_billing["Billing<br/>[page.tsx]"]
  node_support["Help and support<br/>[page.tsx]"]
  node_integrations["Integrations<br/>[page.tsx]"]
end

subgraph group_admin["Organization controls"]
  node_settings["Settings<br/>[page.tsx]"]
  node_admin["Administration<br/>[page.tsx]"]
end

node_user(("Workspace user"))

node_user -->|"opens"| node_dashboard
node_user -->|"manages"| node_projects
node_user -->|"creates"| node_boqs
node_dashboard -.->|"loads account data"| node_clientapi
node_activities -->|"loads and updates tasks"| node_clientapi
node_support -->|"loads help content"| node_clientapi
node_settings -->|"updates profile"| node_clientapi
node_billing -->|"loads billing data"| node_clientapi
node_costsui -->|"renders analysis"| node_costs
node_costsui -->|"loads costing data"| node_costapi
node_costs -->|"requests costing data"| node_costapi
node_templates -->|"loads templates"| node_templatesapi
node_clientapi -->|"calls versioned endpoints"| node_route
node_route -->|"creates server client"| node_supabase
node_route -->|"uses settings adapter"| node_settingsadapter
node_route -.->|"serves admin operations"| node_admin
node_projects -.->|"associates project BOQs"| node_boqs
node_templates -.->|"provides BOQ templates"| node_boqs
node_documents -.->|"uses document endpoints"| node_route
node_proposals -.->|"uses proposal endpoints"| node_route
node_invoices -.->|"uses invoice endpoints"| node_route
node_integrations -.->|"uses integration endpoints"| node_route

click node_dashboard "https://github.com/asterisksinc/boq-saas/blob/main/app/dashboard/page.tsx"
click node_projects "https://github.com/asterisksinc/boq-saas/blob/main/app/projects/page.tsx"
click node_boqs "https://github.com/asterisksinc/boq-saas/blob/main/app/boqs/page.tsx"
click node_costs "https://github.com/asterisksinc/boq-saas/blob/main/app/costs/components/AnalysisTab.tsx"
click node_costsui "https://github.com/asterisksinc/boq-saas/blob/main/app/costs/page.tsx"
click node_templates "https://github.com/asterisksinc/boq-saas/blob/main/app/templates/page.tsx"
click node_activities "https://github.com/asterisksinc/boq-saas/blob/main/app/activities/page.tsx"
click node_documents "https://github.com/asterisksinc/boq-saas/blob/main/app/documents/page.tsx"
click node_proposals "https://github.com/asterisksinc/boq-saas/blob/main/app/proposals/page.tsx"
click node_invoices "https://github.com/asterisksinc/boq-saas/blob/main/app/invoices/page.tsx"
click node_billing "https://github.com/asterisksinc/boq-saas/blob/main/app/billing/page.tsx"
click node_support "https://github.com/asterisksinc/boq-saas/blob/main/app/help/page.tsx"
click node_integrations "https://github.com/asterisksinc/boq-saas/blob/main/app/integrations/page.tsx"
click node_settings "https://github.com/asterisksinc/boq-saas/blob/main/app/settings/page.tsx"
click node_admin "https://github.com/asterisksinc/boq-saas/blob/main/app/admin/page.tsx"
click node_clientapi "https://github.com/asterisksinc/boq-saas/blob/main/lib/api/auth.ts"
click node_route "https://github.com/asterisksinc/boq-saas/blob/main/app/api/v1/%5B...path%5D/route.ts"
click node_supabase "https://github.com/asterisksinc/boq-saas/blob/main/lib/supabase/server.ts"
click node_costapi "https://github.com/asterisksinc/boq-saas/blob/main/lib/api/costing.ts"
click node_templatesapi "https://github.com/asterisksinc/boq-saas/blob/main/lib/api/templates.ts"
click node_settingsadapter "https://github.com/asterisksinc/boq-saas/blob/main/lib/settings/adapter.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_dashboard,node_projects,node_user toneBlue
class node_boqs,node_costs,node_costsui,node_templates toneAmber
class node_clientapi,node_route,node_supabase,node_costapi,node_templatesapi,node_settingsadapter toneMint
class node_activities,node_documents,node_proposals,node_invoices,node_billing,node_support,node_integrations toneRose
class node_settings,node_admin toneIndigo
```

## Components

### Product workflows

- [Dashboard](https://github.com/asterisksinc/boq-saas/blob/main/app/dashboard/page.tsx): `app/dashboard/page.tsx`
- [Projects](https://github.com/asterisksinc/boq-saas/blob/main/app/projects/page.tsx): `app/projects/page.tsx`

### BOQ and costing

- [Bills of quantities](https://github.com/asterisksinc/boq-saas/blob/main/app/boqs/page.tsx): `app/boqs/page.tsx`
- [Cost analysis](https://github.com/asterisksinc/boq-saas/blob/main/app/costs/components/AnalysisTab.tsx): `app/costs/components/AnalysisTab.tsx`
- [Cost workspace](https://github.com/asterisksinc/boq-saas/blob/main/app/costs/page.tsx): `app/costs/page.tsx`
- [Templates](https://github.com/asterisksinc/boq-saas/blob/main/app/templates/page.tsx): `app/templates/page.tsx`

### API and data

- [Client API helpers](https://github.com/asterisksinc/boq-saas/blob/main/lib/api/auth.ts): `lib/api/auth.ts`
- [Versioned API](https://github.com/asterisksinc/boq-saas/blob/main/app/api/v1/%5B...path%5D/route.ts): `app/api/v1/[...path]/route.ts`
- [Supabase server client](https://github.com/asterisksinc/boq-saas/blob/main/lib/supabase/server.ts): `lib/supabase/server.ts`
- [Costing API](https://github.com/asterisksinc/boq-saas/blob/main/lib/api/costing.ts): `lib/api/costing.ts`
- [Template API](https://github.com/asterisksinc/boq-saas/blob/main/lib/api/templates.ts): `lib/api/templates.ts`
- [Settings adapter](https://github.com/asterisksinc/boq-saas/blob/main/lib/settings/adapter.ts): `lib/settings/adapter.ts`

### Workspace features

- [Activities](https://github.com/asterisksinc/boq-saas/blob/main/app/activities/page.tsx): `app/activities/page.tsx`
- [Documents](https://github.com/asterisksinc/boq-saas/blob/main/app/documents/page.tsx): `app/documents/page.tsx`
- [Proposals](https://github.com/asterisksinc/boq-saas/blob/main/app/proposals/page.tsx): `app/proposals/page.tsx`
- [Invoices](https://github.com/asterisksinc/boq-saas/blob/main/app/invoices/page.tsx): `app/invoices/page.tsx`
- [Billing](https://github.com/asterisksinc/boq-saas/blob/main/app/billing/page.tsx): `app/billing/page.tsx`
- [Help and support](https://github.com/asterisksinc/boq-saas/blob/main/app/help/page.tsx): `app/help/page.tsx`
- [Integrations](https://github.com/asterisksinc/boq-saas/blob/main/app/integrations/page.tsx): `app/integrations/page.tsx`

### Organization controls

- [Settings](https://github.com/asterisksinc/boq-saas/blob/main/app/settings/page.tsx): `app/settings/page.tsx`
- [Administration](https://github.com/asterisksinc/boq-saas/blob/main/app/admin/page.tsx): `app/admin/page.tsx`

### Other components

- **Workspace user**

## Connections

- Workspace user → Dashboard: opens
- Workspace user → Projects: manages
- Workspace user → Bills of quantities: creates (evidence: `app/boqs/page.tsx`)
- Dashboard → Client API helpers: loads account data (evidence: `app/dashboard/page.tsx`)
- Activities → Client API helpers: loads and updates tasks (evidence: `app/activities/page.tsx`)
- Help and support → Client API helpers: loads help content (evidence: `app/help/page.tsx`)
- Settings → Client API helpers: updates profile (evidence: `app/settings/page.tsx`)
- Billing → Client API helpers: loads billing data (evidence: `app/billing/page.tsx`)
- Cost workspace → Cost analysis: renders analysis (evidence: `app/costs/page.tsx`)
- Cost workspace → Costing API: loads costing data (evidence: `app/costs/page.tsx`)
- Cost analysis → Costing API: requests costing data (evidence: `app/costs/components/AnalysisTab.tsx`)
- Templates → Template API: loads templates (evidence: `app/templates/page.tsx`)
- Client API helpers → Versioned API: calls versioned endpoints (evidence: `lib/api/auth.ts`)
- Versioned API → Supabase server client: creates server client (evidence: `app/api/v1/[...path]/route.ts`)
- Versioned API → Settings adapter: uses settings adapter (evidence: `app/api/v1/[...path]/route.ts`)
- Versioned API → Administration: serves admin operations
- Projects → Bills of quantities: associates project BOQs
- Templates → Bills of quantities: provides BOQ templates
- Documents → Versioned API: uses document endpoints
- Proposals → Versioned API: uses proposal endpoints
- Invoices → Versioned API: uses invoice endpoints
- Integrations → Versioned API: uses integration endpoints
