# deven037/crm-practice architecture

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

- Interactive diagram: https://gitdiagram.com/deven037/crm-practice
- Repository: https://github.com/deven037/crm-practice

## Overview

Practice CRM is a web CRM backed by a standalone REST API, with a companion React Native app. The main workflow is sign in, use a business module to create or update records, and view the resulting records in the CRM; the web client initializes its data cache after authentication. Major branches include administration and configuration, automation/analysis, and mobile task management. The README documents the API and analysis integrations; source excerpts directly show only selected client, task, and server interactions, so other links are documented rather than inferred from names.

Main entry points: [`server/src/index.ts`](https://github.com/deven037/crm-practice/blob/main/server/src/index.ts) (REST service), [`src/App.tsx`](https://github.com/deven037/crm-practice/blob/main/src/App.tsx) (Web application), [`src/auth/AuthContext.tsx`](https://github.com/deven037/crm-practice/blob/main/src/auth/AuthContext.tsx) (Web authentication), [`src/pages/DataStudio.tsx`](https://github.com/deven037/crm-practice/blob/main/src/pages/DataStudio.tsx) (Data Studio)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web CRM"]
  node_webapp["Web application<br/>[App.tsx]"]
  node_web_auth["Web authentication<br/>[AuthContext.tsx]"]
  node_web_store[("Record cache<br/>[store.ts]")]
  node_web_fetch["API fetch client<br/>[apiFetch.ts]"]
  node_sales["Sales records<br/>[Leads.tsx]"]
  node_lead_form["Lead conversion<br/>[LeadForm.tsx]"]
  node_account["Accounts and contacts<br/>[AccountDetail.tsx]"]
  node_campaign["Campaign management<br/>[CampaignDetail.tsx]"]
  node_products["Product catalog<br/>[ProductDetail.tsx]"]
  node_deals_quotes["Deals and quotes<br/>[Deals.tsx]"]
  node_tasks_tickets["Tasks and tickets<br/>[Tasks.tsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.tsx]"]
  node_admin["Admin configuration<br/>[ObjectConfig.tsx]"]
  node_data_studio["Data Studio<br/>[DataStudio.tsx]"]
end

subgraph group_api["REST API"]
  node_api_service["REST service<br/>[index.ts]"]
  node_api_auth["API authentication<br/>[auth.ts]"]
  node_api_crud["Business endpoints<br/>[crud.ts]"]
  node_api_tasks["Task endpoints<br/>[tasks.ts]"]
  node_api_db[("Record database<br/>[db.ts]")]
end

subgraph group_mobile["Mobile CRM"]
  node_mobile_app["Mobile application<br/>[App.tsx]"]
  node_mobile_auth["Mobile authentication<br/>[AuthContext.tsx]"]
  node_mobile_tasks["Task screen<br/>[TasksScreen.tsx]"]
  node_mobile_hooks["Task API hooks<br/>[useTasks.ts]"]
  node_mobile_client["Mobile API client<br/>[client.ts]"]
  node_mobile_store[("Secure token storage<br/>[storage.ts]")]
end

subgraph group_analysis["Data Analysis"]
  node_python_bridge["Python bridge<br/>[server.py]"]
  node_python_runner["Python analysis"]
  node_hosted_runner["Hosted workflow"]
end

node_user(("CRM user"))
node_github{{"GitHub Actions"}}

node_user -->|"uses"| node_webapp
node_webapp -->|"provides auth"| node_web_auth
node_webapp -->|"routes to"| node_sales
node_webapp -->|"routes to"| node_lead_form
node_webapp -->|"routes to"| node_account
node_webapp -->|"routes to"| node_tasks_tickets
node_webapp -->|"routes to"| node_admin
node_webapp -->|"routes to"| node_data_studio
node_web_auth -->|"authenticates via"| node_web_fetch
node_web_auth -->|"initializes"| node_web_store
node_web_store -->|"fetches records"| node_web_fetch
node_web_fetch -->|"calls REST API"| node_api_service
node_sales -->|"manages leads"| node_api_service
node_lead_form -->|"converts leads"| node_sales
node_account -->|"manages records"| node_api_service
node_campaign -->|"manages campaigns"| node_api_service
node_products -->|"manages products"| node_api_service
node_deals_quotes -->|"manages deals"| node_api_service
node_tasks_tickets -->|"manages tasks"| node_api_service
node_dashboard -->|"reads CRM data"| node_api_service
node_admin -->|"configures CRM"| node_api_service
node_data_studio -->|"dispatches extracts"| node_python_bridge
node_data_studio -->|"dispatches analysis"| node_hosted_runner
node_hosted_runner -->|"runs workflow"| node_github
node_api_service -->|"handles login"| node_api_auth
node_api_service -->|"serves endpoints"| node_api_crud
node_api_service -->|"routes tasks"| node_api_tasks
node_api_tasks -->|"reads and writes"| node_api_db
node_user -->|"uses"| node_mobile_app
node_mobile_app -->|"provides auth"| node_mobile_auth
node_mobile_app -.->|"navigates to"| node_mobile_tasks
node_mobile_tasks -->|"uses task hooks"| node_mobile_hooks
node_mobile_hooks -->|"sends requests"| node_mobile_client
node_mobile_client -->|"reads token"| node_mobile_store
node_mobile_client -->|"calls REST API"| node_api_service
node_python_bridge -->|"runs script"| node_python_runner

click node_webapp "https://github.com/deven037/crm-practice/blob/main/src/App.tsx"
click node_web_auth "https://github.com/deven037/crm-practice/blob/main/src/auth/AuthContext.tsx"
click node_web_store "https://github.com/deven037/crm-practice/blob/main/src/data/store.ts"
click node_web_fetch "https://github.com/deven037/crm-practice/blob/main/src/data/apiFetch.ts"
click node_sales "https://github.com/deven037/crm-practice/blob/main/src/pages/Leads.tsx"
click node_lead_form "https://github.com/deven037/crm-practice/blob/main/src/pages/LeadForm.tsx"
click node_account "https://github.com/deven037/crm-practice/blob/main/src/pages/AccountDetail.tsx"
click node_campaign "https://github.com/deven037/crm-practice/blob/main/src/pages/CampaignDetail.tsx"
click node_products "https://github.com/deven037/crm-practice/blob/main/src/pages/ProductDetail.tsx"
click node_deals_quotes "https://github.com/deven037/crm-practice/blob/main/src/pages/Deals.tsx"
click node_tasks_tickets "https://github.com/deven037/crm-practice/blob/main/src/pages/Tasks.tsx"
click node_dashboard "https://github.com/deven037/crm-practice/blob/main/src/pages/Dashboard.tsx"
click node_admin "https://github.com/deven037/crm-practice/blob/main/src/pages/ObjectConfig.tsx"
click node_data_studio "https://github.com/deven037/crm-practice/blob/main/src/pages/DataStudio.tsx"
click node_api_service "https://github.com/deven037/crm-practice/blob/main/server/src/index.ts"
click node_api_auth "https://github.com/deven037/crm-practice/blob/main/server/src/routes/auth.ts"
click node_api_crud "https://github.com/deven037/crm-practice/blob/main/server/src/routes/crud.ts"
click node_api_tasks "https://github.com/deven037/crm-practice/blob/main/server/src/routes/tasks.ts"
click node_api_db "https://github.com/deven037/crm-practice/blob/main/server/src/db.ts"
click node_mobile_app "https://github.com/deven037/crm-practice/blob/main/mobile/App.tsx"
click node_mobile_auth "https://github.com/deven037/crm-practice/blob/main/mobile/src/auth/AuthContext.tsx"
click node_mobile_tasks "https://github.com/deven037/crm-practice/blob/main/mobile/src/screens/TasksScreen.tsx"
click node_mobile_hooks "https://github.com/deven037/crm-practice/blob/main/mobile/src/api/hooks/useTasks.ts"
click node_mobile_client "https://github.com/deven037/crm-practice/blob/main/mobile/src/api/client.ts"
click node_mobile_store "https://github.com/deven037/crm-practice/blob/main/mobile/src/auth/storage.ts"
click node_python_bridge "https://github.com/deven037/crm-practice/blob/main/python_bridge/server.py"
click node_python_runner "https://github.com/deven037/crm-practice/blob/main/python_bridge/analysis_template.py"

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_web_auth,node_web_store,node_web_fetch,node_sales,node_lead_form,node_account,node_campaign,node_products,node_deals_quotes,node_tasks_tickets,node_dashboard,node_admin,node_data_studio,node_user toneBlue
class node_api_service,node_api_auth,node_api_crud,node_api_tasks,node_api_db toneAmber
class node_mobile_app,node_mobile_auth,node_mobile_tasks,node_mobile_hooks,node_mobile_client,node_mobile_store toneMint
class node_python_bridge,node_python_runner,node_hosted_runner toneRose
class node_github toneIndigo
```

## Components

### Web CRM

- [Web application](https://github.com/deven037/crm-practice/blob/main/src/App.tsx): `src/App.tsx`
- [Web authentication](https://github.com/deven037/crm-practice/blob/main/src/auth/AuthContext.tsx): `src/auth/AuthContext.tsx`
- [Record cache](https://github.com/deven037/crm-practice/blob/main/src/data/store.ts): `src/data/store.ts`
- [API fetch client](https://github.com/deven037/crm-practice/blob/main/src/data/apiFetch.ts): `src/data/apiFetch.ts`
- [Sales records](https://github.com/deven037/crm-practice/blob/main/src/pages/Leads.tsx): `src/pages/Leads.tsx`
- [Lead conversion](https://github.com/deven037/crm-practice/blob/main/src/pages/LeadForm.tsx): `src/pages/LeadForm.tsx`
- [Accounts and contacts](https://github.com/deven037/crm-practice/blob/main/src/pages/AccountDetail.tsx): `src/pages/AccountDetail.tsx`
- [Campaign management](https://github.com/deven037/crm-practice/blob/main/src/pages/CampaignDetail.tsx): `src/pages/CampaignDetail.tsx`
- [Product catalog](https://github.com/deven037/crm-practice/blob/main/src/pages/ProductDetail.tsx): `src/pages/ProductDetail.tsx`
- [Deals and quotes](https://github.com/deven037/crm-practice/blob/main/src/pages/Deals.tsx): `src/pages/Deals.tsx`
- [Tasks and tickets](https://github.com/deven037/crm-practice/blob/main/src/pages/Tasks.tsx): `src/pages/Tasks.tsx`
- [Dashboard](https://github.com/deven037/crm-practice/blob/main/src/pages/Dashboard.tsx): `src/pages/Dashboard.tsx`
- [Admin configuration](https://github.com/deven037/crm-practice/blob/main/src/pages/ObjectConfig.tsx): `src/pages/ObjectConfig.tsx`
- [Data Studio](https://github.com/deven037/crm-practice/blob/main/src/pages/DataStudio.tsx): `src/pages/DataStudio.tsx`

### REST API

- [REST service](https://github.com/deven037/crm-practice/blob/main/server/src/index.ts): `server/src/index.ts`
- [API authentication](https://github.com/deven037/crm-practice/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [Business endpoints](https://github.com/deven037/crm-practice/blob/main/server/src/routes/crud.ts): `server/src/routes/crud.ts`
- [Task endpoints](https://github.com/deven037/crm-practice/blob/main/server/src/routes/tasks.ts): `server/src/routes/tasks.ts`
- [Record database](https://github.com/deven037/crm-practice/blob/main/server/src/db.ts): `server/src/db.ts`

### Mobile CRM

- [Mobile application](https://github.com/deven037/crm-practice/blob/main/mobile/App.tsx): `mobile/App.tsx`
- [Mobile authentication](https://github.com/deven037/crm-practice/blob/main/mobile/src/auth/AuthContext.tsx): `mobile/src/auth/AuthContext.tsx`
- [Task screen](https://github.com/deven037/crm-practice/blob/main/mobile/src/screens/TasksScreen.tsx): `mobile/src/screens/TasksScreen.tsx`
- [Task API hooks](https://github.com/deven037/crm-practice/blob/main/mobile/src/api/hooks/useTasks.ts): `mobile/src/api/hooks/useTasks.ts`
- [Mobile API client](https://github.com/deven037/crm-practice/blob/main/mobile/src/api/client.ts): `mobile/src/api/client.ts`
- [Secure token storage](https://github.com/deven037/crm-practice/blob/main/mobile/src/auth/storage.ts): `mobile/src/auth/storage.ts`

### Data Analysis

- [Python bridge](https://github.com/deven037/crm-practice/blob/main/python_bridge/server.py): `python_bridge/server.py`
- [Python analysis](https://github.com/deven037/crm-practice/blob/main/python_bridge/analysis_template.py): `python_bridge/analysis_template.py`
- **Hosted workflow**

### Other components

- **CRM user**
- **GitHub Actions**

## Connections

- CRM user → Web application: uses (evidence: `README.md`)
- Web application → Web authentication: provides auth (evidence: `src/App.tsx`)
- Web application → Sales records: routes to (evidence: `src/App.tsx`)
- Web application → Lead conversion: routes to (evidence: `src/App.tsx`)
- Web application → Accounts and contacts: routes to (evidence: `src/App.tsx`)
- Web application → Tasks and tickets: routes to (evidence: `src/App.tsx`)
- Web application → Admin configuration: routes to (evidence: `src/App.tsx`)
- Web application → Data Studio: routes to (evidence: `src/App.tsx`)
- Web authentication → API fetch client: authenticates via (evidence: `src/auth/AuthContext.tsx`)
- Web authentication → Record cache: initializes (evidence: `src/auth/AuthContext.tsx`)
- Record cache → API fetch client: fetches records (evidence: `src/data/store.ts`)
- API fetch client → REST service: calls REST API (evidence: `README.md`)
- Sales records → REST service: manages leads (evidence: `README.md`)
- Lead conversion → Sales records: converts leads (evidence: `README.md`)
- Accounts and contacts → REST service: manages records (evidence: `README.md`)
- Campaign management → REST service: manages campaigns (evidence: `README.md`)
- Product catalog → REST service: manages products (evidence: `README.md`)
- Deals and quotes → REST service: manages deals (evidence: `README.md`)
- Tasks and tickets → REST service: manages tasks (evidence: `README.md`)
- Dashboard → REST service: reads CRM data (evidence: `README.md`)
- Admin configuration → REST service: configures CRM (evidence: `README.md`)
- Data Studio → Python bridge: dispatches extracts (evidence: `README.md`)
- Data Studio → Hosted workflow: dispatches analysis (evidence: `README.md`)
- Hosted workflow → GitHub Actions: runs workflow (evidence: `README.md`)
- REST service → API authentication: handles login (evidence: `README.md`)
- REST service → Business endpoints: serves endpoints (evidence: `README.md`)
- REST service → Task endpoints: routes tasks (evidence: `server/src/routes/tasks.ts`)
- Task endpoints → Record database: reads and writes (evidence: `server/src/routes/tasks.ts`)
- CRM user → Mobile application: uses (evidence: `README.md`)
- Mobile application → Mobile authentication: provides auth (evidence: `mobile/App.tsx`)
- Mobile application → Task screen: navigates to
- Task screen → Task API hooks: uses task hooks (evidence: `mobile/src/screens/TasksScreen.tsx`)
- Task API hooks → Mobile API client: sends requests (evidence: `mobile/src/api/hooks/useTasks.ts`)
- Mobile API client → Secure token storage: reads token (evidence: `mobile/src/api/client.ts`)
- Mobile API client → REST service: calls REST API (evidence: `README.md`)
- Python bridge → Python analysis: runs script (evidence: `README.md`)
