# christianobourguignon/maisfluent architecture

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

- Interactive diagram: https://gitdiagram.com/christianobourguignon/maisfluent
- Repository: https://github.com/christianobourguignon/maisfluent

## Overview

MaisFluent is a multi-tenant school-management SaaS with a React tenant SPA, Laravel business API, and separate Laravel control plane. The core flow is a school user working in the SPA, whose API request is tenant-resolved and authorized before academic, assessment, or financial operations; results return to the SPA. The README also documents platform provisioning, library, communications, and billing capabilities. Edges are limited to relationships visible in excerpts or stated explicitly in the README; many domain branches are documented but their internal calls were not sampled.

Main entry points: [`Code/backend/routes/api.php`](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/routes/api.php) (Business API), [`Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php`](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php) (Platform API), [`Code/backend/app/Models/ClassRoom.php`](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/ClassRoom.php) (Class model), [`Code/backend/app/Http/Controllers/Api/V1/LessonController.php`](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/LessonController.php) (Lesson operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_tenant["Tenant experience"]
  node_spa["Tenant SPA<br/>[App.tsx]"]
  node_api_client["API client<br/>[api-client.ts]"]
end

subgraph group_academic["Academic operations"]
  node_class_invites["Classes and invites"]
  node_classes["Class model<br/>[ClassRoom.php]"]
  node_enrollments["Enrollments<br/>[Enrollment.php]"]
  node_lessons["Lesson operations"]
  node_lesson_model[("Lesson records<br/>[Lesson.php]")]
  node_assignments["Tasks and assessments"]
  node_submissions["Submission and grading"]
  node_library["Library and questions"]
  node_communications["Communications"]
end

subgraph group_finance["Finance and platform"]
  node_finance_engine["Finance engine<br/>[FinanceEngine.php]"]
  node_finance_api["Tenant finance API"]
  node_platform_panel["Control plane"]
  node_platform_api["Platform API"]
end

subgraph group_shared["Shared backend"]
  node_api["Business API<br/>[api.php]"]
  node_tenant_resolution["Tenant resolution<br/>[ResolveTenant.php]"]
  node_tenant_context["Tenant context<br/>[TenantContext.php]"]
  node_entitlements["Module entitlements"]
  node_audit["Audit logging<br/>[AuditLogger.php]"]
end

node_school_user(("School user"))
node_postgres[("PostgreSQL")]
node_redis["Redis queues"]
node_email_provider["Email provider"]
node_bbb["BigBlueButton"]

node_school_user -->|"uses"| node_spa
node_spa -->|"requests through"| node_api_client
node_api_client -.->|"calls"| node_api
node_api -->|"resolves tenant"| node_tenant_resolution
node_tenant_resolution -.->|"sets context"| node_tenant_context
node_tenant_context -->|"identifies company"| node_postgres
node_api -.->|"routes requests"| node_class_invites
node_class_invites -->|"queries class"| node_classes
node_classes -->|"has enrollments"| node_enrollments
node_api -.->|"routes requests"| node_lessons
node_lessons -->|"creates and updates"| node_lesson_model
node_classes -->|"has lessons"| node_lesson_model
node_api -.->|"routes requests"| node_assignments
node_api -.->|"routes requests"| node_submissions
node_api -.->|"routes requests"| node_library
node_api -.->|"routes requests"| node_finance_api
node_lessons -->|"syncs lesson revenue"| node_finance_engine
node_finance_api -.->|"reports finance"| node_finance_engine
node_api -.->|"routes platform requests"| node_platform_api
node_platform_panel -->|"calls API"| node_platform_api
node_platform_api -->|"reads entitlements"| node_entitlements
node_platform_api -->|"records actions"| node_audit
node_finance_engine -->|"writes finance records"| node_postgres
node_communications -->|"queues email jobs"| node_redis
node_communications -.->|"sends mail"| node_email_provider
node_api -.->|"integrates live classes"| node_bbb

click node_spa "https://github.com/christianobourguignon/maisfluent/blob/master/Code/frontend/src/App.tsx"
click node_api_client "https://github.com/christianobourguignon/maisfluent/blob/master/Code/frontend/src/lib/api-client.ts"
click node_api "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/routes/api.php"
click node_tenant_resolution "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Middleware/ResolveTenant.php"
click node_tenant_context "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Domain/Tenant/TenantContext.php"
click node_class_invites "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/ClassInviteController.php"
click node_classes "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/ClassRoom.php"
click node_enrollments "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/Enrollment.php"
click node_lessons "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/LessonController.php"
click node_lesson_model "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/Lesson.php"
click node_assignments "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/AssignmentController.php"
click node_submissions "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/SubmissionController.php"
click node_library "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/PublicLibraryController.php"
click node_communications "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/NotificationService.php"
click node_finance_engine "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/FinanceEngine.php"
click node_finance_api "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/FinancialReportController.php"
click node_platform_panel "https://github.com/christianobourguignon/maisfluent/blob/master/Code/painel/app/Http/Controllers/PlatformController.php"
click node_platform_api "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php"
click node_entitlements "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/ModuleEntitlementService.php"
click node_audit "https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/AuditLogger.php"

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_spa,node_api_client,node_school_user toneBlue
class node_class_invites,node_classes,node_enrollments,node_lessons,node_lesson_model,node_assignments,node_submissions,node_library,node_communications,node_postgres,node_redis toneAmber
class node_finance_engine,node_finance_api,node_platform_panel,node_platform_api toneMint
class node_api,node_tenant_resolution,node_tenant_context,node_entitlements,node_audit toneRose
class node_email_provider,node_bbb toneIndigo
```

## Components

### Tenant experience

- [Tenant SPA](https://github.com/christianobourguignon/maisfluent/blob/master/Code/frontend/src/App.tsx): `Code/frontend/src/App.tsx`
- [API client](https://github.com/christianobourguignon/maisfluent/blob/master/Code/frontend/src/lib/api-client.ts): `Code/frontend/src/lib/api-client.ts`

### Academic operations

- [Classes and invites](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/ClassInviteController.php): `Code/backend/app/Http/Controllers/Api/V1/ClassInviteController.php`
- [Class model](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/ClassRoom.php): `Code/backend/app/Models/ClassRoom.php`
- [Enrollments](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/Enrollment.php): `Code/backend/app/Models/Enrollment.php`
- [Lesson operations](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/LessonController.php): `Code/backend/app/Http/Controllers/Api/V1/LessonController.php`
- [Lesson records](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Models/Lesson.php): `Code/backend/app/Models/Lesson.php`
- [Tasks and assessments](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/AssignmentController.php): `Code/backend/app/Http/Controllers/Api/V1/AssignmentController.php`
- [Submission and grading](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/SubmissionController.php): `Code/backend/app/Http/Controllers/Api/V1/SubmissionController.php`
- [Library and questions](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/PublicLibraryController.php): `Code/backend/app/Http/Controllers/Api/V1/PublicLibraryController.php`
- [Communications](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/NotificationService.php): `Code/backend/app/Services/NotificationService.php`

### Finance and platform

- [Finance engine](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/FinanceEngine.php): `Code/backend/app/Services/FinanceEngine.php`
- [Tenant finance API](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/V1/FinancialReportController.php): `Code/backend/app/Http/Controllers/Api/V1/FinancialReportController.php`
- [Control plane](https://github.com/christianobourguignon/maisfluent/blob/master/Code/painel/app/Http/Controllers/PlatformController.php): `Code/painel/app/Http/Controllers/PlatformController.php`
- [Platform API](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php): `Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php`

### Shared backend

- [Business API](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/routes/api.php): `Code/backend/routes/api.php`
- [Tenant resolution](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Http/Middleware/ResolveTenant.php): `Code/backend/app/Http/Middleware/ResolveTenant.php`
- [Tenant context](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Domain/Tenant/TenantContext.php): `Code/backend/app/Domain/Tenant/TenantContext.php`
- [Module entitlements](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/ModuleEntitlementService.php): `Code/backend/app/Services/ModuleEntitlementService.php`
- [Audit logging](https://github.com/christianobourguignon/maisfluent/blob/master/Code/backend/app/Services/AuditLogger.php): `Code/backend/app/Services/AuditLogger.php`

### Other components

- **School user**
- **PostgreSQL**
- **Redis queues**
- **Email provider**
- **BigBlueButton**

## Connections

- School user → Tenant SPA: uses
- Tenant SPA → API client: requests through (evidence: `Code/frontend/src/App.tsx`)
- API client → Business API: calls
- Business API → Tenant resolution: resolves tenant
- Tenant resolution → Tenant context: sets context
- Tenant context → PostgreSQL: identifies company (evidence: `Code/backend/app/Domain/Tenant/TenantContext.php`)
- Business API → Classes and invites: routes requests
- Classes and invites → Class model: queries class (evidence: `Code/backend/app/Http/Controllers/Api/V1/ClassInviteController.php`)
- Class model → Enrollments: has enrollments (evidence: `Code/backend/app/Models/ClassRoom.php`)
- Business API → Lesson operations: routes requests
- Lesson operations → Lesson records: creates and updates (evidence: `Code/backend/app/Http/Controllers/Api/V1/LessonController.php`)
- Class model → Lesson records: has lessons (evidence: `Code/backend/app/Models/ClassRoom.php`)
- Business API → Tasks and assessments: routes requests
- Business API → Submission and grading: routes requests
- Business API → Library and questions: routes requests
- Business API → Tenant finance API: routes requests
- Lesson operations → Finance engine: syncs lesson revenue (evidence: `Code/backend/app/Http/Controllers/Api/V1/LessonController.php`)
- Tenant finance API → Finance engine: reports finance
- Business API → Platform API: routes platform requests
- Control plane → Platform API: calls API (evidence: `Code/painel/app/Http/Controllers/PlatformController.php`)
- Platform API → Module entitlements: reads entitlements (evidence: `Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php`)
- Platform API → Audit logging: records actions (evidence: `Code/backend/app/Http/Controllers/Api/Platform/PlatformController.php`)
- Finance engine → PostgreSQL: writes finance records (evidence: `Code/backend/app/Services/FinanceEngine.php`)
- Communications → Redis queues: queues email jobs (evidence: `Code/backend/app/Services/NotificationService.php`)
- Communications → Email provider: sends mail
- Business API → BigBlueButton: integrates live classes
