# thienbaovoquang-hub/vschool architecture

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

- Interactive diagram: https://gitdiagram.com/thienbaovoquang-hub/vschool
- Repository: https://github.com/thienbaovoquang-hub/vschool

## Overview

SchoolHub is a school-management application presented as a desktop workspace. A user signs in, opens role-allowed apps and tabs, manages school records, and can import/export data or synchronize with cloud services. The source index documents administration, student and staff management, learning, library, communications, facilities, student services, analytics, and emulation capabilities. Several app implementations were not sampled, so their subsystem nodes are included but their internal call paths are not inferred.

Main entry points: [`src/data/appRegistry.ts`](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/data/appRegistry.ts) (App registry), [`src/App.tsx`](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/App.tsx) (App coordinator), [`src/components/importExport/ExcelImportDialog.tsx`](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/importExport/ExcelImportDialog.tsx) (Spreadsheet import), [`src/firebase/services.ts`](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/firebase/services.ts) (Cloud data services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Desktop workspace"]
  node_app["App coordinator<br/>[App.tsx]"]
  node_login["Sign-in screen<br/>[LoginScreen.tsx]"]
  node_windowhook["Window manager hook"]
  node_windowmanager["Window manager<br/>[WindowManager.tsx]"]
  node_registry["App registry<br/>[appRegistry.ts]"]
end

subgraph group_school["School operations"]
  node_admin["Administration"]
  node_schoolapp["School management"]
  node_learning["Learning and timetable<br/>[LearningApp.tsx]"]
  node_library["Library services<br/>[LibraryApp.tsx]"]
  node_studentservices["Student services"]
  node_communications["Communications"]
  node_facilities["Facilities<br/>[FacilitiesApp.tsx]"]
  node_analytics["Analytics and AI<br/>[AnalyticsAIApp.tsx]"]
  node_emulation["Emulation and competitions"]
end

subgraph group_data["Data and access"]
  node_rbac["Role permissions<br/>[rbac.ts]"]
  node_catalogs["Data catalogs<br/>[catalogRegistry.ts]"]
  node_syncengine["Sync and conflict logic<br/>[syncEngine.ts]"]
  node_importactions["Module data actions"]
  node_excelimport["Spreadsheet import"]
  node_validator["Import validation<br/>[validator.ts]"]
  node_excelengine["Spreadsheet engine<br/>[excelEngine.ts]"]
end

subgraph group_integrations["Cloud integrations"]
  node_firebase[("Cloud data services<br/>[services.ts]")]
  node_firebaseconfig["Firebase configuration<br/>[config.ts]"]
  node_googleauth["Google Workspace auth<br/>[googleAuth.ts]"]
  node_googleapi["Google sync routes<br/>[googleRoutes.ts]"]
  node_server["Application server<br/>[server.ts]"]
end

node_user(("School user"))

node_user -->|"uses"| node_app
node_app -->|"renders"| node_login
node_app -->|"manages windows"| node_windowhook
node_app -->|"checks access"| node_rbac
node_app -->|"uses sync logic"| node_syncengine
node_app -->|"writes cloud data"| node_firebase
node_app -->|"disconnects account"| node_googleauth
node_windowhook -->|"resolves app metadata"| node_registry
node_windowmanager -->|"reads app metadata"| node_registry
node_windowmanager -->|"renders managed windows"| node_windowhook
node_registry -.->|"registers app"| node_admin
node_registry -.->|"registers app"| node_schoolapp
node_registry -.->|"registers app"| node_learning
node_registry -.->|"registers app"| node_library
node_registry -.->|"registers app"| node_studentservices
node_registry -.->|"registers app"| node_communications
node_registry -.->|"registers app"| node_facilities
node_registry -.->|"registers app"| node_analytics
node_registry -.->|"registers app"| node_emulation
node_studentservices -->|"filters leave requests"| node_rbac
node_importactions -->|"opens import"| node_excelimport
node_excelimport -->|"validates rows"| node_validator
node_excelimport -->|"parses spreadsheet"| node_excelengine
node_validator -->|"resolves catalog values"| node_catalogs
node_excelengine -->|"builds catalog lists"| node_catalogs
node_firebase -->|"uses configuration"| node_firebaseconfig
node_firebase -->|"uses sync logic"| node_syncengine
node_googleauth -->|"uses configuration"| node_firebaseconfig
node_server -->|"mounts routes"| node_googleapi

click node_app "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/App.tsx"
click node_login "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/auth/LoginScreen.tsx"
click node_windowhook "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/hooks/useWindowManager.ts"
click node_windowmanager "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/desktop/WindowManager.tsx"
click node_registry "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/data/appRegistry.ts"
click node_admin "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/AdministrationApp.tsx"
click node_schoolapp "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/SchoolManagementApp.tsx"
click node_learning "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/LearningApp.tsx"
click node_library "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/LibraryApp.tsx"
click node_studentservices "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/StudentServicesApp.tsx"
click node_communications "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/CommunicationApp.tsx"
click node_facilities "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/FacilitiesApp.tsx"
click node_analytics "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/AnalyticsAIApp.tsx"
click node_emulation "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/emulation/EmulationHubView.tsx"
click node_rbac "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/rbac.ts"
click node_catalogs "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/catalogs/catalogRegistry.ts"
click node_syncengine "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/syncEngine.ts"
click node_importactions "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/importExport/ModuleDataActions.tsx"
click node_excelimport "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/importExport/ExcelImportDialog.tsx"
click node_validator "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/importExport/validator.ts"
click node_excelengine "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/importExport/excelEngine.ts"
click node_firebase "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/firebase/services.ts"
click node_firebaseconfig "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/firebase/config.ts"
click node_googleauth "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/services/googleAuth.ts"
click node_googleapi "https://github.com/thienbaovoquang-hub/vschool/blob/main/src/server/googleRoutes.ts"
click node_server "https://github.com/thienbaovoquang-hub/vschool/blob/main/server.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_app,node_login,node_windowhook,node_windowmanager,node_registry,node_user toneBlue
class node_admin,node_schoolapp,node_learning,node_library,node_studentservices,node_communications,node_facilities,node_analytics,node_emulation toneAmber
class node_rbac,node_catalogs,node_syncengine,node_importactions,node_excelimport,node_validator,node_excelengine toneMint
class node_firebase,node_firebaseconfig,node_googleauth,node_googleapi,node_server toneRose
```

## Components

### Desktop workspace

- [App coordinator](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/App.tsx): `src/App.tsx`
- [Sign-in screen](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/auth/LoginScreen.tsx): `src/components/auth/LoginScreen.tsx`
- [Window manager hook](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/hooks/useWindowManager.ts): `src/hooks/useWindowManager.ts`
- [Window manager](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/desktop/WindowManager.tsx): `src/components/desktop/WindowManager.tsx`
- [App registry](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/data/appRegistry.ts): `src/data/appRegistry.ts`

### School operations

- [Administration](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/AdministrationApp.tsx): `src/components/apps/AdministrationApp.tsx`
- [School management](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/SchoolManagementApp.tsx): `src/components/apps/SchoolManagementApp.tsx`
- [Learning and timetable](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/LearningApp.tsx): `src/components/apps/LearningApp.tsx`
- [Library services](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/LibraryApp.tsx): `src/components/apps/LibraryApp.tsx`
- [Student services](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/StudentServicesApp.tsx): `src/components/apps/StudentServicesApp.tsx`
- [Communications](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/CommunicationApp.tsx): `src/components/apps/CommunicationApp.tsx`
- [Facilities](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/FacilitiesApp.tsx): `src/components/apps/FacilitiesApp.tsx`
- [Analytics and AI](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/apps/AnalyticsAIApp.tsx): `src/components/apps/AnalyticsAIApp.tsx`
- [Emulation and competitions](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/emulation/EmulationHubView.tsx): `src/components/emulation/EmulationHubView.tsx`

### Data and access

- [Role permissions](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/rbac.ts): `src/utils/rbac.ts`
- [Data catalogs](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/catalogs/catalogRegistry.ts): `src/utils/catalogs/catalogRegistry.ts`
- [Sync and conflict logic](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/syncEngine.ts): `src/utils/syncEngine.ts`
- [Module data actions](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/importExport/ModuleDataActions.tsx): `src/components/importExport/ModuleDataActions.tsx`
- [Spreadsheet import](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/components/importExport/ExcelImportDialog.tsx): `src/components/importExport/ExcelImportDialog.tsx`
- [Import validation](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/importExport/validator.ts): `src/utils/importExport/validator.ts`
- [Spreadsheet engine](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/utils/importExport/excelEngine.ts): `src/utils/importExport/excelEngine.ts`

### Cloud integrations

- [Cloud data services](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/firebase/services.ts): `src/firebase/services.ts`
- [Firebase configuration](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/firebase/config.ts): `src/firebase/config.ts`
- [Google Workspace auth](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/services/googleAuth.ts): `src/services/googleAuth.ts`
- [Google sync routes](https://github.com/thienbaovoquang-hub/vschool/blob/main/src/server/googleRoutes.ts): `src/server/googleRoutes.ts`
- [Application server](https://github.com/thienbaovoquang-hub/vschool/blob/main/server.ts): `server.ts`

### Other components

- **School user**

## Connections

- School user → App coordinator: uses (evidence: `src/App.tsx`)
- App coordinator → Sign-in screen: renders (evidence: `src/App.tsx`)
- App coordinator → Window manager hook: manages windows (evidence: `src/App.tsx`)
- App coordinator → Role permissions: checks access (evidence: `src/App.tsx`)
- App coordinator → Sync and conflict logic: uses sync logic (evidence: `src/App.tsx`)
- App coordinator → Cloud data services: writes cloud data (evidence: `src/App.tsx`)
- App coordinator → Google Workspace auth: disconnects account (evidence: `src/App.tsx`)
- Window manager hook → App registry: resolves app metadata (evidence: `src/hooks/useWindowManager.ts`)
- Window manager → App registry: reads app metadata (evidence: `src/components/desktop/WindowManager.tsx`)
- Window manager → Window manager hook: renders managed windows (evidence: `src/components/desktop/WindowManager.tsx`)
- App registry → Administration: registers app
- App registry → School management: registers app
- App registry → Learning and timetable: registers app
- App registry → Library services: registers app
- App registry → Student services: registers app
- App registry → Communications: registers app
- App registry → Facilities: registers app
- App registry → Analytics and AI: registers app
- App registry → Emulation and competitions: registers app
- Student services → Role permissions: filters leave requests (evidence: `src/components/apps/StudentServicesApp.tsx`)
- Module data actions → Spreadsheet import: opens import (evidence: `src/components/importExport/ModuleDataActions.tsx`)
- Spreadsheet import → Import validation: validates rows (evidence: `src/components/importExport/ExcelImportDialog.tsx`)
- Spreadsheet import → Spreadsheet engine: parses spreadsheet (evidence: `src/components/importExport/ExcelImportDialog.tsx`)
- Import validation → Data catalogs: resolves catalog values (evidence: `src/utils/importExport/validator.ts`)
- Spreadsheet engine → Data catalogs: builds catalog lists (evidence: `src/utils/importExport/excelEngine.ts`)
- Cloud data services → Firebase configuration: uses configuration (evidence: `src/firebase/services.ts`)
- Cloud data services → Sync and conflict logic: uses sync logic (evidence: `src/firebase/services.ts`)
- Google Workspace auth → Firebase configuration: uses configuration (evidence: `src/services/googleAuth.ts`)
- Application server → Google sync routes: mounts routes (evidence: `server.ts`)
