# vvvvvversion/tax-system architecture

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

- Interactive diagram: https://gitdiagram.com/vvvvvversion/tax-system
- Repository: https://github.com/vvvvvversion/tax-system

## Overview

智税通 is a browser-based enterprise tax-compliance management demo. Its main user journey is to sign in, open a tax filing, select a report, prefill and review data, validate it, then simulate submission and receipt. Separate modules cover invoice lifecycle management, compliance review, four-flow matching, policy services, risk monitoring, notifications, and settings. The architecture is a React UI backed by role/company context and browser-local storage. README capabilities are included; some page internals were not sampled, so their undocumented data connections are omitted.

Main entry points: [`src/App.tsx`](https://github.com/vvvvvversion/tax-system/blob/main/src/App.tsx) (Route shell), [`src/utils/database.ts`](https://github.com/vvvvvversion/tax-system/blob/main/src/utils/database.ts) (IndexedDB), [`src/utils/importExport.ts`](https://github.com/vvvvvversion/tax-system/blob/main/src/utils/importExport.ts) (Import and export), [`src/pages/AutoFiling.tsx`](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/AutoFiling.tsx) (Tax filing flow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and access"]
  node_app["Route shell<br/>[App.tsx]"]
  node_login["Sign-in<br/>[Login.tsx]"]
  node_layout["Workspace layout<br/>[MainLayout.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_settings["System settings<br/>[Settings.tsx]"]
  node_notifications["Notification center"]
end

subgraph group_filing["Tax filing"]
  node_filing["Tax filing flow<br/>[AutoFiling.tsx]"]
  node_formtable["Tax form editor<br/>[FormTable.tsx]"]
  node_taxservice["Filing records<br/>[taxFormService.ts]"]
end

subgraph group_operations["Finance operations"]
  node_invoice["Invoice management"]
  node_invoiceservice["Invoice records<br/>[invoiceService.ts]"]
  node_multiflow["Four-flow matching"]
  node_contractservice["Contract records<br/>[contractService.ts]"]
  node_transactionservice["Transaction records"]
end

subgraph group_insights["Compliance and insights"]
  node_compliance["Compliance review"]
  node_risk["Risk center<br/>[RiskCenter.tsx]"]
  node_policy["Policy services<br/>[PolicyService.tsx]"]
  node_policyservice["Policy records<br/>[policyService.ts]"]
end

subgraph group_platform["Shared services"]
  node_auth["Identity and RBAC<br/>[AuthContext.tsx]"]
  node_notificationservice["Notification store"]
  node_importexport["Import and export<br/>[importExport.ts]"]
  node_localdb[("IndexedDB<br/>[database.ts]")]
  node_recordtypes["Domain records<br/>[database.ts]"]
end

node_user(("Enterprise user"))

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_login
node_app -->|"renders"| node_layout
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_filing
node_app -->|"routes to"| node_invoice
node_app -->|"routes to"| node_compliance
node_app -->|"routes to"| node_multiflow
node_app -->|"routes to"| node_policy
node_app -->|"routes to"| node_risk
node_app -->|"routes to"| node_settings
node_app -->|"routes to"| node_notifications
node_login -->|"authenticates via"| node_auth
node_app -->|"checks access"| node_auth
node_layout -->|"reads permissions"| node_auth
node_layout -->|"loads alerts"| node_notificationservice
node_filing -->|"renders editor"| node_formtable
node_filing -->|"uses filing records"| node_taxservice
node_filing -->|"checks permissions"| node_auth
node_invoice -->|"manages invoices"| node_invoiceservice
node_invoice -->|"imports and exports"| node_importexport
node_multiflow -->|"exports reports"| node_importexport
node_compliance -->|"exports reports"| node_importexport
node_policy -->|"exports data"| node_importexport
node_risk -->|"exports reports"| node_importexport
node_notifications -->|"manages alerts"| node_notificationservice
node_invoiceservice -->|"reads and writes"| node_localdb
node_taxservice -->|"reads and writes"| node_localdb
node_contractservice -->|"reads and writes"| node_localdb
node_transactionservice -->|"reads and writes"| node_localdb
node_policyservice -->|"reads and writes"| node_localdb
node_invoiceservice -->|"uses record types"| node_recordtypes
node_localdb -->|"stores records"| node_recordtypes

click node_app "https://github.com/vvvvvversion/tax-system/blob/main/src/App.tsx"
click node_login "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/Login.tsx"
click node_layout "https://github.com/vvvvvversion/tax-system/blob/main/src/components/Layout/MainLayout.tsx"
click node_auth "https://github.com/vvvvvversion/tax-system/blob/main/src/contexts/AuthContext.tsx"
click node_dashboard "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/Dashboard.tsx"
click node_filing "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/AutoFiling.tsx"
click node_formtable "https://github.com/vvvvvversion/tax-system/blob/main/src/components/TaxForms/FormTable.tsx"
click node_taxservice "https://github.com/vvvvvversion/tax-system/blob/main/src/services/taxFormService.ts"
click node_invoice "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/InvoiceManagement.tsx"
click node_invoiceservice "https://github.com/vvvvvversion/tax-system/blob/main/src/services/invoiceService.ts"
click node_multiflow "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/MultiFlowCompare.tsx"
click node_contractservice "https://github.com/vvvvvversion/tax-system/blob/main/src/services/contractService.ts"
click node_transactionservice "https://github.com/vvvvvversion/tax-system/blob/main/src/services/transactionService.ts"
click node_compliance "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/ComplianceReview.tsx"
click node_risk "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/RiskCenter.tsx"
click node_policy "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/PolicyService.tsx"
click node_policyservice "https://github.com/vvvvvversion/tax-system/blob/main/src/services/policyService.ts"
click node_settings "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/Settings.tsx"
click node_notifications "https://github.com/vvvvvversion/tax-system/blob/main/src/pages/NotificationCenter.tsx"
click node_notificationservice "https://github.com/vvvvvversion/tax-system/blob/main/src/services/notificationService.ts"
click node_importexport "https://github.com/vvvvvversion/tax-system/blob/main/src/utils/importExport.ts"
click node_localdb "https://github.com/vvvvvversion/tax-system/blob/main/src/utils/database.ts"
click node_recordtypes "https://github.com/vvvvvversion/tax-system/blob/main/src/types/database.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_app,node_login,node_layout,node_dashboard,node_settings,node_notifications,node_user toneBlue
class node_filing,node_formtable,node_taxservice toneAmber
class node_invoice,node_invoiceservice,node_multiflow,node_contractservice,node_transactionservice toneMint
class node_compliance,node_risk,node_policy,node_policyservice toneRose
class node_auth,node_notificationservice,node_importexport,node_localdb,node_recordtypes toneIndigo
```

## Components

### App and access

- [Route shell](https://github.com/vvvvvversion/tax-system/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/Login.tsx): `src/pages/Login.tsx`
- [Workspace layout](https://github.com/vvvvvversion/tax-system/blob/main/src/components/Layout/MainLayout.tsx): `src/components/Layout/MainLayout.tsx`
- [Dashboard](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [System settings](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/Settings.tsx): `src/pages/Settings.tsx`
- [Notification center](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/NotificationCenter.tsx): `src/pages/NotificationCenter.tsx`

### Tax filing

- [Tax filing flow](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/AutoFiling.tsx): `src/pages/AutoFiling.tsx`
- [Tax form editor](https://github.com/vvvvvversion/tax-system/blob/main/src/components/TaxForms/FormTable.tsx): `src/components/TaxForms/FormTable.tsx`
- [Filing records](https://github.com/vvvvvversion/tax-system/blob/main/src/services/taxFormService.ts): `src/services/taxFormService.ts`

### Finance operations

- [Invoice management](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/InvoiceManagement.tsx): `src/pages/InvoiceManagement.tsx`
- [Invoice records](https://github.com/vvvvvversion/tax-system/blob/main/src/services/invoiceService.ts): `src/services/invoiceService.ts`
- [Four-flow matching](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/MultiFlowCompare.tsx): `src/pages/MultiFlowCompare.tsx`
- [Contract records](https://github.com/vvvvvversion/tax-system/blob/main/src/services/contractService.ts): `src/services/contractService.ts`
- [Transaction records](https://github.com/vvvvvversion/tax-system/blob/main/src/services/transactionService.ts): `src/services/transactionService.ts`

### Compliance and insights

- [Compliance review](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/ComplianceReview.tsx): `src/pages/ComplianceReview.tsx`
- [Risk center](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/RiskCenter.tsx): `src/pages/RiskCenter.tsx`
- [Policy services](https://github.com/vvvvvversion/tax-system/blob/main/src/pages/PolicyService.tsx): `src/pages/PolicyService.tsx`
- [Policy records](https://github.com/vvvvvversion/tax-system/blob/main/src/services/policyService.ts): `src/services/policyService.ts`

### Shared services

- [Identity and RBAC](https://github.com/vvvvvversion/tax-system/blob/main/src/contexts/AuthContext.tsx): `src/contexts/AuthContext.tsx`
- [Notification store](https://github.com/vvvvvversion/tax-system/blob/main/src/services/notificationService.ts): `src/services/notificationService.ts`
- [Import and export](https://github.com/vvvvvversion/tax-system/blob/main/src/utils/importExport.ts): `src/utils/importExport.ts`
- [IndexedDB](https://github.com/vvvvvversion/tax-system/blob/main/src/utils/database.ts): `src/utils/database.ts`
- [Domain records](https://github.com/vvvvvversion/tax-system/blob/main/src/types/database.ts): `src/types/database.ts`

### Other components

- **Enterprise user**

## Connections

- Enterprise user → Route shell: opens (evidence: `src/App.tsx`)
- Route shell → Sign-in: routes to (evidence: `src/App.tsx`)
- Route shell → Workspace layout: renders (evidence: `src/App.tsx`)
- Route shell → Dashboard: routes to (evidence: `src/App.tsx`)
- Route shell → Tax filing flow: routes to (evidence: `src/App.tsx`)
- Route shell → Invoice management: routes to (evidence: `src/App.tsx`)
- Route shell → Compliance review: routes to (evidence: `src/App.tsx`)
- Route shell → Four-flow matching: routes to (evidence: `src/App.tsx`)
- Route shell → Policy services: routes to (evidence: `src/App.tsx`)
- Route shell → Risk center: routes to (evidence: `src/App.tsx`)
- Route shell → System settings: routes to (evidence: `src/App.tsx`)
- Route shell → Notification center: routes to (evidence: `src/App.tsx`)
- Sign-in → Identity and RBAC: authenticates via (evidence: `src/pages/Login.tsx`)
- Route shell → Identity and RBAC: checks access (evidence: `src/App.tsx`)
- Workspace layout → Identity and RBAC: reads permissions (evidence: `src/components/Layout/MainLayout.tsx`)
- Workspace layout → Notification store: loads alerts (evidence: `src/components/Layout/MainLayout.tsx`)
- Tax filing flow → Tax form editor: renders editor (evidence: `src/pages/AutoFiling.tsx`)
- Tax filing flow → Filing records: uses filing records (evidence: `src/pages/AutoFiling.tsx`)
- Tax filing flow → Identity and RBAC: checks permissions (evidence: `src/pages/AutoFiling.tsx`)
- Invoice management → Invoice records: manages invoices (evidence: `src/pages/InvoiceManagement.tsx`)
- Invoice management → Import and export: imports and exports (evidence: `src/pages/InvoiceManagement.tsx`)
- Four-flow matching → Import and export: exports reports (evidence: `src/pages/MultiFlowCompare.tsx`)
- Compliance review → Import and export: exports reports (evidence: `src/pages/ComplianceReview.tsx`)
- Policy services → Import and export: exports data (evidence: `src/pages/PolicyService.tsx`)
- Risk center → Import and export: exports reports (evidence: `src/pages/RiskCenter.tsx`)
- Notification center → Notification store: manages alerts (evidence: `src/pages/NotificationCenter.tsx`)
- Invoice records → IndexedDB: reads and writes (evidence: `src/services/invoiceService.ts`)
- Filing records → IndexedDB: reads and writes (evidence: `src/services/taxFormService.ts`)
- Contract records → IndexedDB: reads and writes (evidence: `src/services/contractService.ts`)
- Transaction records → IndexedDB: reads and writes (evidence: `src/services/transactionService.ts`)
- Policy records → IndexedDB: reads and writes (evidence: `src/services/policyService.ts`)
- Invoice records → Domain records: uses record types (evidence: `src/services/invoiceService.ts`)
- IndexedDB → Domain records: stores records (evidence: `src/utils/database.ts`)
