# andrejrunb/-quila-pro-v-1.0.0 architecture

> Architecture diagram of the GitHub repository andrejrunb/-quila-pro-v-1.0.0, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/andrejrunb/-quila-pro-v-1.0.0
- Repository: https://github.com/andrejrunb/-quila-pro-v-1.0.0

## Overview

Áquila Pro is an offline-first school operating system spanning desktop, mobile, and web experiences, with learning support, assessment, attendance, family communication, and governance capabilities. The documented user journey runs from teacher planning and assessment through student study activities to family follow-up. Source excerpts establish several desktop alert, persistence, notification, and media-gateway relationships; many other capabilities are documented in the README but their wiring is unsampled. Archived mobile and cloud modules are kept distinct from the current product surfaces.

Main entry points: [`apps/electron/src/main/services/AlertEngine.ts`](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/AlertEngine.ts) (Attendance Alerts), [`archive/aquilapro_mobile/src/screens/LoginScreen.tsx`](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/LoginScreen.tsx) (Archived Login), [`apps/electron/src/main/services/OmrCorrectionService.ts`](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/OmrCorrectionService.ts) (Exam Foundry), [`apps/mobile/app/(tabs)/index.tsx`](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/mobile/app/(tabs)/index.tsx) (Mobile Companion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning and Assessment"]
  node_assessment["Exam Foundry"]
  node_omr["OMR Correction"]
  node_lesson["Learning Studio"]
  node_practice["Study Activities"]
  node_h5p["Interactive Content"]
  node_gamification["Gamification Catalog"]
  node_media["Media Gateway"]
end

subgraph group_school["School Operations"]
  node_attendance["Attendance Alerts<br/>[AlertEngine.ts]"]
  node_behavior["Behavior Analysis"]
  node_notifications["Notification Queue"]
  node_push["Push Notifications"]
end

subgraph group_platform["Desktop Platform"]
  node_database[("Local Database<br/>[Database.ts]")]
  node_websocket["WebSocket Server<br/>[WebSocketServer.ts]"]
  node_desktoplog["Desktop Logger<br/>[logger.ts]"]
  node_logger["Logger Service<br/>[Logger.ts]"]
  node_recovery["SQLite Recovery"]
  node_security["Security Service<br/>[SecurityService.ts]"]
  node_aitypes["AI Contracts<br/>[AiTypes.ts]"]
  node_media_contracts["Media Contracts<br/>[mediaContracts.ts]"]
end

subgraph group_experiences["Student and Family Apps"]
  node_mobile["Mobile Companion<br/>[index.tsx]"]
  node_parent["Family Channel"]
  node_webportals["Web Portals<br/>[page.tsx]"]
end

subgraph group_legacy["Archived Clients and Cloud"]
  node_legacy_mobile["Archived Mobile<br/>[TimelineScreen.tsx]"]
  node_legacy_location["Geofencing Service<br/>[LocationService.ts]"]
  node_legacy_login["Archived Login<br/>[LoginScreen.tsx]"]
  node_legacy_parent["Archived Parent App"]
  node_legacy_guard["Archived Guard App<br/>[GuardDashboard.tsx]"]
  node_legacy_teacher["Archived Teacher App"]
  node_cloud_whatsapp["Cloud WhatsApp Route<br/>[whatsapp.ts]"]
  node_cloud_db[("Cloud PostgreSQL Pool<br/>[pool.ts]")]
end

node_teacher(("Teacher"))

node_teacher -->|"plans learning"| node_lesson
node_teacher -->|"creates assessments"| node_assessment
node_assessment -->|"produces answer sheets"| node_omr
node_assessment -->|"sends via gateway"| node_mobile
node_lesson -->|"provides study content"| node_mobile
node_mobile -->|"supports review"| node_parent
node_attendance -->|"records attendance"| node_database
node_attendance -->|"processes recognition"| node_behavior
node_attendance -->|"queues messages"| node_notifications
node_desktoplog -->|"initializes"| node_logger
node_media -->|"uses contracts"| node_media_contracts
node_gamification -->|"uses contracts"| node_media_contracts
node_legacy_location -.->|"sends arrival events"| node_cloud_whatsapp
node_legacy_mobile -->|"starts geofencing"| node_legacy_location
node_legacy_login -->|"routes to"| node_legacy_parent
node_legacy_login -->|"routes to"| node_legacy_guard
node_legacy_login -->|"routes to"| node_legacy_teacher

click node_assessment "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/OmrCorrectionService.ts"
click node_omr "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/OmrCorrectionService.ts"
click node_lesson "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/PedagogicalTriEngine.ts"
click node_practice "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/WordwallGameEngine.ts"
click node_h5p "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/H5PPerseusEngine.ts"
click node_gamification "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/media-gateway/src/services/GamificationCatalogService.ts"
click node_media "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/media-gateway/src/services/MediaGatewayService.ts"
click node_mobile "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/mobile/app/(tabs)/index.tsx"
click node_parent "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/ParentPortalService.ts"
click node_webportals "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/web/src/app/portal/aluno/page.tsx"
click node_attendance "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/AlertEngine.ts"
click node_behavior "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/BehavioralEngine.ts"
click node_notifications "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/NotificationQueueService.ts"
click node_push "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/PushNotificationService.ts"
click node_database "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/database/Database.ts"
click node_websocket "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/WebSocketServer.ts"
click node_desktoplog "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/logger.ts"
click node_logger "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/Logger.ts"
click node_recovery "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/SQLiteDisasterRecoveryService.ts"
click node_security "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/SecurityService.ts"
click node_aitypes "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/AiTypes.ts"
click node_media_contracts "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/media-gateway/src/types/mediaContracts.ts"
click node_legacy_mobile "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-mobile/src/screens/TimelineScreen.tsx"
click node_legacy_location "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-mobile/src/services/LocationService.ts"
click node_legacy_login "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/LoginScreen.tsx"
click node_legacy_parent "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/ParentDashboard.tsx"
click node_legacy_guard "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/GuardDashboard.tsx"
click node_legacy_teacher "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/TeacherDashboard.tsx"
click node_cloud_whatsapp "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-cloud/src/routes/whatsapp.ts"
click node_cloud_db "https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-cloud/src/db/pool.ts"

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_assessment,node_omr,node_lesson,node_practice,node_h5p,node_gamification,node_media toneBlue
class node_attendance,node_behavior,node_notifications,node_push toneAmber
class node_database,node_websocket,node_desktoplog,node_logger,node_recovery,node_security,node_aitypes,node_media_contracts toneMint
class node_mobile,node_parent,node_webportals toneRose
class node_legacy_mobile,node_legacy_location,node_legacy_login,node_legacy_parent,node_legacy_guard,node_legacy_teacher,node_cloud_whatsapp,node_cloud_db,node_teacher toneIndigo
```

## Components

### Learning and Assessment

- [Exam Foundry](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/OmrCorrectionService.ts): `apps/electron/src/main/services/OmrCorrectionService.ts`
- [OMR Correction](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/OmrCorrectionService.ts): `apps/electron/src/main/services/OmrCorrectionService.ts`
- [Learning Studio](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/PedagogicalTriEngine.ts): `apps/electron/src/services/PedagogicalTriEngine.ts`
- [Study Activities](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/WordwallGameEngine.ts): `apps/electron/src/services/WordwallGameEngine.ts`
- [Interactive Content](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/H5PPerseusEngine.ts): `apps/electron/src/services/H5PPerseusEngine.ts`
- [Gamification Catalog](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/media-gateway/src/services/GamificationCatalogService.ts): `apps/media-gateway/src/services/GamificationCatalogService.ts`
- [Media Gateway](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/media-gateway/src/services/MediaGatewayService.ts): `apps/media-gateway/src/services/MediaGatewayService.ts`

### School Operations

- [Attendance Alerts](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/AlertEngine.ts): `apps/electron/src/main/services/AlertEngine.ts`
- [Behavior Analysis](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/BehavioralEngine.ts): `apps/electron/src/main/services/BehavioralEngine.ts`
- [Notification Queue](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/NotificationQueueService.ts): `apps/electron/src/main/services/NotificationQueueService.ts`
- [Push Notifications](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/PushNotificationService.ts): `apps/electron/src/main/services/PushNotificationService.ts`

### Desktop Platform

- [Local Database](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/database/Database.ts): `apps/electron/src/database/Database.ts`
- [WebSocket Server](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/WebSocketServer.ts): `apps/electron/src/main/services/WebSocketServer.ts`
- [Desktop Logger](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/logger.ts): `apps/electron/src/main/logger.ts`
- [Logger Service](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/Logger.ts): `apps/electron/src/main/services/Logger.ts`
- [SQLite Recovery](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/SQLiteDisasterRecoveryService.ts): `apps/electron/src/main/services/SQLiteDisasterRecoveryService.ts`
- [Security Service](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/SecurityService.ts): `apps/electron/src/main/services/SecurityService.ts`
- [AI Contracts](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/services/AiTypes.ts): `apps/electron/src/services/AiTypes.ts`
- [Media Contracts](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/media-gateway/src/types/mediaContracts.ts): `apps/media-gateway/src/types/mediaContracts.ts`

### Student and Family Apps

- [Mobile Companion](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/mobile/app/(tabs)/index.tsx): `apps/mobile/app/(tabs)/index.tsx`
- [Family Channel](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/electron/src/main/services/ParentPortalService.ts): `apps/electron/src/main/services/ParentPortalService.ts`
- [Web Portals](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/apps/web/src/app/portal/aluno/page.tsx): `apps/web/src/app/portal/aluno/page.tsx`

### Archived Clients and Cloud

- [Archived Mobile](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-mobile/src/screens/TimelineScreen.tsx): `archive/aquila-mobile/src/screens/TimelineScreen.tsx`
- [Geofencing Service](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-mobile/src/services/LocationService.ts): `archive/aquila-mobile/src/services/LocationService.ts`
- [Archived Login](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/LoginScreen.tsx): `archive/aquilapro_mobile/src/screens/LoginScreen.tsx`
- [Archived Parent App](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/ParentDashboard.tsx): `archive/aquilapro_mobile/src/screens/ParentDashboard.tsx`
- [Archived Guard App](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/GuardDashboard.tsx): `archive/aquilapro_mobile/src/screens/GuardDashboard.tsx`
- [Archived Teacher App](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquilapro_mobile/src/screens/TeacherDashboard.tsx): `archive/aquilapro_mobile/src/screens/TeacherDashboard.tsx`
- [Cloud WhatsApp Route](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-cloud/src/routes/whatsapp.ts): `archive/aquila-cloud/src/routes/whatsapp.ts`
- [Cloud PostgreSQL Pool](https://github.com/andrejrunb/-quila-pro-v-1.0.0/blob/main/archive/aquila-cloud/src/db/pool.ts): `archive/aquila-cloud/src/db/pool.ts`

### Other components

- **Teacher**

## Connections

- Teacher → Learning Studio: plans learning (evidence: `README.md`)
- Teacher → Exam Foundry: creates assessments (evidence: `README.md`)
- Exam Foundry → OMR Correction: produces answer sheets (evidence: `README.md`)
- Exam Foundry → Mobile Companion: sends via gateway (evidence: `README.md`)
- Learning Studio → Mobile Companion: provides study content (evidence: `README.md`)
- Mobile Companion → Family Channel: supports review (evidence: `README.md`)
- Attendance Alerts → Local Database: records attendance (evidence: `apps/electron/src/main/services/AlertEngine.ts`)
- Attendance Alerts → Behavior Analysis: processes recognition (evidence: `apps/electron/src/main/services/AlertEngine.ts`)
- Attendance Alerts → Notification Queue: queues messages (evidence: `apps/electron/src/main/services/AlertEngine.ts`)
- Desktop Logger → Logger Service: initializes (evidence: `apps/electron/src/main/logger.ts`)
- Media Gateway → Media Contracts: uses contracts (evidence: `apps/media-gateway/src/services/MediaGatewayService.ts`)
- Gamification Catalog → Media Contracts: uses contracts (evidence: `apps/media-gateway/src/services/GamificationCatalogService.ts`)
- Geofencing Service → Cloud WhatsApp Route: sends arrival events
- Archived Mobile → Geofencing Service: starts geofencing (evidence: `archive/aquila-mobile/App.tsx`)
- Archived Login → Archived Parent App: routes to (evidence: `archive/aquilapro_mobile/App.tsx`)
- Archived Login → Archived Guard App: routes to (evidence: `archive/aquilapro_mobile/App.tsx`)
- Archived Login → Archived Teacher App: routes to (evidence: `archive/aquilapro_mobile/App.tsx`)
