# anais0210/checklist-rncp6-cda architecture

> Architecture diagram of the GitHub repository anais0210/checklist-rncp6-cda, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anais0210/checklist-rncp6-cda
- Repository: https://github.com/anais0210/checklist-rncp6-cda

## Overview

##### Project Type and Purpose
- This is a static, front-end checklist application (no backend services). It delivers a two-page UI (index.html and questions.html) where users track and validate RNCP6 CDA checkpoints. JavaScript modules manage UI state (navigation, filtering, progress, notes, exports), and configuration lives in a `config.json`. Linting (HTMLHint, Stylelint) and an accessibility test script (`test-a11y.js`) enforce quality via GitHub Actions.

##### File-Structure Analysis
- Top level:
- `.github/workflows/quality.yaml` → CI pipeline for linting
- `index.html`, `questions.html` → entry pages
- `styles.css` → global CSS
- `config.json` → checklist data
- `test-a11y.js` → custom a11y checks
- `package.json` + lock → NPM scripts, lint deps
- `js/` directory: nine modules handling specific UI features:
- `app.js` – application bootstrap & module wiring
- `navigation.js` – page routing / menu
- `filters.js` – checklist filtering
- `search-manager.js` – free-text search
- `notes-manager.js` – user notes storage
- `progress.js` – completion tracking
- `export.js` – exporting data
- `reset-manager.js` – clearing state
- `project-name-manager.js` – naming projects

##### Key Insights from README
- Purpose: checklist tracking and validation.
- Tech stack: vanilla HTML/CSS/JS, HTMLHint, Stylelint.
- CI: GitHub Actions runs linting on every push/PR.

##### Main System Components
a. Client Browser
- Entry: index.html & questions.html
- Loads `styles.css`, JS modules, `config.json`
b. Configuration Service (static file server)
- Hosts `config.json`, HTML, CSS, JS
c. JS Module Layer (in-browser)
- App Bootstrap (`app.js`) coordinates:
- Navigation Manager
- Filters Manager
- Search Manager
- Notes Manager (persists to localStorage)
- Progress Manager
- Export Manager
- Reset Manager
- Project Name Manager
d. Data Store
- Browser LocalStorage (notes, progress, project name)
- In-memory state for filters/search
e. CI/CD Pipeline
- GitHub Actions (quality.yaml)
- Runs HTMLHint on HTML
- Runs Stylelint on CSS
- Runs `test-a11y.js` for accessibility

##### Relationships and Data Flows
- Browser requests HTML pages → pages include CSS & JS.
- JS modules fetch `config.json` → build checklist UI.
- User interactions → JS managers update in-memory state & LocalStorage → UI updates.
- Export manager packages state & config → prompts user download.
- Code commits → GitHub Actions → run lint & a11y tests → pass/fail feedback.

##### Architectural Patterns & Design Principles
- Modular JS: one module per concern (SRP).
- Static-site architecture: no server-side logic.
- CI as code: linters executed on every push via GH Actions.

##### Final Advice
- Every JS module as an individual component.
- Detail the CI workflow separately from run-time architecture.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Browser
    Browser["Client Browser"]:::runtime

    %% Static File Server
    subgraph "Static File Server"
        index["index.html"]:::static
        questions["questions.html"]:::static
        css["styles.css"]:::static
        config["config.json"]:::static
    end

    %% JS Module Layer
    subgraph "JS Module Layer"
        app["app.js"]:::runtime
        nav["navigation.js"]:::runtime
        filters["filters.js"]:::runtime
        search["search-manager.js"]:::runtime
        notes["notes-manager.js"]:::runtime
        progress["progress.js"]:::runtime
        exportM["export.js"]:::runtime
        reset["reset-manager.js"]:::runtime
        project["project-name-manager.js"]:::runtime
    end

    %% Data Store
    subgraph "Data Store"
        localStorage["LocalStorage"]:::datastore
    end

    %% CI / Dev Tools
    subgraph "CI / Dev Tools"
        ci["GitHub Actions CI"]:::ci
        quality[".github/workflows/quality.yaml"]:::ci
        a11y["test-a11y.js"]:::ci
        htmlhint[".htmlhintrc"]:::ci
        stylelint[".stylelintrc"]:::ci
        npm["package.json\npackage-lock.json"]:::ci
    end

    %% Connections: Browser loads assets
    Browser -->|"requests"| index
    Browser -->|"requests"| questions
    index -->|"loads CSS"| css
    index -->|"loads JS"| app
    questions -->|"loads CSS"| css
    questions -->|"loads JS"| app

    %% JS app orchestrates modules
    app -->|"init/navigation"| nav
    app -->|"init/filters"| filters
    app -->|"init/search"| search
    app -->|"init/notes"| notes
    app -->|"init/progress"| progress
    app -->|"init/export"| exportM
    app -->|"init/reset"| reset
    app -->|"init/project-name"| project

    %% JS modules fetch config
    app -->|"fetch config.json"| config

    %% Modules interact with LocalStorage
    notes -->|"read/write"| localStorage
    progress -->|"read/write"| localStorage
    project -->|"read/write"| localStorage

    %% CI pipeline flows
    ci -->|"runs"| quality
    ci -->|"runs"| a11y
    ci -->|"uses rules"| htmlhint
    ci -->|"uses rules"| stylelint
    ci -->|"uses scripts"| npm

    %% Legend
    subgraph Legend
        direction LR
        A["Static Assets"]:::static
        B["Runtime Modules"]:::runtime
        C["Data Store"]:::datastore
        D["CI / Dev Tools"]:::ci
    end

    %% Click Events
    click index "https://github.com/anais0210/checklist-rncp6-cda/blob/main/index.html"
    click questions "https://github.com/anais0210/checklist-rncp6-cda/blob/main/questions.html"
    click css "https://github.com/anais0210/checklist-rncp6-cda/blob/main/styles.css"
    click config "https://github.com/anais0210/checklist-rncp6-cda/blob/main/config.json"
    click app "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/app.js"
    click nav "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/navigation.js"
    click filters "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/filters.js"
    click search "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/search-manager.js"
    click notes "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/notes-manager.js"
    click progress "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/progress.js"
    click exportM "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/export.js"
    click reset "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/reset-manager.js"
    click project "https://github.com/anais0210/checklist-rncp6-cda/blob/main/js/project-name-manager.js"
    click a11y "https://github.com/anais0210/checklist-rncp6-cda/blob/main/test-a11y.js"
    click quality "https://github.com/anais0210/checklist-rncp6-cda/blob/main/.github/workflows/quality.yaml"
    click htmlhint "https://github.com/anais0210/checklist-rncp6-cda/blob/main/.htmlhintrc"
    click stylelint "https://github.com/anais0210/checklist-rncp6-cda/blob/main/.stylelintrc"
    click npm "https://github.com/anais0210/checklist-rncp6-cda/blob/main/package.json"

    %% Styles
    classDef static fill:#d0e7ff,stroke:#339,stroke-width:1px
    classDef runtime fill:#d0ffd0,stroke:#393,stroke-width:1px
    classDef datastore fill:#e2d0ff,stroke:#636,stroke-width:1px,stroke-dasharray: 5 5
    classDef ci fill:#ffe0b3,stroke:#a85,stroke-width:1px,stroke-dasharray: 2 2
    classDef Legend fill:none,stroke:none,font-weight:bold;font-size:12px
    class Legend Legend
```
