# abduoqb/math-magie architecture

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

- Interactive diagram: https://gitdiagram.com/abduoqb/math-magie
- Repository: https://github.com/abduoqb/math-magie

## Overview

Mathémagie is a static French maths-practice site for pupils from CP to CM2, with family profiles and optional cloud synchronisation. The main journey is: select a learner and class, use that class’s programme to access an exercise or game, generate and run practice, then retain progress locally and optionally sync it. The graph covers the documented learning domains and profile services. Some subsystem links are documented in the README; unsampled source leaves additional implementation relationships unverified.

Main entry points: [`jeux/commun.js`](https://github.com/abduoqb/math-magie/blob/main/jeux/commun.js) (Game helpers), [`programmes`](https://github.com/abduoqb/math-magie/tree/main/programmes) (Class programmes), [`js/profils-core.js`](https://github.com/abduoqb/math-magie/blob/main/js/profils-core.js) (Profile manager), [`js/profils.js`](https://github.com/abduoqb/math-magie/blob/main/js/profils.js) (Profile loader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_profiles["Profiles and access"]
  node_profile["Profile manager<br/>[profils-core.js]"]
  node_profile_loader["Profile loader<br/>[profils.js]"]
  node_auth["Code access guard<br/>[auth.js]"]
  node_sync["Profile sync<br/>[sync.js]"]
  node_supabase["Supabase<br/>[supabase-config.js]"]
end

subgraph group_curriculum["Curriculum"]
  node_programmes["Class programmes"]
  node_levels["Class levels<br/>[niveaux.js]"]
end

subgraph group_practice["Maths practice"]
  node_calcul["Mental calculation<br/>[moteur_calcul.js]"]
  node_calcul_gen["Calculation generator"]
  node_operations["Operation exercises"]
  node_geometry["Geometry engine"]
  node_geo_programme["Geometry programme<br/>[programme_geo.js]"]
  node_geo_bank["Geometry question banks<br/>[banque_geo.js]"]
  node_geo_missions["Geometry missions"]
  node_measure_gen["Measures generator"]
  node_measure_engine["Measures engine"]
  node_number_gen["Numbers generator"]
  node_number_engine["Numbers engine<br/>[moteur_nombres.js]"]
end

subgraph group_games["Magical games"]
  node_game_common["Game helpers<br/>[commun.js]"]
  node_magic_count["Magic counting<br/>[compte-magique.js]"]
  node_lightning["Lightning game<br/>[eclair.js]"]
  node_fractions["Magic pizzas<br/>[fractions.js]"]
  node_clock["Enchanted clock<br/>[horloge.js]"]
  node_market["Wizard market<br/>[marche.js]"]
  node_memory["Number memory<br/>[memory-nombres.js]"]
  node_sorting["Number sorting<br/>[ranger.js]"]
  node_magic_sequences["Magic sequences<br/>[suites-magiques.js]"]
end

subgraph group_services["Shared services"]
  node_voice["Voice support<br/>[voix.js]"]
end

node_pupil(("Pupil"))
node_family(("Family"))

node_family -->|"manages profiles"| node_profile
node_pupil -->|"selects profile"| node_profile
node_profile_loader -->|"loads scripts"| node_profile
node_profile_loader -->|"loads"| node_voice
node_profile_loader -->|"loads class data"| node_programmes
node_auth -->|"guards access"| node_profile
node_profile -.->|"syncs profiles"| node_sync
node_sync -.->|"connects optionally"| node_supabase
node_profile -->|"uses class"| node_programmes
node_levels -->|"resolves programme"| node_programmes
node_calcul -->|"generates questions"| node_calcul_gen
node_operations -->|"runs operation"| node_calcul
node_calcul -->|"reads levels"| node_programmes
node_geometry -->|"reads programme"| node_geo_programme
node_geo_programme -->|"reads class data"| node_programmes
node_geometry -->|"uses question banks"| node_geo_bank
node_geo_missions -->|"runs missions"| node_geometry
node_measure_engine -->|"generates questions"| node_measure_gen
node_measure_engine -->|"reads levels"| node_programmes
node_number_engine -->|"generates questions"| node_number_gen
node_number_engine -->|"reads levels"| node_programmes
node_game_common -->|"provides class settings"| node_programmes
node_magic_count -->|"uses game settings"| node_game_common
node_lightning -.->|"uses game settings"| node_game_common
node_fractions -.->|"uses game settings"| node_game_common
node_clock -.->|"uses game settings"| node_game_common
node_market -.->|"uses game settings"| node_game_common
node_memory -.->|"uses game settings"| node_game_common
node_sorting -.->|"uses game settings"| node_game_common
node_magic_sequences -.->|"uses game settings"| node_game_common

click node_profile "https://github.com/abduoqb/math-magie/blob/main/js/profils-core.js"
click node_profile_loader "https://github.com/abduoqb/math-magie/blob/main/js/profils.js"
click node_auth "https://github.com/abduoqb/math-magie/blob/main/js/auth.js"
click node_sync "https://github.com/abduoqb/math-magie/blob/main/js/sync.js"
click node_supabase "https://github.com/abduoqb/math-magie/blob/main/js/supabase-config.js"
click node_programmes "https://github.com/abduoqb/math-magie/tree/main/programmes"
click node_levels "https://github.com/abduoqb/math-magie/blob/main/js/niveaux.js"
click node_calcul "https://github.com/abduoqb/math-magie/blob/main/calculs_mentaux/js/moteur_calcul.js"
click node_calcul_gen "https://github.com/abduoqb/math-magie/blob/main/calculs_mentaux/js/generateur_calcul.js"
click node_operations "https://github.com/abduoqb/math-magie/tree/main/calculs_mentaux"
click node_geometry "https://github.com/abduoqb/math-magie/blob/main/geometrie/js/moteur_geometrie.js"
click node_geo_programme "https://github.com/abduoqb/math-magie/blob/main/geometrie/js/programme_geo.js"
click node_geo_bank "https://github.com/abduoqb/math-magie/blob/main/geometrie/js/banque_geo.js"
click node_geo_missions "https://github.com/abduoqb/math-magie/tree/main/geometrie"
click node_measure_gen "https://github.com/abduoqb/math-magie/blob/main/grandeurs/js/generateur_grandeurs.js"
click node_measure_engine "https://github.com/abduoqb/math-magie/blob/main/grandeurs/js/moteur_grandeurs.js"
click node_number_gen "https://github.com/abduoqb/math-magie/blob/main/nombres/js/generateur_nombres.js"
click node_number_engine "https://github.com/abduoqb/math-magie/blob/main/nombres/js/moteur_nombres.js"
click node_game_common "https://github.com/abduoqb/math-magie/blob/main/jeux/commun.js"
click node_magic_count "https://github.com/abduoqb/math-magie/blob/main/jeux/compte-magique/compte-magique.js"
click node_lightning "https://github.com/abduoqb/math-magie/blob/main/jeux/eclair/eclair.js"
click node_fractions "https://github.com/abduoqb/math-magie/blob/main/jeux/fractions/fractions.js"
click node_clock "https://github.com/abduoqb/math-magie/blob/main/jeux/horloge/horloge.js"
click node_market "https://github.com/abduoqb/math-magie/blob/main/jeux/marche/marche.js"
click node_memory "https://github.com/abduoqb/math-magie/blob/main/jeux/memory-nombres/memory-nombres.js"
click node_sorting "https://github.com/abduoqb/math-magie/blob/main/jeux/ranger/ranger.js"
click node_magic_sequences "https://github.com/abduoqb/math-magie/blob/main/jeux/suites-magiques/suites-magiques.js"
click node_voice "https://github.com/abduoqb/math-magie/blob/main/js/voix.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_profile,node_profile_loader,node_auth,node_sync,node_supabase toneBlue
class node_programmes,node_levels toneAmber
class node_calcul,node_calcul_gen,node_operations,node_geometry,node_geo_programme,node_geo_bank,node_geo_missions,node_measure_gen,node_measure_engine,node_number_gen,node_number_engine toneMint
class node_game_common,node_magic_count,node_lightning,node_fractions,node_clock,node_market,node_memory,node_sorting,node_magic_sequences toneRose
class node_voice,node_pupil,node_family toneIndigo
```

## Components

### Profiles and access

- [Profile manager](https://github.com/abduoqb/math-magie/blob/main/js/profils-core.js): `js/profils-core.js`
- [Profile loader](https://github.com/abduoqb/math-magie/blob/main/js/profils.js): `js/profils.js`
- [Code access guard](https://github.com/abduoqb/math-magie/blob/main/js/auth.js): `js/auth.js`
- [Profile sync](https://github.com/abduoqb/math-magie/blob/main/js/sync.js): `js/sync.js`
- [Supabase](https://github.com/abduoqb/math-magie/blob/main/js/supabase-config.js): `js/supabase-config.js`

### Curriculum

- [Class programmes](https://github.com/abduoqb/math-magie/tree/main/programmes): `programmes`
- [Class levels](https://github.com/abduoqb/math-magie/blob/main/js/niveaux.js): `js/niveaux.js`

### Maths practice

- [Mental calculation](https://github.com/abduoqb/math-magie/blob/main/calculs_mentaux/js/moteur_calcul.js): `calculs_mentaux/js/moteur_calcul.js`
- [Calculation generator](https://github.com/abduoqb/math-magie/blob/main/calculs_mentaux/js/generateur_calcul.js): `calculs_mentaux/js/generateur_calcul.js`
- [Operation exercises](https://github.com/abduoqb/math-magie/tree/main/calculs_mentaux): `calculs_mentaux`
- [Geometry engine](https://github.com/abduoqb/math-magie/blob/main/geometrie/js/moteur_geometrie.js): `geometrie/js/moteur_geometrie.js`
- [Geometry programme](https://github.com/abduoqb/math-magie/blob/main/geometrie/js/programme_geo.js): `geometrie/js/programme_geo.js`
- [Geometry question banks](https://github.com/abduoqb/math-magie/blob/main/geometrie/js/banque_geo.js): `geometrie/js/banque_geo.js`
- [Geometry missions](https://github.com/abduoqb/math-magie/tree/main/geometrie): `geometrie`
- [Measures generator](https://github.com/abduoqb/math-magie/blob/main/grandeurs/js/generateur_grandeurs.js): `grandeurs/js/generateur_grandeurs.js`
- [Measures engine](https://github.com/abduoqb/math-magie/blob/main/grandeurs/js/moteur_grandeurs.js): `grandeurs/js/moteur_grandeurs.js`
- [Numbers generator](https://github.com/abduoqb/math-magie/blob/main/nombres/js/generateur_nombres.js): `nombres/js/generateur_nombres.js`
- [Numbers engine](https://github.com/abduoqb/math-magie/blob/main/nombres/js/moteur_nombres.js): `nombres/js/moteur_nombres.js`

### Magical games

- [Game helpers](https://github.com/abduoqb/math-magie/blob/main/jeux/commun.js): `jeux/commun.js`
- [Magic counting](https://github.com/abduoqb/math-magie/blob/main/jeux/compte-magique/compte-magique.js): `jeux/compte-magique/compte-magique.js`
- [Lightning game](https://github.com/abduoqb/math-magie/blob/main/jeux/eclair/eclair.js): `jeux/eclair/eclair.js`
- [Magic pizzas](https://github.com/abduoqb/math-magie/blob/main/jeux/fractions/fractions.js): `jeux/fractions/fractions.js`
- [Enchanted clock](https://github.com/abduoqb/math-magie/blob/main/jeux/horloge/horloge.js): `jeux/horloge/horloge.js`
- [Wizard market](https://github.com/abduoqb/math-magie/blob/main/jeux/marche/marche.js): `jeux/marche/marche.js`
- [Number memory](https://github.com/abduoqb/math-magie/blob/main/jeux/memory-nombres/memory-nombres.js): `jeux/memory-nombres/memory-nombres.js`
- [Number sorting](https://github.com/abduoqb/math-magie/blob/main/jeux/ranger/ranger.js): `jeux/ranger/ranger.js`
- [Magic sequences](https://github.com/abduoqb/math-magie/blob/main/jeux/suites-magiques/suites-magiques.js): `jeux/suites-magiques/suites-magiques.js`

### Shared services

- [Voice support](https://github.com/abduoqb/math-magie/blob/main/js/voix.js): `js/voix.js`

### Other components

- **Pupil**
- **Family**

## Connections

- Family → Profile manager: manages profiles
- Pupil → Profile manager: selects profile
- Profile loader → Profile manager: loads scripts
- Profile loader → Voice support: loads
- Profile loader → Class programmes: loads class data
- Code access guard → Profile manager: guards access
- Profile manager → Profile sync: syncs profiles
- Profile sync → Supabase: connects optionally
- Profile manager → Class programmes: uses class
- Class levels → Class programmes: resolves programme
- Mental calculation → Calculation generator: generates questions
- Operation exercises → Mental calculation: runs operation
- Mental calculation → Class programmes: reads levels
- Geometry engine → Geometry programme: reads programme
- Geometry programme → Class programmes: reads class data
- Geometry engine → Geometry question banks: uses question banks
- Geometry missions → Geometry engine: runs missions
- Measures engine → Measures generator: generates questions
- Measures engine → Class programmes: reads levels
- Numbers engine → Numbers generator: generates questions
- Numbers engine → Class programmes: reads levels
- Game helpers → Class programmes: provides class settings
- Magic counting → Game helpers: uses game settings
- Lightning game → Game helpers: uses game settings
- Magic pizzas → Game helpers: uses game settings
- Enchanted clock → Game helpers: uses game settings
- Wizard market → Game helpers: uses game settings
- Number memory → Game helpers: uses game settings
- Number sorting → Game helpers: uses game settings
- Magic sequences → Game helpers: uses game settings
