# tibotsr/calendrier-france-ics architecture

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

- Interactive diagram: https://gitdiagram.com/tibotsr/calendrier-france-ics
- Repository: https://github.com/tibotsr/calendrier-france-ics

## Overview

#### Purpose and entry points
Calendrier Complet France generates and publishes French calendar data as ICS, JSON, CSV, XML, and profile/education-zone feeds, with a static browser UI and Vercel serverless APIs. Main generation entry point: `calendrier.py`; generation orchestration: `calendar_core/generator.py`. Public UI starts at `index.html`; dynamic ICS begins at `api/calendrier.ics.js`.

#### Calendar domain model and configuration
`calendar_core/models.py` defines the event representation shared through collection, filtering, and export. `calendar_core/config.py` centralizes calendar constants and profile definitions. Date manipulation and shared domain calculations reside in `calendar_core/utils.py`.

#### Event acquisition and composition
`calendar_core/providers.py` is the primary aggregation boundary for event sources. It composes internal specialist domains: holidays and celebrations (`calendar_core/society/holidays.py`, `calendar_core/society/celebrations.py`), school/exam schedules (`calendar_core/education/vacations.py`, `calendar_core/education/exams.py`), sports (`calendar_core/sports/football.py`), astronomy (`calendar_core/astronomy/moon.py`, `calendar_core/astronomy/seasons.py`), elections, and wiki-backed content (`calendar_core/elections.py`, `calendar_core/wiki/api.py`).

#### Generation and export pipeline
`calendrier.py` invokes the core pipeline, which gathers normalized events, applies zone/profile/category decisions, and writes repository-root artifacts. `calendar_core/generator.py` controls output production; `calendar_core/exporters.py` serializes ICS and related output forms; `calendar_core/parsers.py` supports input parsing. Principal generated/public artifacts include `calendrier.ics`, `calendrier.json`, `events-meta.json`, and zone feeds such as `zone-a.ics`.

#### Data and mutable content boundary
Curated and operational source data is versioned under `calendar_core/data/`, including `calendar_core/data/exams.json`, `calendar_core/data/sports.json`, and `calendar_core/data/pending_events.json`. Wiki retrieval has an explicit cache layer in `calendar_core/wiki/cache.py`, separating external content access from generation. Repository-root `zone-departments.json` supports geographic school-zone mapping.

#### Static client application
The client is a vanilla static application rooted at `index.html`, styled through `assets/css/styles.css`, and coordinated by `assets/js/app.js`. UI state and synchronization are separated into `assets/js/state.js` and `assets/js/sync.js`; calendar visualization and exploration are handled by `assets/js/calendar-grid.js` and `assets/js/explorer.js`. It consumes generated calendar artifacts and API responses rather than owning calendar generation logic.

#### Serverless API and administration
Vercel functions in `api/` expose calendar data and interactive features. Dynamic feed generation is implemented by `api/calendrier.ics.js`; pending/community event flows use `api/pending-events.js` and `api/suggestions.js`; rendered event pages use `api/event-page.js`. Administrative browser surfaces are under `admin/`, with auth and calendar/data management endpoints in `api/admin-auth.js`, `api/admin-calendar.js`, and `api/admin-data.js`.

#### Delivery and runtime infrastructure
Python is the generation runtime; browser JavaScript serves the static UI; Node/Vercel functions serve dynamic APIs. `vercel.json` configures Vercel deployment behavior. `.github/workflows/update_ics.yml` automates regeneration/publication on schedule, pushes, and manual dispatch. The site also includes PWA deployment assets (`manifest.json`, `sw.js`) and static hosting markers (`CNAME`).

