# ophireumtechnology/taxguard architecture

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

- Interactive diagram: https://gitdiagram.com/ophireumtechnology/taxguard
- Repository: https://github.com/ophireumtechnology/taxguard

## Overview

This is a tax/accounting practice platform with public marketing pages, client and staff portals, workflow services, and AI governance. The principal journey is client authentication and identity intake, document/questionnaire collection, staff review and case processing, then tax preparation, approval, and release. The excerpts show key dashboard, API, and tax-engine behavior; many other capabilities are supported by the tree or source index, but their internal calls were not sampled, so those connections are left unverified rather than asserted.

Main entry points: [`src/services/api.ts`](https://github.com/ophireumtechnology/taxguard/blob/main/src/services/api.ts) (API client), [`src/components/portal/AuthenticatedClientDashboard.tsx`](https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/AuthenticatedClientDashboard.tsx) (Client dashboard), [`src/components/workspace`](https://github.com/ophireumtechnology/taxguard/tree/main/src/components/workspace) (Staff work panels), [`src/server/routes/taxEngine.routes.ts`](https://github.com/ophireumtechnology/taxguard/blob/main/src/server/routes/taxEngine.routes.ts) (Tax engine API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Portal experience"]
  node_app["Application routes<br/>[App.tsx]"]
  node_clientdash["Client dashboard"]
  node_clientfeatures["Client services"]
  node_public["Public site"]
end

subgraph group_operations["Practice operations"]
  node_staffdash["Practice manager"]
  node_staffpanels["Staff work panels"]
  node_appointments["Appointments"]
end

subgraph group_domain["Tax workflows"]
  node_intake["Identity intake"]
  node_onboarding["Onboarding services"]
  node_collection["Document collection"]
  node_bookkeeping["Bookkeeping engine"]
  node_taxengine["Tax engine"]
  node_taxroutes["Tax engine API"]
end

subgraph group_platform["Platform services"]
  node_auth["Identity and auth<br/>[AppContext.tsx]"]
  node_api["API client<br/>[api.ts]"]
  node_server["HTTP server<br/>[server.ts]"]
  node_routes["Domain routes"]
  node_storage[("TaxGuard persistence")]
  node_ai["AI governance"]
  node_review["Human proposal review"]
end

node_client(("Client or staff"))

node_client -->|"uses"| node_app
node_app -->|"provides context"| node_auth
node_client -.->|"authenticates"| node_auth
node_auth -->|"requests data"| node_api
node_clientdash -->|"renders"| node_intake
node_clientdash -->|"renders"| node_clientfeatures
node_clientdash -.->|"loads dashboard data"| node_api
node_staffdash -->|"renders"| node_staffpanels
node_staffdash -->|"loads snapshot"| node_api
node_client -.->|"books or attends"| node_appointments
node_appointments -->|"uses service"| node_api
node_api -.->|"sends requests"| node_server
node_server -->|"mounts routes"| node_routes
node_routes -.->|"includes tax routes"| node_taxroutes
node_intake -.->|"submits intake"| node_onboarding
node_onboarding -.->|"advances workflow"| node_collection
node_staffpanels -.->|"reviews documents"| node_collection
node_staffpanels -.->|"supports bookkeeping"| node_bookkeeping
node_taxroutes -.->|"serves tax workflow"| node_taxengine
node_taxroutes -->|"uses store"| node_storage
node_review -->|"uses governance"| node_ai
node_client -.->|"browses"| node_public

click node_app "https://github.com/ophireumtechnology/taxguard/blob/main/src/App.tsx"
click node_auth "https://github.com/ophireumtechnology/taxguard/blob/main/src/context/AppContext.tsx"
click node_clientdash "https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/AuthenticatedClientDashboard.tsx"
click node_intake "https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/StageOneIdentityWizard.tsx"
click node_clientfeatures "https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/dashboard/ClientDashboardModule.tsx"
click node_staffdash "https://github.com/ophireumtechnology/taxguard/blob/main/src/components/workspace/PracticeManagerDashboard.tsx"
click node_staffpanels "https://github.com/ophireumtechnology/taxguard/tree/main/src/components/workspace"
click node_appointments "https://github.com/ophireumtechnology/taxguard/blob/main/src/components/appointments/AppointmentsPanel.tsx"
click node_api "https://github.com/ophireumtechnology/taxguard/blob/main/src/services/api.ts"
click node_server "https://github.com/ophireumtechnology/taxguard/blob/main/server.ts"
click node_routes "https://github.com/ophireumtechnology/taxguard/tree/main/src/server/routes"
click node_onboarding "https://github.com/ophireumtechnology/taxguard/blob/main/src/services/stageOneOnboardingService.ts"
click node_collection "https://github.com/ophireumtechnology/taxguard/blob/main/src/services/stageTwoMatchingEngine.ts"
click node_bookkeeping "https://github.com/ophireumtechnology/taxguard/blob/main/src/server/taxguard/bookkeeping/bookkeeping.engine.ts"
click node_taxengine "https://github.com/ophireumtechnology/taxguard/blob/main/src/services/taxEngineService.ts"
click node_taxroutes "https://github.com/ophireumtechnology/taxguard/blob/main/src/server/routes/taxEngine.routes.ts"
click node_storage "https://github.com/ophireumtechnology/taxguard/blob/main/src/taxguard/services/TaxGuardStorageService.ts"
click node_ai "https://github.com/ophireumtechnology/taxguard/tree/main/src/server/ai"
click node_review "https://github.com/ophireumtechnology/taxguard/blob/main/src/server/ai/review/HumanProposalReviewService.ts"
click node_public "https://github.com/ophireumtechnology/taxguard/tree/main/src/components/public"

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_app,node_clientdash,node_clientfeatures,node_public,node_client toneBlue
class node_staffdash,node_staffpanels,node_appointments toneAmber
class node_intake,node_onboarding,node_collection,node_bookkeeping,node_taxengine,node_taxroutes toneMint
class node_auth,node_api,node_server,node_routes,node_storage,node_ai,node_review toneRose
```

## Components

### Portal experience

- [Application routes](https://github.com/ophireumtechnology/taxguard/blob/main/src/App.tsx): `src/App.tsx`
- [Client dashboard](https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/AuthenticatedClientDashboard.tsx): `src/components/portal/AuthenticatedClientDashboard.tsx`
- [Client services](https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/dashboard/ClientDashboardModule.tsx): `src/components/portal/dashboard/ClientDashboardModule.tsx`
- [Public site](https://github.com/ophireumtechnology/taxguard/tree/main/src/components/public): `src/components/public`

### Practice operations

- [Practice manager](https://github.com/ophireumtechnology/taxguard/blob/main/src/components/workspace/PracticeManagerDashboard.tsx): `src/components/workspace/PracticeManagerDashboard.tsx`
- [Staff work panels](https://github.com/ophireumtechnology/taxguard/tree/main/src/components/workspace): `src/components/workspace`
- [Appointments](https://github.com/ophireumtechnology/taxguard/blob/main/src/components/appointments/AppointmentsPanel.tsx): `src/components/appointments/AppointmentsPanel.tsx`

### Tax workflows

- [Identity intake](https://github.com/ophireumtechnology/taxguard/blob/main/src/components/portal/StageOneIdentityWizard.tsx): `src/components/portal/StageOneIdentityWizard.tsx`
- [Onboarding services](https://github.com/ophireumtechnology/taxguard/blob/main/src/services/stageOneOnboardingService.ts): `src/services/stageOneOnboardingService.ts`
- [Document collection](https://github.com/ophireumtechnology/taxguard/blob/main/src/services/stageTwoMatchingEngine.ts): `src/services/stageTwoMatchingEngine.ts`
- [Bookkeeping engine](https://github.com/ophireumtechnology/taxguard/blob/main/src/server/taxguard/bookkeeping/bookkeeping.engine.ts): `src/server/taxguard/bookkeeping/bookkeeping.engine.ts`
- [Tax engine](https://github.com/ophireumtechnology/taxguard/blob/main/src/services/taxEngineService.ts): `src/services/taxEngineService.ts`
- [Tax engine API](https://github.com/ophireumtechnology/taxguard/blob/main/src/server/routes/taxEngine.routes.ts): `src/server/routes/taxEngine.routes.ts`

### Platform services

- [Identity and auth](https://github.com/ophireumtechnology/taxguard/blob/main/src/context/AppContext.tsx): `src/context/AppContext.tsx`
- [API client](https://github.com/ophireumtechnology/taxguard/blob/main/src/services/api.ts): `src/services/api.ts`
- [HTTP server](https://github.com/ophireumtechnology/taxguard/blob/main/server.ts): `server.ts`
- [Domain routes](https://github.com/ophireumtechnology/taxguard/tree/main/src/server/routes): `src/server/routes`
- [TaxGuard persistence](https://github.com/ophireumtechnology/taxguard/blob/main/src/taxguard/services/TaxGuardStorageService.ts): `src/taxguard/services/TaxGuardStorageService.ts`
- [AI governance](https://github.com/ophireumtechnology/taxguard/tree/main/src/server/ai): `src/server/ai`
- [Human proposal review](https://github.com/ophireumtechnology/taxguard/blob/main/src/server/ai/review/HumanProposalReviewService.ts): `src/server/ai/review/HumanProposalReviewService.ts`

### Other components

- **Client or staff**

## Connections

- Client or staff → Application routes: uses (evidence: `src/App.tsx`)
- Application routes → Identity and auth: provides context (evidence: `src/App.tsx`)
- Client or staff → Identity and auth: authenticates
- Identity and auth → API client: requests data (evidence: `src/context/AppContext.tsx`)
- Client dashboard → Identity intake: renders (evidence: `src/components/portal/AuthenticatedClientDashboard.tsx`)
- Client dashboard → Client services: renders (evidence: `src/components/portal/AuthenticatedClientDashboard.tsx`)
- Client dashboard → API client: loads dashboard data (evidence: `src/components/portal/AuthenticatedClientDashboard.tsx`)
- Practice manager → Staff work panels: renders (evidence: `src/components/workspace/PracticeManagerDashboard.tsx`)
- Practice manager → API client: loads snapshot
- Client or staff → Appointments: books or attends
- Appointments → API client: uses service (evidence: `src/components/appointments/AppointmentsPanel.tsx`)
- API client → HTTP server: sends requests
- HTTP server → Domain routes: mounts routes (evidence: `server.ts`)
- Domain routes → Tax engine API: includes tax routes
- Identity intake → Onboarding services: submits intake
- Onboarding services → Document collection: advances workflow
- Staff work panels → Document collection: reviews documents
- Staff work panels → Bookkeeping engine: supports bookkeeping
- Tax engine API → Tax engine: serves tax workflow
- Tax engine API → TaxGuard persistence: uses store (evidence: `src/server/routes/taxEngine.routes.ts`)
- Human proposal review → AI governance: uses governance (evidence: `src/server/ai/review/HumanProposalReviewService.ts`)
- Client or staff → Public site: browses
