# amiir-savadogo/auto-ecole-cftra architecture

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

- Interactive diagram: https://gitdiagram.com/amiir-savadogo/auto-ecole-cftra
- Repository: https://github.com/amiir-savadogo/auto-ecole-cftra

## Overview

This is a Flask application for managing a driving school: staff register students, track training and exam milestones, issue attestations, and administer users and records. The central workflow is student enrollment → course and exam tracking → attestation generation → chief approval or rejection, with re-examination and duplicate handling. The excerpts establish the application wiring, authentication, data models, and portions of the moniteur, chef, and PDF flows; links for unsampled route behavior are therefore kept conservative.

Main entry points: [`routes/moniteur.py`](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/moniteur.py) (Training and exams), [`routes/pdf.py`](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/pdf.py) (Document generation), [`app.py`](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/app.py) (Flask app), [`models.py`](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/models.py) (Domain models)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Flask app<br/>[app.py]"]
  node_auth["Login and roles<br/>[auth.py]"]
  node_utils["Access and notifications<br/>[utils.py]"]
end

subgraph group_training["Student training"]
  node_monitor["Training and exams<br/>[moniteur.py]"]
  node_list_code["Code exam list"]
  node_list_drive["Driving exam list"]
  node_list_slot["Slot exam list"]
  node_call_list["Attendance list"]
end

subgraph group_attestation["Attestations"]
  node_chief["Attestation review<br/>[chef.py]"]
  node_pdf["Document generation<br/>[pdf.py]"]
  node_att_template["Attestation template"]
  node_att_files["Generated attestations"]
end

subgraph group_records["Identity and records"]
  node_admin["Administration<br/>[admin.py]"]
  node_secretary["Secretary enrollment<br/>[secretaire.py]"]
  node_models["Domain models<br/>[models.py]"]
  node_db[("Application database<br/>[autoecole.db]")]
end

node_staff(("School staff"))

node_staff -->|"uses"| node_app
node_app -->|"registers"| node_auth
node_app -->|"registers"| node_admin
node_app -->|"registers"| node_secretary
node_app -->|"registers"| node_monitor
node_app -->|"registers"| node_chief
node_app -->|"registers"| node_pdf
node_auth -->|"queries users"| node_models
node_auth -->|"reads"| node_db
node_admin -->|"manages records"| node_models
node_admin -->|"reads and writes"| node_db
node_secretary -->|"manages enrollment"| node_models
node_secretary -->|"reads and writes"| node_db
node_monitor -->|"tracks progress"| node_models
node_monitor -->|"reads and writes"| node_db
node_monitor -->|"logs actions"| node_utils
node_monitor -->|"selects template"| node_list_code
node_monitor -->|"selects template"| node_list_drive
node_monitor -->|"selects template"| node_list_slot
node_monitor -->|"selects template"| node_call_list
node_chief -->|"reviews students"| node_models
node_chief -->|"reads and writes"| node_db
node_chief -->|"sends notifications"| node_utils
node_pdf -->|"loads student data"| node_models
node_pdf -->|"reads and writes"| node_db
node_pdf -->|"merges fields"| node_att_template
node_pdf -->|"writes documents"| node_att_files
node_pdf -->|"reads template"| node_list_code
node_pdf -->|"reads template"| node_list_drive
node_pdf -->|"reads template"| node_list_slot
node_utils -->|"records activity"| node_models
node_models -->|"maps and persists"| node_db

click node_app "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/app.py"
click node_auth "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/auth.py"
click node_admin "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/admin.py"
click node_secretary "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/secretaire.py"
click node_monitor "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/moniteur.py"
click node_chief "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/chef.py"
click node_pdf "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/pdf.py"
click node_utils "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/utils.py"
click node_models "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/models.py"
click node_db "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/autoecole.db"
click node_att_template "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/attestation%20modele.docx"
click node_att_files "https://github.com/amiir-savadogo/auto-ecole-cftra/tree/main/static/attestations"
click node_list_code "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20examen%20code%20de%20la%20route.docx"
click node_list_drive "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20examen%20conduite%20en%20ville.docx"
click node_list_slot "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20examen%20creneau.docx"
click node_call_list "https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20Appel.docx"

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_auth,node_utils toneBlue
class node_monitor,node_list_code,node_list_drive,node_list_slot,node_call_list toneAmber
class node_chief,node_pdf,node_att_template,node_att_files toneMint
class node_admin,node_secretary,node_models,node_db toneRose
class node_staff toneIndigo
```

## Components

### Web application

- [Flask app](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/app.py): `app.py`
- [Login and roles](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/auth.py): `routes/auth.py`
- [Access and notifications](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/utils.py): `utils.py`

### Student training

- [Training and exams](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/moniteur.py): `routes/moniteur.py`
- [Code exam list](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20examen%20code%20de%20la%20route.docx): `Liste Programmation examen code de la route.docx`
- [Driving exam list](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20examen%20conduite%20en%20ville.docx): `Liste Programmation examen conduite en ville.docx`
- [Slot exam list](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20examen%20creneau.docx): `Liste Programmation examen creneau.docx`
- [Attendance list](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/Liste%20Programmation%20Appel.docx): `Liste Programmation Appel.docx`

### Attestations

- [Attestation review](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/chef.py): `routes/chef.py`
- [Document generation](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/pdf.py): `routes/pdf.py`
- [Attestation template](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/attestation%20modele.docx): `attestation modele.docx`
- [Generated attestations](https://github.com/amiir-savadogo/auto-ecole-cftra/tree/main/static/attestations): `static/attestations`

### Identity and records

- [Administration](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/admin.py): `routes/admin.py`
- [Secretary enrollment](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/routes/secretaire.py): `routes/secretaire.py`
- [Domain models](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/models.py): `models.py`
- [Application database](https://github.com/amiir-savadogo/auto-ecole-cftra/blob/main/autoecole.db): `autoecole.db`

### Other components

- **School staff**

## Connections

- School staff → Flask app: uses
- Flask app → Login and roles: registers
- Flask app → Administration: registers
- Flask app → Secretary enrollment: registers
- Flask app → Training and exams: registers
- Flask app → Attestation review: registers
- Flask app → Document generation: registers
- Login and roles → Domain models: queries users
- Login and roles → Application database: reads
- Administration → Domain models: manages records
- Administration → Application database: reads and writes
- Secretary enrollment → Domain models: manages enrollment
- Secretary enrollment → Application database: reads and writes
- Training and exams → Domain models: tracks progress
- Training and exams → Application database: reads and writes
- Training and exams → Access and notifications: logs actions
- Training and exams → Code exam list: selects template
- Training and exams → Driving exam list: selects template
- Training and exams → Slot exam list: selects template
- Training and exams → Attendance list: selects template
- Attestation review → Domain models: reviews students
- Attestation review → Application database: reads and writes
- Attestation review → Access and notifications: sends notifications
- Document generation → Domain models: loads student data
- Document generation → Application database: reads and writes
- Document generation → Attestation template: merges fields
- Document generation → Generated attestations: writes documents
- Document generation → Code exam list: reads template
- Document generation → Driving exam list: reads template
- Document generation → Slot exam list: reads template
- Access and notifications → Domain models: records activity
- Domain models → Application database: maps and persists
