# eugene234466/zentrio-crm architecture

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

- Interactive diagram: https://gitdiagram.com/eugene234466/zentrio-crm
- Repository: https://github.com/eugene234466/zentrio-crm

## Overview

This is a CRM for managing customer relationships and business operations. Users enter through session-based authentication, then work across client/contact records, leads and pipeline stages, invoices and receipts, team settings, messaging, and reporting. The Flask application registers API routes backed by shared ORM models and permission checks; the React application provides the interface and client-side state. The sampled files show authentication wiring and several backend relationships; other route-to-UI connections are omitted where source evidence was unavailable.

Main entry points: [`backend/app.py`](https://github.com/eugene234466/zentrio-crm/blob/main/backend/app.py) (Flask application), [`backend/models.py`](https://github.com/eugene234466/zentrio-crm/blob/main/backend/models.py) (CRM data models), [`backend/permissions.py`](https://github.com/eugene234466/zentrio-crm/blob/main/backend/permissions.py) (Access control), [`backend/routes/auth.py`](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/auth.py) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_webapp["Application shell<br/>[App.tsx]"]
  node_authstate["Session state<br/>[useAuth.tsx]"]
  node_authclient["Auth API client<br/>[authApi.ts]"]
  node_appstate["CRM state<br/>[useAppState.ts]"]
  node_authui["Authentication UI<br/>[AuthPage.tsx]"]
  node_clientui["Client workspace<br/>[ClientsSection.tsx]"]
  node_settingsui["Settings workspace"]
  node_teamui["Team workspace<br/>[TeamSection.tsx]"]
end

subgraph group_backend["CRM workflows"]
  node_server["Flask application<br/>[app.py]"]
  node_authroutes["Authentication<br/>[auth.py]"]
  node_clientroutes["Clients<br/>[clients.py]"]
  node_contactroutes["Contacts<br/>[contacts.py]"]
  node_leadroutes["Lead management<br/>[leads.py]"]
  node_pipeline["Pipeline stages<br/>[pipeline.py]"]
  node_invoices["Invoices and receipts<br/>[invoices.py]"]
  node_dashboard["Dashboard<br/>[dashboard.py]"]
  node_messages["Message board<br/>[messages.py]"]
  node_settings["Business settings<br/>[all_settings.py]"]
  node_auditlog["Audit history<br/>[audit_log.py]"]
  node_search["Cross-record search<br/>[search.py]"]
  node_notifications["Notifications<br/>[notifications.py]"]
end

subgraph group_platform["Shared platform"]
  node_models["CRM data models<br/>[models.py]"]
  node_permissions["Access control<br/>[permissions.py]"]
  node_audit["Audit writer<br/>[audit.py]"]
  node_extensions["Shared extensions<br/>[extensions.py]"]
end

node_user(("CRM user"))

node_user -->|"uses"| node_webapp
node_webapp -->|"reads session"| node_authstate
node_webapp -->|"loads CRM state"| node_appstate
node_authstate -->|"calls"| node_authclient
node_authui -->|"submits credentials"| node_authstate
node_clientui -.->|"uses state"| node_appstate
node_settingsui -.->|"uses state"| node_appstate
node_teamui -.->|"uses state"| node_appstate
node_authclient -->|"requests auth"| node_authroutes
node_server -->|"registers route"| node_authroutes
node_server -->|"registers route"| node_clientroutes
node_server -->|"registers route"| node_contactroutes
node_server -->|"registers route"| node_leadroutes
node_server -->|"registers route"| node_pipeline
node_server -->|"registers route"| node_invoices
node_server -->|"registers route"| node_dashboard
node_server -->|"registers route"| node_messages
node_server -->|"registers route"| node_settings
node_server -->|"registers route"| node_auditlog
node_server -->|"imports search"| node_search
node_server -->|"initializes schema"| node_models
node_authroutes -->|"reads and writes"| node_models
node_authroutes -->|"checks access"| node_permissions
node_authroutes -->|"records events"| node_audit
node_clientroutes -->|"reads and writes"| node_models
node_clientroutes -->|"checks access"| node_permissions
node_clientroutes -->|"records events"| node_audit
node_contactroutes -->|"uses records"| node_models
node_leadroutes -->|"uses records"| node_models
node_leadroutes -->|"checks access"| node_permissions
node_leadroutes -->|"records events"| node_audit
node_pipeline -->|"updates stages"| node_models
node_pipeline -->|"checks access"| node_permissions
node_invoices -->|"uses records"| node_models
node_invoices -->|"checks access"| node_permissions
node_invoices -->|"records events"| node_audit
node_dashboard -->|"queries records"| node_models
node_dashboard -->|"checks access"| node_permissions
node_messages -->|"uses records"| node_models
node_messages -->|"checks access"| node_permissions
node_messages -->|"records events"| node_audit
node_settings -->|"uses records"| node_models
node_settings -->|"checks access"| node_permissions
node_auditlog -->|"queries entries"| node_models
node_auditlog -->|"checks access"| node_permissions
node_search -->|"searches records"| node_models
node_search -->|"filters results"| node_permissions
node_notifications -->|"uses records"| node_models

click node_webapp "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/App.tsx"
click node_authstate "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/hooks/useAuth.tsx"
click node_authclient "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/components/Login-register/authApi.ts"
click node_appstate "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/hooks/useAppState.ts"
click node_authui "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/AuthPage.tsx"
click node_clientui "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/ClientsSection.tsx"
click node_settingsui "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/SettingsSection.tsx"
click node_teamui "https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/TeamSection.tsx"
click node_server "https://github.com/eugene234466/zentrio-crm/blob/main/backend/app.py"
click node_authroutes "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/auth.py"
click node_clientroutes "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/clients.py"
click node_contactroutes "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/contacts.py"
click node_leadroutes "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/leads.py"
click node_pipeline "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/pipeline.py"
click node_invoices "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/invoices.py"
click node_dashboard "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/dashboard.py"
click node_messages "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/messages.py"
click node_settings "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/all_settings.py"
click node_auditlog "https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/audit_log.py"
click node_search "https://github.com/eugene234466/zentrio-crm/blob/main/backend/search.py"
click node_notifications "https://github.com/eugene234466/zentrio-crm/blob/main/backend/notifications.py"
click node_models "https://github.com/eugene234466/zentrio-crm/blob/main/backend/models.py"
click node_permissions "https://github.com/eugene234466/zentrio-crm/blob/main/backend/permissions.py"
click node_audit "https://github.com/eugene234466/zentrio-crm/blob/main/backend/audit.py"
click node_extensions "https://github.com/eugene234466/zentrio-crm/blob/main/backend/extensions.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_authstate,node_authclient,node_appstate,node_authui,node_clientui,node_settingsui,node_teamui,node_user toneBlue
class node_server,node_authroutes,node_clientroutes,node_contactroutes,node_leadroutes,node_pipeline,node_invoices,node_dashboard,node_messages,node_settings,node_auditlog,node_search,node_notifications toneAmber
class node_models,node_permissions,node_audit,node_extensions toneMint
```

## Components

### Web application

- [Application shell](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session state](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/hooks/useAuth.tsx): `frontend/src/hooks/useAuth.tsx`
- [Auth API client](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/components/Login-register/authApi.ts): `frontend/src/components/Login-register/authApi.ts`
- [CRM state](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/hooks/useAppState.ts): `frontend/src/hooks/useAppState.ts`
- [Authentication UI](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/AuthPage.tsx): `frontend/src/pages/AuthPage.tsx`
- [Client workspace](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/ClientsSection.tsx): `frontend/src/pages/ClientsSection.tsx`
- [Settings workspace](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/SettingsSection.tsx): `frontend/src/pages/SettingsSection.tsx`
- [Team workspace](https://github.com/eugene234466/zentrio-crm/blob/main/frontend/src/pages/TeamSection.tsx): `frontend/src/pages/TeamSection.tsx`

### CRM workflows

- [Flask application](https://github.com/eugene234466/zentrio-crm/blob/main/backend/app.py): `backend/app.py`
- [Authentication](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/auth.py): `backend/routes/auth.py`
- [Clients](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/clients.py): `backend/routes/clients.py`
- [Contacts](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/contacts.py): `backend/routes/contacts.py`
- [Lead management](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/leads.py): `backend/routes/leads.py`
- [Pipeline stages](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/pipeline.py): `backend/routes/pipeline.py`
- [Invoices and receipts](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/invoices.py): `backend/routes/invoices.py`
- [Dashboard](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/dashboard.py): `backend/routes/dashboard.py`
- [Message board](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/messages.py): `backend/routes/messages.py`
- [Business settings](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/all_settings.py): `backend/routes/all_settings.py`
- [Audit history](https://github.com/eugene234466/zentrio-crm/blob/main/backend/routes/audit_log.py): `backend/routes/audit_log.py`
- [Cross-record search](https://github.com/eugene234466/zentrio-crm/blob/main/backend/search.py): `backend/search.py`
- [Notifications](https://github.com/eugene234466/zentrio-crm/blob/main/backend/notifications.py): `backend/notifications.py`

### Shared platform

- [CRM data models](https://github.com/eugene234466/zentrio-crm/blob/main/backend/models.py): `backend/models.py`
- [Access control](https://github.com/eugene234466/zentrio-crm/blob/main/backend/permissions.py): `backend/permissions.py`
- [Audit writer](https://github.com/eugene234466/zentrio-crm/blob/main/backend/audit.py): `backend/audit.py`
- [Shared extensions](https://github.com/eugene234466/zentrio-crm/blob/main/backend/extensions.py): `backend/extensions.py`

### Other components

- **CRM user**

## Connections

- CRM user → Application shell: uses
- Application shell → Session state: reads session (evidence: `frontend/src/App.tsx`)
- Application shell → CRM state: loads CRM state (evidence: `frontend/src/App.tsx`)
- Session state → Auth API client: calls (evidence: `frontend/src/hooks/useAuth.tsx`)
- Authentication UI → Session state: submits credentials
- Client workspace → CRM state: uses state
- Settings workspace → CRM state: uses state
- Team workspace → CRM state: uses state
- Auth API client → Authentication: requests auth (evidence: `frontend/src/components/Login-register/authApi.ts`)
- Flask application → Authentication: registers route (evidence: `backend/app.py`)
- Flask application → Clients: registers route (evidence: `backend/app.py`)
- Flask application → Contacts: registers route (evidence: `backend/app.py`)
- Flask application → Lead management: registers route (evidence: `backend/app.py`)
- Flask application → Pipeline stages: registers route (evidence: `backend/app.py`)
- Flask application → Invoices and receipts: registers route (evidence: `backend/app.py`)
- Flask application → Dashboard: registers route (evidence: `backend/app.py`)
- Flask application → Message board: registers route (evidence: `backend/app.py`)
- Flask application → Business settings: registers route (evidence: `backend/app.py`)
- Flask application → Audit history: registers route (evidence: `backend/app.py`)
- Flask application → Cross-record search: imports search (evidence: `backend/app.py`)
- Flask application → CRM data models: initializes schema (evidence: `backend/app.py`)
- Authentication → CRM data models: reads and writes (evidence: `backend/routes/auth.py`)
- Authentication → Access control: checks access (evidence: `backend/routes/auth.py`)
- Authentication → Audit writer: records events (evidence: `backend/routes/auth.py`)
- Clients → CRM data models: reads and writes (evidence: `backend/routes/clients.py`)
- Clients → Access control: checks access (evidence: `backend/routes/clients.py`)
- Clients → Audit writer: records events (evidence: `backend/routes/clients.py`)
- Contacts → CRM data models: uses records (evidence: `backend/routes/contacts.py`)
- Lead management → CRM data models: uses records (evidence: `backend/routes/leads.py`)
- Lead management → Access control: checks access (evidence: `backend/routes/leads.py`)
- Lead management → Audit writer: records events (evidence: `backend/routes/leads.py`)
- Pipeline stages → CRM data models: updates stages (evidence: `backend/routes/pipeline.py`)
- Pipeline stages → Access control: checks access (evidence: `backend/routes/pipeline.py`)
- Invoices and receipts → CRM data models: uses records (evidence: `backend/routes/invoices.py`)
- Invoices and receipts → Access control: checks access (evidence: `backend/routes/invoices.py`)
- Invoices and receipts → Audit writer: records events (evidence: `backend/routes/invoices.py`)
- Dashboard → CRM data models: queries records (evidence: `backend/routes/dashboard.py`)
- Dashboard → Access control: checks access (evidence: `backend/routes/dashboard.py`)
- Message board → CRM data models: uses records (evidence: `backend/routes/messages.py`)
- Message board → Access control: checks access (evidence: `backend/routes/messages.py`)
- Message board → Audit writer: records events (evidence: `backend/routes/messages.py`)
- Business settings → CRM data models: uses records (evidence: `backend/routes/all_settings.py`)
- Business settings → Access control: checks access (evidence: `backend/routes/all_settings.py`)
- Audit history → CRM data models: queries entries (evidence: `backend/routes/audit_log.py`)
- Audit history → Access control: checks access (evidence: `backend/routes/audit_log.py`)
- Cross-record search → CRM data models: searches records (evidence: `backend/search.py`)
- Cross-record search → Access control: filters results (evidence: `backend/search.py`)
- Notifications → CRM data models: uses records (evidence: `backend/notifications.py`)
