# tiavinaliantsoaa/copil architecture

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

- Interactive diagram: https://gitdiagram.com/tiavinaliantsoaa/copil
- Repository: https://github.com/tiavinaliantsoaa/copil

## Overview

ESCM COPIL Communication is a private Laravel application for monthly communications reporting. Staff sign in, select a period, enter channel and operational data, and upload supporting files; reporting controllers persist changes and administrators can manage users and close periods. Managers review calculated indicators, archives, a presentation view, and PDF or PowerPoint exports. The graph reflects documented routes and sampled controller/service relationships; some view-to-controller wiring and database schema details were not sampled, so those links are omitted where not evidenced.

Main entry points: [`app/Http/Controllers/DashboardController.php`](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/DashboardController.php) (Monthly dashboard), [`app/Http/Controllers/ExportController.php`](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/ExportController.php) (Export endpoints), [`app/Http/Controllers/PeriodController.php`](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/PeriodController.php) (Period lifecycle), [`app/Http/Controllers/AttachmentController.php`](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/AttachmentController.php) (Attachment handling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and administration"]
  node_login["Sign-in"]
  node_users["User management<br/>[UserController.php]"]
end

subgraph group_reporting["Monthly reporting"]
  node_periods["Period lifecycle"]
  node_blueprint["New-month blueprint"]
  node_dashboard["Monthly dashboard"]
  node_report_editor["Report sections"]
  node_calculator["Indicator calculations"]
  node_attachments["Attachment handling"]
end

subgraph group_records["Report records"]
  node_user_model[("User accounts and roles<br/>[User.php]")]
  node_report_model[("Communication report")]
  node_period_model[("Period records<br/>[Period.php]")]
  node_attachment_model[("Attachment records<br/>[Attachment.php]")]
  node_private_files[("Private file storage")]
  node_audit[("Audit log<br/>[AuditLog.php]")]
end

subgraph group_review["Review and exports"]
  node_presentation["Presentation mode"]
  node_exports["Export endpoints"]
  node_pptx["PowerPoint generation"]
  node_pdf_view["PDF report view<br/>[pdf.blade.php]"]
  node_dashboard_view["Reporting interface"]
  node_charts["Charts and previews<br/>[app.js]"]
end

node_staff(("Staff and managers"))
node_admin(("Administrator"))

node_staff -->|"signs in"| node_login
node_login -->|"authenticates"| node_user_model
node_admin -->|"manages accounts"| node_users
node_users -->|"updates"| node_user_model
node_users -->|"records changes"| node_audit
node_staff -->|"opens period"| node_dashboard
node_dashboard -->|"loads periods"| node_period_model
node_dashboard -->|"loads user"| node_user_model
node_dashboard -->|"calculates indicators"| node_calculator
node_dashboard -.->|"renders"| node_dashboard_view
node_dashboard_view -.->|"renders charts"| node_charts
node_admin -->|"creates or closes"| node_periods
node_periods -->|"creates and updates"| node_period_model
node_periods -->|"builds report"| node_blueprint
node_periods -->|"records lifecycle"| node_audit
node_blueprint -->|"defines report data"| node_report_model
node_staff -->|"saves sections"| node_report_editor
node_report_editor -->|"updates report"| node_report_model
node_report_editor -->|"records edits"| node_audit
node_staff -->|"uploads files"| node_attachments
node_attachments -->|"creates and deletes"| node_attachment_model
node_attachments -->|"stores and serves"| node_private_files
node_attachments -->|"records uploads"| node_audit
node_staff -->|"views presentation"| node_presentation
node_presentation -->|"loads period"| node_period_model
node_presentation -->|"calculates indicators"| node_calculator
node_staff -->|"requests export"| node_exports
node_exports -->|"loads period"| node_period_model
node_exports -->|"calculates indicators"| node_calculator
node_exports -->|"generates PPTX"| node_pptx
node_exports -.->|"renders PDF"| node_pdf_view
node_pptx -->|"reads report images"| node_private_files

click node_login "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/Auth/LoginController.php"
click node_users "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/UserController.php"
click node_user_model "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/User.php"
click node_periods "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/PeriodController.php"
click node_blueprint "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Services/ReportBlueprint.php"
click node_dashboard "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/DashboardController.php"
click node_report_editor "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/ReportController.php"
click node_calculator "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Services/ReportCalculator.php"
click node_report_model "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/CommunicationReport.php"
click node_period_model "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/Period.php"
click node_attachments "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/AttachmentController.php"
click node_attachment_model "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/Attachment.php"
click node_audit "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/AuditLog.php"
click node_presentation "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/PresentationController.php"
click node_exports "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/ExportController.php"
click node_pptx "https://github.com/tiavinaliantsoaa/copil/blob/main/app/Services/PptxExportService.php"
click node_pdf_view "https://github.com/tiavinaliantsoaa/copil/blob/main/resources/views/exports/pdf.blade.php"
click node_dashboard_view "https://github.com/tiavinaliantsoaa/copil/blob/main/resources/views/dashboard.blade.php"
click node_charts "https://github.com/tiavinaliantsoaa/copil/blob/main/resources/js/app.js"

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_login,node_users toneBlue
class node_periods,node_blueprint,node_dashboard,node_report_editor,node_calculator,node_attachments toneAmber
class node_user_model,node_report_model,node_period_model,node_attachment_model,node_private_files,node_audit toneMint
class node_presentation,node_exports,node_pptx,node_pdf_view,node_dashboard_view,node_charts toneRose
class node_staff,node_admin toneIndigo
```

## Components

### Access and administration

- [Sign-in](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/Auth/LoginController.php): `app/Http/Controllers/Auth/LoginController.php`
- [User management](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/UserController.php): `app/Http/Controllers/UserController.php`

### Monthly reporting

- [Period lifecycle](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/PeriodController.php): `app/Http/Controllers/PeriodController.php`
- [New-month blueprint](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Services/ReportBlueprint.php): `app/Services/ReportBlueprint.php`
- [Monthly dashboard](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/DashboardController.php): `app/Http/Controllers/DashboardController.php`
- [Report sections](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/ReportController.php): `app/Http/Controllers/ReportController.php`
- [Indicator calculations](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Services/ReportCalculator.php): `app/Services/ReportCalculator.php`
- [Attachment handling](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/AttachmentController.php): `app/Http/Controllers/AttachmentController.php`

### Report records

- [User accounts and roles](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/User.php): `app/Models/User.php`
- [Communication report](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/CommunicationReport.php): `app/Models/CommunicationReport.php`
- [Period records](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/Period.php): `app/Models/Period.php`
- [Attachment records](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/Attachment.php): `app/Models/Attachment.php`
- **Private file storage**
- [Audit log](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Models/AuditLog.php): `app/Models/AuditLog.php`

### Review and exports

- [Presentation mode](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/PresentationController.php): `app/Http/Controllers/PresentationController.php`
- [Export endpoints](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Http/Controllers/ExportController.php): `app/Http/Controllers/ExportController.php`
- [PowerPoint generation](https://github.com/tiavinaliantsoaa/copil/blob/main/app/Services/PptxExportService.php): `app/Services/PptxExportService.php`
- [PDF report view](https://github.com/tiavinaliantsoaa/copil/blob/main/resources/views/exports/pdf.blade.php): `resources/views/exports/pdf.blade.php`
- [Reporting interface](https://github.com/tiavinaliantsoaa/copil/blob/main/resources/views/dashboard.blade.php): `resources/views/dashboard.blade.php`
- [Charts and previews](https://github.com/tiavinaliantsoaa/copil/blob/main/resources/js/app.js): `resources/js/app.js`

### Other components

- **Staff and managers**
- **Administrator**

## Connections

- Staff and managers → Sign-in: signs in
- Sign-in → User accounts and roles: authenticates (evidence: `app/Http/Controllers/Auth/LoginController.php`)
- Administrator → User management: manages accounts
- User management → User accounts and roles: updates (evidence: `app/Http/Controllers/UserController.php`)
- User management → Audit log: records changes (evidence: `app/Http/Controllers/UserController.php`)
- Staff and managers → Monthly dashboard: opens period
- Monthly dashboard → Period records: loads periods (evidence: `app/Http/Controllers/DashboardController.php`)
- Monthly dashboard → User accounts and roles: loads user (evidence: `app/Http/Controllers/DashboardController.php`)
- Monthly dashboard → Indicator calculations: calculates indicators (evidence: `app/Http/Controllers/DashboardController.php`)
- Monthly dashboard → Reporting interface: renders
- Reporting interface → Charts and previews: renders charts
- Administrator → Period lifecycle: creates or closes
- Period lifecycle → Period records: creates and updates (evidence: `app/Http/Controllers/PeriodController.php`)
- Period lifecycle → New-month blueprint: builds report (evidence: `app/Http/Controllers/PeriodController.php`)
- Period lifecycle → Audit log: records lifecycle (evidence: `app/Http/Controllers/PeriodController.php`)
- New-month blueprint → Communication report: defines report data (evidence: `app/Services/ReportBlueprint.php`)
- Staff and managers → Report sections: saves sections
- Report sections → Communication report: updates report (evidence: `app/Http/Controllers/ReportController.php`)
- Report sections → Audit log: records edits (evidence: `app/Http/Controllers/ReportController.php`)
- Staff and managers → Attachment handling: uploads files
- Attachment handling → Attachment records: creates and deletes (evidence: `app/Http/Controllers/AttachmentController.php`)
- Attachment handling → Private file storage: stores and serves (evidence: `app/Http/Controllers/AttachmentController.php`)
- Attachment handling → Audit log: records uploads (evidence: `app/Http/Controllers/AttachmentController.php`)
- Staff and managers → Presentation mode: views presentation
- Presentation mode → Period records: loads period (evidence: `app/Http/Controllers/PresentationController.php`)
- Presentation mode → Indicator calculations: calculates indicators (evidence: `app/Http/Controllers/PresentationController.php`)
- Staff and managers → Export endpoints: requests export
- Export endpoints → Period records: loads period (evidence: `app/Http/Controllers/ExportController.php`)
- Export endpoints → Indicator calculations: calculates indicators (evidence: `app/Http/Controllers/ExportController.php`)
- Export endpoints → PowerPoint generation: generates PPTX (evidence: `app/Http/Controllers/ExportController.php`)
- Export endpoints → PDF report view: renders PDF
- PowerPoint generation → Private file storage: reads report images (evidence: `app/Services/PptxExportService.php`)
