# aznasser/elan architecture

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

- Interactive diagram: https://gitdiagram.com/aznasser/elan
- Repository: https://github.com/aznasser/elan

## Overview

Élan is a personal habits and agenda app: users record habits and tasks, manage their routine and data, and receive reminders. Its single web application is the product UI and also runs as a PWA or inside Android’s WebView. Android adds native reminders, notification actions, a home-screen widget and life-moment triggers. The graph preserves these documented capabilities; web feature internals are not sampled, so those branches share the documented app path. Reminder scheduling and native integration links are grounded in the excerpts; unsampled web behavior is not expanded.

Main entry points: [`web/elan.html`](https://github.com/aznasser/elan/blob/main/web/elan.html) (Élan app), [`android/app/src/main/java/fr/devperso/elan/ElanBridge.kt`](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ElanBridge.kt) (Native bridge), [`android/app/src/main/java/fr/devperso/elan/Receivers.kt`](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Receivers.kt) (Reminder action receivers), [`android/app/src/main/java/fr/devperso/elan/Reminders.kt`](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Reminders.kt) (Alarm and notification scheduling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web app"]
  node_webapp["Élan app<br/>[elan.html]"]
  node_habits["Habit tracking<br/>[elan.html]"]
  node_agenda["Agenda<br/>[elan.html]"]
  node_profile["Profile and data<br/>[elan.html]"]
  node_aid["Help and emergency<br/>[elan.html]"]
end

subgraph group_pwa["PWA runtime"]
  node_sw["Offline and PWA reminders<br/>[sw.js]"]
end

subgraph group_native["Android integration"]
  node_activity["Android WebView host<br/>[MainActivity.kt]"]
  node_bridge["Native bridge<br/>[ElanBridge.kt]"]
  node_triggers["Life-moment triggers<br/>[Triggers.kt]"]
  node_widget["Home-screen widget<br/>[ElanWidget.kt]"]
end

subgraph group_reminders["Reminder system"]
  node_reminders["Alarm and notification scheduling<br/>[Reminders.kt]"]
  node_logic["Reminder rules<br/>[ReminderLogic.kt]"]
  node_receivers["Reminder action receivers<br/>[Receivers.kt]"]
end

node_user(("User"))
node_browser(("Browser"))
node_android(("Android system"))

node_user -->|"uses"| node_webapp
node_webapp -->|"records habits"| node_habits
node_webapp -->|"manages tasks"| node_agenda
node_webapp -->|"exports and imports"| node_profile
node_webapp -->|"shows help"| node_aid
node_browser -->|"runs"| node_webapp
node_webapp -->|"uses service worker"| node_sw
node_activity -->|"loads bundled app"| node_webapp
node_activity -->|"exposes JavaScript interface"| node_bridge
node_webapp -->|"calls native methods"| node_bridge
node_bridge -->|"schedules and queues"| node_reminders
node_bridge -->|"configures triggers"| node_triggers
node_bridge -->|"updates widget state"| node_widget
node_reminders -->|"applies scheduling rules"| node_logic
node_receivers -->|"fires and queues actions"| node_reminders
node_receivers -->|"creates action records"| node_logic
node_receivers -->|"rearms on system changes"| node_triggers
node_widget -->|"opens app"| node_activity
node_widget -->|"dispatches button actions"| node_receivers
node_android -->|"delivers broadcasts"| node_receivers
node_android -.->|"delivers alarms"| node_reminders
node_android -.->|"runs scheduled triggers"| node_triggers
node_sw -->|"stores offline data"| node_browser
node_sw -->|"shows due notifications"| node_user

click node_webapp "https://github.com/aznasser/elan/blob/main/web/elan.html"
click node_habits "https://github.com/aznasser/elan/blob/main/web/elan.html"
click node_agenda "https://github.com/aznasser/elan/blob/main/web/elan.html"
click node_profile "https://github.com/aznasser/elan/blob/main/web/elan.html"
click node_aid "https://github.com/aznasser/elan/blob/main/web/elan.html"
click node_sw "https://github.com/aznasser/elan/blob/main/web/sw.js"
click node_activity "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/MainActivity.kt"
click node_bridge "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ElanBridge.kt"
click node_reminders "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Reminders.kt"
click node_logic "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ReminderLogic.kt"
click node_receivers "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Receivers.kt"
click node_triggers "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Triggers.kt"
click node_widget "https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ElanWidget.kt"

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_webapp,node_habits,node_agenda,node_profile,node_aid,node_user,node_browser toneBlue
class node_sw toneAmber
class node_activity,node_bridge,node_triggers,node_widget toneMint
class node_reminders,node_logic,node_receivers toneRose
class node_android toneIndigo
```

## Components

### Web app

- [Élan app](https://github.com/aznasser/elan/blob/main/web/elan.html): `web/elan.html`
- [Habit tracking](https://github.com/aznasser/elan/blob/main/web/elan.html): `web/elan.html`
- [Agenda](https://github.com/aznasser/elan/blob/main/web/elan.html): `web/elan.html`
- [Profile and data](https://github.com/aznasser/elan/blob/main/web/elan.html): `web/elan.html`
- [Help and emergency](https://github.com/aznasser/elan/blob/main/web/elan.html): `web/elan.html`

### PWA runtime

- [Offline and PWA reminders](https://github.com/aznasser/elan/blob/main/web/sw.js): `web/sw.js`

### Android integration

- [Android WebView host](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/MainActivity.kt): `android/app/src/main/java/fr/devperso/elan/MainActivity.kt`
- [Native bridge](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ElanBridge.kt): `android/app/src/main/java/fr/devperso/elan/ElanBridge.kt`
- [Life-moment triggers](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Triggers.kt): `android/app/src/main/java/fr/devperso/elan/Triggers.kt`
- [Home-screen widget](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ElanWidget.kt): `android/app/src/main/java/fr/devperso/elan/ElanWidget.kt`

### Reminder system

- [Alarm and notification scheduling](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Reminders.kt): `android/app/src/main/java/fr/devperso/elan/Reminders.kt`
- [Reminder rules](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/ReminderLogic.kt): `android/app/src/main/java/fr/devperso/elan/ReminderLogic.kt`
- [Reminder action receivers](https://github.com/aznasser/elan/blob/main/android/app/src/main/java/fr/devperso/elan/Receivers.kt): `android/app/src/main/java/fr/devperso/elan/Receivers.kt`

### Other components

- **User**
- **Browser**
- **Android system**

## Connections

- User → Élan app: uses (evidence: `README.md`)
- Élan app → Habit tracking: records habits (evidence: `README.md`)
- Élan app → Agenda: manages tasks (evidence: `README.md`)
- Élan app → Profile and data: exports and imports (evidence: `README.md`)
- Élan app → Help and emergency: shows help
- Browser → Élan app: runs (evidence: `README.md`)
- Élan app → Offline and PWA reminders: uses service worker (evidence: `README.md`)
- Android WebView host → Élan app: loads bundled app
- Android WebView host → Native bridge: exposes JavaScript interface (evidence: `android/app/src/main/java/fr/devperso/elan/MainActivity.kt`)
- Élan app → Native bridge: calls native methods (evidence: `android/app/src/main/java/fr/devperso/elan/ElanBridge.kt`)
- Native bridge → Alarm and notification scheduling: schedules and queues (evidence: `android/app/src/main/java/fr/devperso/elan/ElanBridge.kt`)
- Native bridge → Life-moment triggers: configures triggers (evidence: `android/app/src/main/java/fr/devperso/elan/ElanBridge.kt`)
- Native bridge → Home-screen widget: updates widget state (evidence: `android/app/src/main/java/fr/devperso/elan/ElanBridge.kt`)
- Alarm and notification scheduling → Reminder rules: applies scheduling rules (evidence: `android/app/src/main/java/fr/devperso/elan/Reminders.kt`)
- Reminder action receivers → Alarm and notification scheduling: fires and queues actions (evidence: `android/app/src/main/java/fr/devperso/elan/Receivers.kt`)
- Reminder action receivers → Reminder rules: creates action records (evidence: `android/app/src/main/java/fr/devperso/elan/Receivers.kt`)
- Reminder action receivers → Life-moment triggers: rearms on system changes (evidence: `android/app/src/main/java/fr/devperso/elan/Receivers.kt`)
- Home-screen widget → Android WebView host: opens app (evidence: `android/app/src/main/java/fr/devperso/elan/ElanWidget.kt`)
- Home-screen widget → Reminder action receivers: dispatches button actions (evidence: `android/app/src/main/java/fr/devperso/elan/ElanWidget.kt`)
- Android system → Reminder action receivers: delivers broadcasts (evidence: `android/app/src/main/java/fr/devperso/elan/Receivers.kt`)
- Android system → Alarm and notification scheduling: delivers alarms
- Android system → Life-moment triggers: runs scheduled triggers
- Offline and PWA reminders → Browser: stores offline data (evidence: `web/sw.js`)
- Offline and PWA reminders → User: shows due notifications (evidence: `web/sw.js`)