Main entry points: [`calendar_core/generator.py`](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/generator.py) (Generation pipeline), [`vercel.json`](https://github.com/tibotsr/calendrier-france-ics/blob/main/vercel.json) (Vercel deployment), [`calendar_core/providers.py`](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/providers.py) (Event provider aggregation), [`index.html`](https://github.com/tibotsr/calendrier-france-ics/blob/main/index.html) (Browser application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_generation["Python generation"]
  node_cli["Calendar generator CLI<br/>Python entry point<br/>[calendrier.py]"]
  node_generator["Generation pipeline<br/>Python orchestration<br/>[generator.py]"]
  node_domain["Calendar domain<br/>models and rules<br/>[models.py]"]
  node_config["Profiles and constants<br/>configuration<br/>[config.py]"]
  node_exporters["Export serializers<br/>ICS and data export<br/>[exporters.py]"]
  node_artifacts["Published calendar artifacts<br/>generated feeds<br/>[calendrier.ics]"]
end

subgraph group_sources["Event sources"]
  node_providers{{"Event provider aggregation<br/>source composition<br/>[providers.py]"}}
  node_specialist_sources["Specialist event domains<br/>holidays, education, sport, astronomy<br/>[holidays.py]"]
  node_external_content["Elections and wiki content<br/>external-content sources<br/>[elections.py]"]
  node_wiki_cache[("Wiki cache<br/>content cache<br/>[cache.py]")]
  node_curated_data[("Curated source data<br/>versioned data")]
end

subgraph group_client["Static client"]
  node_web_app["Browser application<br/>static HTML<br/>[index.html]"]
  node_client_coordination["UI state and sync<br/>browser coordination<br/>[app.js]"]
  node_calendar_ui["Calendar explorer<br/>browser views<br/>[calendar-grid.js]"]
end

subgraph group_api["Vercel APIs"]
  node_dynamic_feed{{"Dynamic ICS feed<br/>Vercel function<br/>[calendrier.ics.js]"}}
  node_community_api["Community event APIs<br/>Vercel functions<br/>[pending-events.js]"]
  node_admin["Administration<br/>admin UI and APIs"]
end

subgraph group_delivery["Delivery"]
  node_deployment{{"Vercel deployment<br/>hosting configuration<br/>[vercel.json]"}}
  node_automation["Scheduled publication<br/>GitHub Actions workflow<br/>[update_ics.yml]"]
end

node_cli -->|"invokes"| node_generator
node_generator -->|"uses events"| node_domain
node_generator -->|"applies profiles"| node_config
node_generator -->|"collects"| node_providers
node_providers -->|"composes"| node_specialist_sources
node_providers -->|"collects"| node_external_content
node_external_content -->|"caches retrieval"| node_wiki_cache
node_providers -->|"reads"| node_curated_data
node_generator -->|"serializes through"| node_exporters
node_exporters -->|"writes"| node_artifacts
node_automation -->|"runs generation"| node_cli
node_web_app -->|"boots"| node_client_coordination
node_client_coordination -->|"coordinates"| node_calendar_ui
node_calendar_ui -->|"loads feeds"| node_artifacts
node_web_app -->|"requests dynamic ICS"| node_dynamic_feed
node_web_app -->|"submits events"| node_community_api
node_community_api -->|"manages pending data"| node_curated_data
node_admin -->|"reviews content"| node_community_api
node_deployment -->|"hosts"| node_web_app
node_deployment -->|"runs"| node_dynamic_feed
node_deployment -->|"runs"| node_community_api
node_deployment -->|"serves"| node_admin

click node_cli "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendrier.py"
click node_generator "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/generator.py"
click node_domain "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/models.py"
click node_config "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/config.py"
click node_providers "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/providers.py"
click node_specialist_sources "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/society/holidays.py"
click node_external_content "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/elections.py"
click node_wiki_cache "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/wiki/cache.py"
click node_exporters "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/exporters.py"
click node_artifacts "https://github.com/tibotsr/calendrier-france-ics/blob/main/calendrier.ics"
click node_web_app "https://github.com/tibotsr/calendrier-france-ics/blob/main/index.html"
click node_client_coordination "https://github.com/tibotsr/calendrier-france-ics/blob/main/assets/js/app.js"
click node_calendar_ui "https://github.com/tibotsr/calendrier-france-ics/blob/main/assets/js/calendar-grid.js"
click node_dynamic_feed "https://github.com/tibotsr/calendrier-france-ics/blob/main/api/calendrier.ics.js"
click node_community_api "https://github.com/tibotsr/calendrier-france-ics/blob/main/api/pending-events.js"
click node_deployment "https://github.com/tibotsr/calendrier-france-ics/blob/main/vercel.json"
click node_automation "https://github.com/tibotsr/calendrier-france-ics/blob/main/.github/workflows/update_ics.yml"

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_cli,node_generator,node_domain,node_config,node_exporters,node_artifacts toneBlue
class node_providers,node_specialist_sources,node_external_content,node_wiki_cache,node_curated_data toneAmber
class node_web_app,node_client_coordination,node_calendar_ui toneMint
class node_dynamic_feed,node_community_api,node_admin toneRose
class node_deployment,node_automation toneIndigo
```

## Components

### Python generation

- [Calendar generator CLI](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendrier.py): Python entry point · `calendrier.py`
- [Generation pipeline](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/generator.py): Python orchestration · Collects, filters, and produces calendar outputs. · `calendar_core/generator.py`
- [Calendar domain](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/models.py): models and rules · `calendar_core/models.py`
- [Profiles and constants](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/config.py): configuration · `calendar_core/config.py`
- [Export serializers](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/exporters.py): ICS and data export · `calendar_core/exporters.py`
- [Published calendar artifacts](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendrier.ics): generated feeds · ICS, JSON, metadata, and school-zone feeds. · `calendrier.ics`

### Event sources

- [Event provider aggregation](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/providers.py): source composition · `calendar_core/providers.py`
- [Specialist event domains](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/society/holidays.py): holidays, education, sport, astronomy · Includes holidays, celebrations, vacations, exams, football, moon, and seasons. · `calendar_core/society/holidays.py`
- [Elections and wiki content](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/elections.py): external-content sources · `calendar_core/elections.py`
- [Wiki cache](https://github.com/tibotsr/calendrier-france-ics/blob/main/calendar_core/wiki/cache.py): content cache · `calendar_core/wiki/cache.py`
- **Curated source data**: versioned data · Exam, sports, and pending-event data.

### Static client

- [Browser application](https://github.com/tibotsr/calendrier-france-ics/blob/main/index.html): static HTML · `index.html`
- [UI state and sync](https://github.com/tibotsr/calendrier-france-ics/blob/main/assets/js/app.js): browser coordination · `assets/js/app.js`
- [Calendar explorer](https://github.com/tibotsr/calendrier-france-ics/blob/main/assets/js/calendar-grid.js): browser views · `assets/js/calendar-grid.js`

### Vercel APIs

- [Dynamic ICS feed](https://github.com/tibotsr/calendrier-france-ics/blob/main/api/calendrier.ics.js): Vercel function · `api/calendrier.ics.js`
- [Community event APIs](https://github.com/tibotsr/calendrier-france-ics/blob/main/api/pending-events.js): Vercel functions · Accepts pending events and suggestions. · `api/pending-events.js`
- **Administration**: admin UI and APIs · Authentication plus calendar and data management.

### Delivery

- [Vercel deployment](https://github.com/tibotsr/calendrier-france-ics/blob/main/vercel.json): hosting configuration · `vercel.json`
- [Scheduled publication](https://github.com/tibotsr/calendrier-france-ics/blob/main/.github/workflows/update_ics.yml): GitHub Actions workflow · Regenerates and publishes feeds on schedule, push, or dispatch. · `.github/workflows/update_ics.yml`

## Connections

- Calendar generator CLI → Generation pipeline: invokes
- Generation pipeline → Calendar domain: uses events
- Generation pipeline → Profiles and constants: applies profiles
- Generation pipeline → Event provider aggregation: collects
- Event provider aggregation → Specialist event domains: composes
- Event provider aggregation → Elections and wiki content: collects
- Elections and wiki content → Wiki cache: caches retrieval
- Event provider aggregation → Curated source data: reads
- Generation pipeline → Export serializers: serializes through
- Export serializers → Published calendar artifacts: writes
- Scheduled publication → Calendar generator CLI: runs generation
- Browser application → UI state and sync: boots
- UI state and sync → Calendar explorer: coordinates
- Calendar explorer → Published calendar artifacts: loads feeds
- Browser application → Dynamic ICS feed: requests dynamic ICS
- Browser application → Community event APIs: submits events
- Community event APIs → Curated source data: manages pending data
- Administration → Community event APIs: reviews content
- Vercel deployment → Browser application: hosts
- Vercel deployment → Dynamic ICS feed: runs
- Vercel deployment → Community event APIs: runs
- Vercel deployment → Administration: serves
