# infominergroup-develops/ca-automation architecture

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

- Interactive diagram: https://gitdiagram.com/infominergroup-develops/ca-automation
- Repository: https://github.com/infominergroup-develops/ca-automation

## Overview

Infominer is a CA-firm client portal for document exchange, task assignment and review, time tracking, privacy requests, and accounting reports. Clients and staff use role-specific web pages; the server authenticates and authorizes requests, records workflow data, and serves encrypted documents. Its Tally workflow adds a PC agent that sends accounting data for validation and report generation. The tree contains both SQLite and Firestore server implementations; the README describes both deployment options. Some domain routes were not sampled, so their internal links are omitted or grounded in README statements.

Main entry points: [`src/api.ts`](https://github.com/infominergroup-develops/ca-automation/blob/main/src/api.ts) (API client), [`src/App.tsx`](https://github.com/infominergroup-develops/ca-automation/blob/main/src/App.tsx) (Role-based pages), [`src/pages/Reports.tsx`](https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Reports.tsx) (Reports pages), [`server/routes/tasks.ts`](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/tasks.ts) (Task routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Portal interface"]
  node_webapp["Role-based pages<br/>[App.tsx]"]
  node_authui["Session context<br/>[auth.tsx]"]
  node_api["API client<br/>[api.ts]"]
  node_documentsui["Document panel<br/>[DocumentsPanel.tsx]"]
  node_tasksui["Task pages<br/>[Tasks.tsx]"]
  node_clientsui["Client pages<br/>[Clients.tsx]"]
  node_reportsui["Reports pages<br/>[Reports.tsx]"]
end

subgraph group_workflow["Practice workflows"]
  node_authroutes["Sign-in routes<br/>[auth.ts]"]
  node_taskroutes["Task routes<br/>[tasks.ts]"]
  node_fs_taskroutes["Firestore task routes<br/>[tasks.ts]"]
  node_docroutes["Document routes<br/>[documents.ts]"]
  node_privacyroutes["Privacy routes<br/>[privacy.ts]"]
  node_timeroutes["Time routes<br/>[time.ts]"]
  node_audit["Audit trail<br/>[audit.ts]"]
end

subgraph group_platform["Server platform"]
  node_authz["Access control<br/>[authz.ts]"]
  node_sessions["Session security<br/>[session.ts]"]
  node_crypto["Cryptography<br/>[crypto.ts]"]
  node_sqlite[("SQLite persistence<br/>[db.ts]")]
  node_fsapp["Firestore server<br/>[app.ts]"]
  node_fsstore[("Firestore data access<br/>[store.ts]")]
end

subgraph group_accounting["Tally accounting"]
  node_agent["PC sync agent<br/>[index.ts]"]
  node_tallyroutes["Tally API<br/>[tally.ts]"]
  node_ingest["Book ingestion<br/>[ingest.ts]"]
  node_reports["Report generation<br/>[reports.ts]"]
  node_render["PDF and Excel<br/>[render.ts]"]
end

node_clients(("Clients and staff"))
node_tallypc(("Tally installation"))

node_clients -->|"use"| node_webapp
node_webapp -->|"checks identity"| node_authui
node_webapp -->|"routes to"| node_tasksui
node_webapp -->|"routes to"| node_clientsui
node_webapp -->|"routes to"| node_reportsui
node_authui -->|"loads identity"| node_api
node_tasksui -->|"sends requests"| node_api
node_clientsui -->|"sends requests"| node_api
node_reportsui -->|"sends requests"| node_api
node_documentsui -->|"uploads and downloads"| node_api
node_api -->|"calls API"| node_authroutes
node_api -->|"calls API"| node_taskroutes
node_api -->|"calls API"| node_docroutes
node_api -->|"calls API"| node_privacyroutes
node_api -->|"calls API"| node_timeroutes
node_authroutes -->|"manages sessions"| node_sessions
node_sessions -->|"stores session hashes"| node_sqlite
node_sessions -->|"hashes tokens"| node_crypto
node_taskroutes -->|"checks permissions"| node_authz
node_taskroutes -->|"reads and writes"| node_sqlite
node_fsapp -->|"registers routes"| node_fs_taskroutes
node_fs_taskroutes -->|"uses data access"| node_fsstore
node_tallypc -->|"runs agent"| node_agent
node_agent -->|"uploads books"| node_tallyroutes
node_tallyroutes -->|"ingests data"| node_ingest
node_tallyroutes -->|"requests reports"| node_reports
node_reports -.->|"renders outputs"| node_render
node_reportsui -->|"views reports"| node_reports

click node_webapp "https://github.com/infominergroup-develops/ca-automation/blob/main/src/App.tsx"
click node_authui "https://github.com/infominergroup-develops/ca-automation/blob/main/src/auth.tsx"
click node_api "https://github.com/infominergroup-develops/ca-automation/blob/main/src/api.ts"
click node_documentsui "https://github.com/infominergroup-develops/ca-automation/blob/main/src/components/DocumentsPanel.tsx"
click node_tasksui "https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Tasks.tsx"
click node_clientsui "https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Clients.tsx"
click node_reportsui "https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Reports.tsx"
click node_authroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/auth.ts"
click node_taskroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/tasks.ts"
click node_fs_taskroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes-fs/tasks.ts"
click node_docroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/documents.ts"
click node_privacyroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/privacy.ts"
click node_timeroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/time.ts"
click node_audit "https://github.com/infominergroup-develops/ca-automation/blob/main/server/audit.ts"
click node_authz "https://github.com/infominergroup-develops/ca-automation/blob/main/server/authz.ts"
click node_sessions "https://github.com/infominergroup-develops/ca-automation/blob/main/server/security/session.ts"
click node_crypto "https://github.com/infominergroup-develops/ca-automation/blob/main/server/security/crypto.ts"
click node_sqlite "https://github.com/infominergroup-develops/ca-automation/blob/main/server/db.ts"
click node_fsapp "https://github.com/infominergroup-develops/ca-automation/blob/main/server/firestore/app.ts"
click node_fsstore "https://github.com/infominergroup-develops/ca-automation/blob/main/server/firestore/store.ts"
click node_agent "https://github.com/infominergroup-develops/ca-automation/blob/main/agent/src/index.ts"
click node_tallyroutes "https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/tally.ts"
click node_ingest "https://github.com/infominergroup-develops/ca-automation/blob/main/server/tally/ingest.ts"
click node_reports "https://github.com/infominergroup-develops/ca-automation/blob/main/server/tally/reports.ts"
click node_render "https://github.com/infominergroup-develops/ca-automation/blob/main/server/tally/render.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_webapp,node_authui,node_api,node_documentsui,node_tasksui,node_clientsui,node_reportsui,node_clients toneBlue
class node_authroutes,node_taskroutes,node_fs_taskroutes,node_docroutes,node_privacyroutes,node_timeroutes,node_audit toneAmber
class node_authz,node_sessions,node_crypto,node_sqlite,node_fsapp,node_fsstore toneMint
class node_agent,node_tallyroutes,node_ingest,node_reports,node_render toneRose
class node_tallypc toneIndigo
```

## Components

### Portal interface

- [Role-based pages](https://github.com/infominergroup-develops/ca-automation/blob/main/src/App.tsx): `src/App.tsx`
- [Session context](https://github.com/infominergroup-develops/ca-automation/blob/main/src/auth.tsx): `src/auth.tsx`
- [API client](https://github.com/infominergroup-develops/ca-automation/blob/main/src/api.ts): `src/api.ts`
- [Document panel](https://github.com/infominergroup-develops/ca-automation/blob/main/src/components/DocumentsPanel.tsx): `src/components/DocumentsPanel.tsx`
- [Task pages](https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Tasks.tsx): `src/pages/Tasks.tsx`
- [Client pages](https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Clients.tsx): `src/pages/Clients.tsx`
- [Reports pages](https://github.com/infominergroup-develops/ca-automation/blob/main/src/pages/Reports.tsx): `src/pages/Reports.tsx`

### Practice workflows

- [Sign-in routes](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/auth.ts): `server/routes/auth.ts`
- [Task routes](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/tasks.ts): `server/routes/tasks.ts`
- [Firestore task routes](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes-fs/tasks.ts): `server/routes-fs/tasks.ts`
- [Document routes](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/documents.ts): `server/routes/documents.ts`
- [Privacy routes](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/privacy.ts): `server/routes/privacy.ts`
- [Time routes](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/time.ts): `server/routes/time.ts`
- [Audit trail](https://github.com/infominergroup-develops/ca-automation/blob/main/server/audit.ts): `server/audit.ts`

### Server platform

- [Access control](https://github.com/infominergroup-develops/ca-automation/blob/main/server/authz.ts): `server/authz.ts`
- [Session security](https://github.com/infominergroup-develops/ca-automation/blob/main/server/security/session.ts): `server/security/session.ts`
- [Cryptography](https://github.com/infominergroup-develops/ca-automation/blob/main/server/security/crypto.ts): `server/security/crypto.ts`
- [SQLite persistence](https://github.com/infominergroup-develops/ca-automation/blob/main/server/db.ts): `server/db.ts`
- [Firestore server](https://github.com/infominergroup-develops/ca-automation/blob/main/server/firestore/app.ts): `server/firestore/app.ts`
- [Firestore data access](https://github.com/infominergroup-develops/ca-automation/blob/main/server/firestore/store.ts): `server/firestore/store.ts`

### Tally accounting

- [PC sync agent](https://github.com/infominergroup-develops/ca-automation/blob/main/agent/src/index.ts): `agent/src/index.ts`
- [Tally API](https://github.com/infominergroup-develops/ca-automation/blob/main/server/routes/tally.ts): `server/routes/tally.ts`
- [Book ingestion](https://github.com/infominergroup-develops/ca-automation/blob/main/server/tally/ingest.ts): `server/tally/ingest.ts`
- [Report generation](https://github.com/infominergroup-develops/ca-automation/blob/main/server/tally/reports.ts): `server/tally/reports.ts`
- [PDF and Excel](https://github.com/infominergroup-develops/ca-automation/blob/main/server/tally/render.ts): `server/tally/render.ts`

### Other components

- **Clients and staff**
- **Tally installation**

## Connections

- Clients and staff → Role-based pages: use (evidence: `src/App.tsx`)
- Role-based pages → Session context: checks identity (evidence: `src/App.tsx`)
- Role-based pages → Task pages: routes to (evidence: `src/App.tsx`)
- Role-based pages → Client pages: routes to (evidence: `src/App.tsx`)
- Role-based pages → Reports pages: routes to (evidence: `src/App.tsx`)
- Session context → API client: loads identity (evidence: `src/auth.tsx`)
- Task pages → API client: sends requests (evidence: `src/pages/Tasks.tsx`)
- Client pages → API client: sends requests (evidence: `src/pages/Clients.tsx`)
- Reports pages → API client: sends requests (evidence: `src/pages/Reports.tsx`)
- Document panel → API client: uploads and downloads (evidence: `src/components/DocumentsPanel.tsx`)
- API client → Sign-in routes: calls API (evidence: `README.md`)
- API client → Task routes: calls API (evidence: `README.md`)
- API client → Document routes: calls API (evidence: `README.md`)
- API client → Privacy routes: calls API (evidence: `README.md`)
- API client → Time routes: calls API (evidence: `README.md`)
- Sign-in routes → Session security: manages sessions (evidence: `server/routes/auth.ts`)
- Session security → SQLite persistence: stores session hashes (evidence: `server/security/session.ts`)
- Session security → Cryptography: hashes tokens (evidence: `server/security/session.ts`)
- Task routes → Access control: checks permissions (evidence: `server/routes/tasks.ts`)
- Task routes → SQLite persistence: reads and writes (evidence: `server/routes/tasks.ts`)
- Firestore server → Firestore task routes: registers routes (evidence: `server/firestore/app.ts`)
- Firestore task routes → Firestore data access: uses data access (evidence: `server/routes-fs/tasks.ts`)
- Tally installation → PC sync agent: runs agent (evidence: `README.md`)
- PC sync agent → Tally API: uploads books (evidence: `README.md`)
- Tally API → Book ingestion: ingests data (evidence: `server/routes/tally.ts`)
- Tally API → Report generation: requests reports (evidence: `server/routes/tally.ts`)
- Report generation → PDF and Excel: renders outputs
- Reports pages → Report generation: views reports (evidence: `README.md`)
