# ebersantana/horarios-ifs architecture

> Architecture diagram of the GitHub repository ebersantana/horarios-ifs, 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/ebersantana/horarios-ifs
- Repository: https://github.com/ebersantana/horarios-ifs

## Overview

Painel Docente is a mobile-first PWA for managing faculty schedules, absences, substitutions, schedule exchanges, make-up classes, and notifications. Teachers use the web interface to view schedules and submit or respond to actions; the client applies domain rules and persists data locally or through the Apps Script backend, which connects to Google Sheets and institutional email. The README documents capabilities whose implementation was not sampled; edges for those are attributed to the README rather than inferred from unseen code.

Main entry points: [`app.js`](https://github.com/ebersantana/horarios-ifs/blob/main/app.js) (App logic and views), [`api.js`](https://github.com/ebersantana/horarios-ifs/blob/main/api.js) (Client API), [`backend/Code.gs`](https://github.com/ebersantana/horarios-ifs/blob/main/backend/Code.gs) (Apps Script backend), [`index.html`](https://github.com/ebersantana/horarios-ifs/blob/main/index.html) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Teacher interface"]
  node_webapp["Web application<br/>[index.html]"]
  node_app["App logic and views<br/>[app.js]"]
end

subgraph group_scheduling["Schedule workflows"]
  node_schedule["Class schedules<br/>[app.js]"]
  node_absence["Absence reporting<br/>[app.js]"]
  node_substitutions["Open substitutions<br/>[app.js]"]
  node_exchanges["Schedule exchanges<br/>[app.js]"]
  node_makeups["Make-up classes<br/>[app.js]"]
  node_reports["Schedule reports<br/>[app.js]"]
end

subgraph group_client["Client data and PWA"]
  node_api["Client API<br/>[api.js]"]
  node_localstore[("Local browser data<br/>[api.js]")]
  node_pwa["Offline service worker<br/>[sw.js]"]
end

subgraph group_backend["Persistence and notifications"]
  node_apps_script["Apps Script backend<br/>[Code.gs]"]
  node_sheets[("Google Sheets")]
  node_email["Institutional email"]
end

node_teacher(("Teacher"))
node_coordination(("Coordination"))

node_teacher -->|"uses"| node_webapp
node_webapp -->|"loads"| node_app
node_app -->|"renders"| node_schedule
node_app -->|"handles"| node_absence
node_app -->|"handles"| node_substitutions
node_app -->|"handles"| node_exchanges
node_app -->|"handles"| node_makeups
node_app -->|"renders"| node_reports
node_app -->|"submits actions"| node_api
node_api -->|"reads and writes"| node_localstore
node_api -->|"fetches schedule"| node_apps_script
node_apps_script -->|"persists data"| node_sheets
node_apps_script -->|"sends notices"| node_email
node_email -->|"notifies"| node_coordination
node_pwa -->|"caches offline"| node_webapp
node_app -->|"registers"| node_pwa

click node_webapp "https://github.com/ebersantana/horarios-ifs/blob/main/index.html"
click node_app "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_schedule "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_absence "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_substitutions "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_exchanges "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_makeups "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_reports "https://github.com/ebersantana/horarios-ifs/blob/main/app.js"
click node_api "https://github.com/ebersantana/horarios-ifs/blob/main/api.js"
click node_localstore "https://github.com/ebersantana/horarios-ifs/blob/main/api.js"
click node_pwa "https://github.com/ebersantana/horarios-ifs/blob/main/sw.js"
click node_apps_script "https://github.com/ebersantana/horarios-ifs/blob/main/backend/Code.gs"

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_app toneBlue
class node_schedule,node_absence,node_substitutions,node_exchanges,node_makeups,node_reports toneAmber
class node_api,node_localstore,node_pwa toneMint
class node_apps_script,node_sheets,node_email toneRose
class node_teacher,node_coordination toneIndigo
```

## Components

### Teacher interface

- [Web application](https://github.com/ebersantana/horarios-ifs/blob/main/index.html): `index.html`
- [App logic and views](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`

### Schedule workflows

- [Class schedules](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`
- [Absence reporting](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`
- [Open substitutions](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`
- [Schedule exchanges](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`
- [Make-up classes](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`
- [Schedule reports](https://github.com/ebersantana/horarios-ifs/blob/main/app.js): `app.js`

### Client data and PWA

- [Client API](https://github.com/ebersantana/horarios-ifs/blob/main/api.js): `api.js`
- [Local browser data](https://github.com/ebersantana/horarios-ifs/blob/main/api.js): `api.js`
- [Offline service worker](https://github.com/ebersantana/horarios-ifs/blob/main/sw.js): `sw.js`

### Persistence and notifications

- [Apps Script backend](https://github.com/ebersantana/horarios-ifs/blob/main/backend/Code.gs): `backend/Code.gs`
- **Google Sheets**
- **Institutional email**

### Other components

- **Teacher**
- **Coordination**

## Connections

- Teacher → Web application: uses (evidence: `README.md`)
- Web application → App logic and views: loads (evidence: `README.md`)
- App logic and views → Class schedules: renders (evidence: `app.js`)
- App logic and views → Absence reporting: handles (evidence: `app.js`)
- App logic and views → Open substitutions: handles (evidence: `app.js`)
- App logic and views → Schedule exchanges: handles (evidence: `app.js`)
- App logic and views → Make-up classes: handles (evidence: `app.js`)
- App logic and views → Schedule reports: renders (evidence: `app.js`)
- App logic and views → Client API: submits actions (evidence: `app.js`)
- Client API → Local browser data: reads and writes (evidence: `api.js`)
- Client API → Apps Script backend: fetches schedule (evidence: `api.js`)
- Apps Script backend → Google Sheets: persists data (evidence: `README.md`)
- Apps Script backend → Institutional email: sends notices (evidence: `README.md`)
- Institutional email → Coordination: notifies (evidence: `README.md`)
- Offline service worker → Web application: caches offline (evidence: `sw.js`)
- App logic and views → Offline service worker: registers (evidence: `app.js`)
