# mruzbek00/ccrm architecture

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

- Interactive diagram: https://gitdiagram.com/mruzbek00/ccrm
- Repository: https://github.com/mruzbek00/ccrm

## Overview

CCRM is a Django CRM for language-centre staff. Staff use server-rendered screens and JSON actions to register and manage students, track status and history, assign groups, and archive or restore profiles; branch-scoped access is enforced server-side. Separate admin workflows manage branches, reference options, statuses, and staff accounts, while the dashboard and workbook export provide reporting. The README documents the module boundaries and database flow; sampled source confirms browser requests and delegation, but most feature implementations were not sampled.

Main entry points: [`crm_app/views.py`](https://github.com/mruzbek00/ccrm/blob/main/crm_app/views.py) (Request handlers), [`crm_app/models.py`](https://github.com/mruzbek00/ccrm/blob/main/crm_app/models.py) (Domain models), [`crm_app/static/crm_app/js`](https://github.com/mruzbek00/ccrm/tree/main/crm_app/static/crm_app/js) (Staff browser), [`crm_app/urls.py`](https://github.com/mruzbek00/ccrm/blob/main/crm_app/urls.py) (Route table)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_browser["Staff browser"]
  node_screen_scripts["Screen scripts"]
  node_i18n["Language layer<br/>[i18n.js]"]
  node_routes["Route table<br/>[urls.py]"]
  node_views["Request handlers<br/>[views.py]"]
end

subgraph group_students["Student lifecycle"]
  node_student_services["Student services<br/>[students.py]"]
  node_student_statuses["Status pipeline"]
  node_student_history["History writer<br/>[student_history.py]"]
end

subgraph group_operations["Centre operations"]
  node_groups["Groups and schedules<br/>[groups_admin.py]"]
  node_dashboard["Dashboard metrics<br/>[dashboard.py]"]
  node_exports["Workbook export<br/>[exports.py]"]
end

subgraph group_admin["Administration"]
  node_branches["Branch options<br/>[branches_admin.py]"]
  node_staff_accounts["Staff accounts<br/>[staff_accounts.py]"]
end

subgraph group_storage["Persistence"]
  node_models["Domain models<br/>[models.py]"]
  node_database[("SQLite database<br/>[settings.py]")]
end

node_staff(("Centre staff"))
node_workbook["XLSX download"]

node_staff -->|"uses"| node_browser
node_browser -->|"requests pages and data"| node_routes
node_screen_scripts -->|"fetches JSON and actions"| node_routes
node_i18n -->|"localizes interface"| node_browser
node_routes -->|"dispatches"| node_views
node_views -->|"delegates student work"| node_student_services
node_views -->|"delegates status work"| node_student_statuses
node_views -->|"delegates group work"| node_groups
node_views -->|"delegates metrics"| node_dashboard
node_views -->|"delegates exports"| node_exports
node_views -->|"delegates branch work"| node_branches
node_views -->|"delegates account work"| node_staff_accounts
node_student_services -->|"queries and updates"| node_models
node_student_statuses -->|"maintains statuses"| node_models
node_student_history -->|"writes entries"| node_models
node_groups -->|"queries and updates"| node_models
node_dashboard -->|"reads metrics data"| node_models
node_exports -->|"reads export data"| node_models
node_branches -->|"queries and updates"| node_models
node_staff_accounts -->|"queries and updates"| node_models
node_models -->|"reads and writes"| node_database
node_views -->|"returns download"| node_workbook
node_browser -->|"downloads"| node_workbook

click node_browser "https://github.com/mruzbek00/ccrm/tree/main/crm_app/static/crm_app/js"
click node_screen_scripts "https://github.com/mruzbek00/ccrm/tree/main/crm_app/static/crm_app/js/pages"
click node_i18n "https://github.com/mruzbek00/ccrm/blob/main/crm_app/static/crm_app/js/i18n.js"
click node_routes "https://github.com/mruzbek00/ccrm/blob/main/crm_app/urls.py"
click node_views "https://github.com/mruzbek00/ccrm/blob/main/crm_app/views.py"
click node_student_services "https://github.com/mruzbek00/ccrm/blob/main/crm_app/students.py"
click node_student_statuses "https://github.com/mruzbek00/ccrm/blob/main/crm_app/student_statuses.py"
click node_student_history "https://github.com/mruzbek00/ccrm/blob/main/crm_app/student_history.py"
click node_groups "https://github.com/mruzbek00/ccrm/blob/main/crm_app/groups_admin.py"
click node_dashboard "https://github.com/mruzbek00/ccrm/blob/main/crm_app/dashboard.py"
click node_exports "https://github.com/mruzbek00/ccrm/blob/main/crm_app/exports.py"
click node_branches "https://github.com/mruzbek00/ccrm/blob/main/crm_app/branches_admin.py"
click node_staff_accounts "https://github.com/mruzbek00/ccrm/blob/main/crm_app/staff_accounts.py"
click node_models "https://github.com/mruzbek00/ccrm/blob/main/crm_app/models.py"
click node_database "https://github.com/mruzbek00/ccrm/blob/main/crm_project/settings.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_browser,node_screen_scripts,node_i18n,node_routes,node_views toneBlue
class node_student_services,node_student_statuses,node_student_history toneAmber
class node_groups,node_dashboard,node_exports toneMint
class node_branches,node_staff_accounts toneRose
class node_models,node_database,node_staff,node_workbook toneIndigo
```

## Components

### Web interface

- [Staff browser](https://github.com/mruzbek00/ccrm/tree/main/crm_app/static/crm_app/js): `crm_app/static/crm_app/js`
- [Screen scripts](https://github.com/mruzbek00/ccrm/tree/main/crm_app/static/crm_app/js/pages): `crm_app/static/crm_app/js/pages`
- [Language layer](https://github.com/mruzbek00/ccrm/blob/main/crm_app/static/crm_app/js/i18n.js): `crm_app/static/crm_app/js/i18n.js`
- [Route table](https://github.com/mruzbek00/ccrm/blob/main/crm_app/urls.py): `crm_app/urls.py`
- [Request handlers](https://github.com/mruzbek00/ccrm/blob/main/crm_app/views.py): `crm_app/views.py`

### Student lifecycle

- [Student services](https://github.com/mruzbek00/ccrm/blob/main/crm_app/students.py): `crm_app/students.py`
- [Status pipeline](https://github.com/mruzbek00/ccrm/blob/main/crm_app/student_statuses.py): `crm_app/student_statuses.py`
- [History writer](https://github.com/mruzbek00/ccrm/blob/main/crm_app/student_history.py): `crm_app/student_history.py`

### Centre operations

- [Groups and schedules](https://github.com/mruzbek00/ccrm/blob/main/crm_app/groups_admin.py): `crm_app/groups_admin.py`
- [Dashboard metrics](https://github.com/mruzbek00/ccrm/blob/main/crm_app/dashboard.py): `crm_app/dashboard.py`
- [Workbook export](https://github.com/mruzbek00/ccrm/blob/main/crm_app/exports.py): `crm_app/exports.py`

### Administration

- [Branch options](https://github.com/mruzbek00/ccrm/blob/main/crm_app/branches_admin.py): `crm_app/branches_admin.py`
- [Staff accounts](https://github.com/mruzbek00/ccrm/blob/main/crm_app/staff_accounts.py): `crm_app/staff_accounts.py`

### Persistence

- [Domain models](https://github.com/mruzbek00/ccrm/blob/main/crm_app/models.py): `crm_app/models.py`
- [SQLite database](https://github.com/mruzbek00/ccrm/blob/main/crm_project/settings.py): `crm_project/settings.py`

### Other components

- **Centre staff**
- **XLSX download**

## Connections

- Centre staff → Staff browser: uses
- Staff browser → Route table: requests pages and data
- Screen scripts → Route table: fetches JSON and actions
- Language layer → Staff browser: localizes interface
- Route table → Request handlers: dispatches
- Request handlers → Student services: delegates student work
- Request handlers → Status pipeline: delegates status work
- Request handlers → Groups and schedules: delegates group work
- Request handlers → Dashboard metrics: delegates metrics
- Request handlers → Workbook export: delegates exports
- Request handlers → Branch options: delegates branch work
- Request handlers → Staff accounts: delegates account work
- Student services → Domain models: queries and updates
- Status pipeline → Domain models: maintains statuses
- History writer → Domain models: writes entries
- Groups and schedules → Domain models: queries and updates
- Dashboard metrics → Domain models: reads metrics data
- Workbook export → Domain models: reads export data
- Branch options → Domain models: queries and updates
- Staff accounts → Domain models: queries and updates
- Domain models → SQLite database: reads and writes
- Request handlers → XLSX download: returns download
- Staff browser → XLSX download: downloads
