# a-oirgari/croise1 architecture

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

- Interactive diagram: https://gitdiagram.com/a-oirgari/croise1
- Repository: https://github.com/a-oirgari/croise1

## Overview

1. **Project type and runtime**
   - This is a **client-side only** personnel management app.
   - It runs entirely in the browser from `index.html`; no backend, database, or server API is part of the architecture.
   - Persistence is done with **browser `localStorage`**.

2. **Primary user-facing surface**
   - The main UI lives in **`index.html`**.
   - It uses **Tailwind CSS via CDN** for the page layout and controls.
   - The floor plan image `prov.jpg` is the visual canvas on which employee overlays are placed.

3. **Visual layer / presentation boundary**
   - `assets/style.css` contains the custom styling that Tailwind does not cover.
   - Its main role is to position and style the **overlay boxes / semi-transparent zones** on top of the floor plan.
   - This file is purely presentational; it does not own business rules or persistence.

4. **Core state and persistence subsystem**
   - `js/storage.js` is the persistence boundary.
   - It loads and saves app state to **localStorage**, so employee data and assignments survive page reloads.
   - The rest of the app should treat this module as the single source of truth for read/write storage operations.

5. **Employee management subsystem**
   - `js/staff.js` appears to own the **employee CRUD flow**:
     - add employees
     - remove employees
     - update employee state
     - display employee profiles / assignment state
   - This module likely mediates between the UI and storage, translating user actions into persisted staff records.

6. **Room / zone rules subsystem**
   - `js/zones.js` contains the **business rules for zone assignment**.
   - The README indicates configurable capacities and role-based constraints for areas such as:
     - Réception
     - Serveurs
     - Sécurité
     - Archives
     - Manager
     - Nettoyage
   - This is the main domain logic boundary: it decides whether an employee can be assigned to a zone and how capacity is enforced.

7. **Modal / interaction subsystem**
   - `js/modal.js` handles **popups / modal dialogs**.
   - These dialogs are used for user interactions such as assignment, confirmation, or viewing details.
   - It is an interaction layer rather than a data layer; it likely triggers actions in `staff.js` / `zones.js` and updates the visible UI.

8. **Data flow through the app**
   - User actions start in the browser UI (`index.html`).
   - Interaction events open modals (`modal.js`) or trigger employee/zone operations (`staff.js`, `zones.js`).
   - Those modules update application state and persist it via `storage.js`.
   - The UI is then re-rendered to reflect current assignments on the floor plan.

9. **Domain model boundary**
   - The app’s core model is centered on **employees, zones, and assignments**.
   - The floor plan image is only the spatial representation; the real logic is the mapping of employees to zones and the enforcement of zone constraints.
   - This means the diagram should show **business rules separate from presentation**.

10. **External assets and dependencies**
    - The only notable external dependency is **Tailwind CSS CDN**.
    - The floor plan image `prov.jpg` is a local static asset that must exist at the project root.
    - No third-party backend services are involved.

11. **Deployment / delivery**
    - The repository includes GitHub Actions workflow files under `.github/workflows`, suggesting static-site automation for publishing.
    - The README states deployment is intended via **GitHub Pages**.
    - Architecturally, this means the app is packaged as a static artifact and deployed as-is, without server-side compilation or runtime services.

12. **How to draw the architecture**
    - Show a single browser application container with:
      - **Presentation/UI**: `index.html`, Tailwind, `assets/style.css`, `prov.jpg`
      - **Interaction layer**: `modal.js`
      - **Domain logic**: `staff.js`, `zones.js`
      - **Persistence**: `storage.js` → `localStorage`
    - The main arrows should flow from **user input → UI/modals → business logic → storage → UI refresh**.

Main entry points: [`index.html`](https://github.com/a-oirgari/croise1/blob/main/index.html) (App UI), [`js/storage.js`](https://github.com/a-oirgari/croise1/blob/main/js/storage.js) (Storage), [`js/modal.js`](https://github.com/a-oirgari/croise1/blob/main/js/modal.js) (Modal layer), [`js/staff.js`](https://github.com/a-oirgari/croise1/blob/main/js/staff.js) (Staff logic)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g1["Browser app"]
  node_n1["App UI<br/>entry page<br/>[index.html]"]
  node_n2["Tailwind CDN<br/>external css"]
  node_n3["Floor plan<br/>static asset"]
  node_n4["Custom styles<br/>presentation css<br/>[style.css]"]
  node_n5["Modal layer<br/>interaction layer<br/>[modal.js]"]
  node_n6["Staff logic<br/>employee CRUD<br/>[staff.js]"]
  node_n7["Zone rules<br/>domain rules<br/>[zones.js]"]
  node_n8["Storage<br/>persistence boundary<br/>[storage.js]"]
  node_n9[("localStorage<br/>browser storage")]
  node_n10["Assignments<br/>domain model"]
  node_n11["Employees<br/>domain model"]
  node_n12["Zones<br/>domain model"]
end

subgraph group_g2["Deployment"]
  node_n13["Static deploy<br/>workflow<br/>[static.yml]"]
  node_n14["Static deploy 2<br/>workflow<br/>[static1.yml]"]
  node_n15["Static deploy 3<br/>workflow<br/>[projetcstatic.yml]"]
end

node_n1 -->|"uses"| node_n2
node_n1 -->|"styles"| node_n4
node_n1 -->|"shows"| node_n3
node_n1 -->|"opens"| node_n5
node_n5 -->|"triggers"| node_n6
node_n5 -->|"triggers"| node_n7
node_n6 -->|"updates"| node_n10
node_n7 -->|"validates"| node_n10
node_n10 -->|"persisted by"| node_n8
node_n8 -->|"writes"| node_n9
node_n8 -->|"loads"| node_n11
node_n8 -->|"loads"| node_n12
node_n8 -->|"loads"| node_n10
node_n11 -->|"managed by"| node_n6
node_n12 -->|"governed by"| node_n7
node_n13 -->|"deploys"| node_n1
node_n14 -->|"deploys"| node_n1
node_n15 -->|"deploys"| node_n1

click node_n1 "https://github.com/a-oirgari/croise1/blob/main/index.html"
click node_n4 "https://github.com/a-oirgari/croise1/blob/main/assets/style.css"
click node_n5 "https://github.com/a-oirgari/croise1/blob/main/js/modal.js"
click node_n6 "https://github.com/a-oirgari/croise1/blob/main/js/staff.js"
click node_n7 "https://github.com/a-oirgari/croise1/blob/main/js/zones.js"
click node_n8 "https://github.com/a-oirgari/croise1/blob/main/js/storage.js"
click node_n13 "https://github.com/a-oirgari/croise1/blob/main/.github/workflows/static.yml"
click node_n14 "https://github.com/a-oirgari/croise1/blob/main/.github/workflows/static1.yml"
click node_n15 "https://github.com/a-oirgari/croise1/blob/main/.github/workflows/projetcstatic.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_n1,node_n2,node_n3,node_n4,node_n5,node_n6,node_n7,node_n8,node_n9,node_n10,node_n11,node_n12 toneBlue
class node_n13,node_n14,node_n15 toneAmber
```

## Components

### Browser app

Static client-side personnel management app running entirely in the browser.

- [App UI](https://github.com/a-oirgari/croise1/blob/main/index.html): entry page · Main browser entry point and user-facing surface. · `index.html`
- **Tailwind CDN**: external css · External utility CSS used for layout and controls.
- **Floor plan**: static asset · Local floor plan image used as the visual canvas for overlays.
- [Custom styles](https://github.com/a-oirgari/croise1/blob/main/assets/style.css): presentation css · Project-specific styling for overlay boxes and zones. · `assets/style.css`
- [Modal layer](https://github.com/a-oirgari/croise1/blob/main/js/modal.js): interaction layer · Popup and dialog interactions for assignment and confirmation flows. · `js/modal.js`
- [Staff logic](https://github.com/a-oirgari/croise1/blob/main/js/staff.js): employee CRUD · Add, remove, update, and display employee assignment state. · `js/staff.js`
- [Zone rules](https://github.com/a-oirgari/croise1/blob/main/js/zones.js): domain rules · Capacity and role-based constraints for room and zone assignment. · `js/zones.js`
- [Storage](https://github.com/a-oirgari/croise1/blob/main/js/storage.js): persistence boundary · Single read/write boundary for app state persisted in localStorage. · `js/storage.js`
- **localStorage**: browser storage · Built-in browser persistence used to retain app state across reloads.
- **Assignments**: domain model · Employee-to-zone mappings that drive rendering and validation.
- **Employees**: domain model · Personnel records managed by the application.
- **Zones**: domain model · Configured areas with role and capacity constraints.

### Deployment

Static-site automation for publishing the app to GitHub Pages.

- [Static deploy](https://github.com/a-oirgari/croise1/blob/main/.github/workflows/static.yml): workflow · GitHub Actions workflows for publishing the static site. · `.github/workflows/static.yml`
- [Static deploy 2](https://github.com/a-oirgari/croise1/blob/main/.github/workflows/static1.yml): workflow · Additional workflow variant for static-site automation. · `.github/workflows/static1.yml`
- [Static deploy 3](https://github.com/a-oirgari/croise1/blob/main/.github/workflows/projetcstatic.yml): workflow · Additional workflow variant for static-site automation. · `.github/workflows/projetcstatic.yml`

## Connections

- App UI → Tailwind CDN: uses · Browser page loads Tailwind for layout and controls.
- App UI → Custom styles: styles · Page uses project-specific styling for overlays and zones.
- App UI → Floor plan: shows · Floor plan image is the visual canvas beneath overlays.
- App UI → Modal layer: opens · User actions trigger modal dialogs and popups.
- Modal layer → Staff logic: triggers · Modal interactions lead to staff CRUD and profile actions.
- Modal layer → Zone rules: triggers · Dialogs invoke zone assignment and validation logic.
- Staff logic → Assignments: updates · Staff operations mutate employee assignments and state.
- Zone rules → Assignments: validates · Zone rules decide whether assignments are allowed.
- Assignments → Storage: persisted by · Domain state is saved through the storage boundary.
- Storage → localStorage: writes · Storage module reads and writes browser localStorage.
- Storage → Employees: loads · Persistent state includes employee records.
- Storage → Zones: loads · Persistent state includes zone configuration.
- Storage → Assignments: loads · Persistent state includes current assignments.
- Employees → Staff logic: managed by · Employee records are owned by staff management.
- Zones → Zone rules: governed by · Zones are governed by capacity and role rules.
- Static deploy → App UI: deploys · Workflow publishes the static browser app.
- Static deploy 2 → App UI: deploys · Workflow publishes the static browser app.
- Static deploy 3 → App UI: deploys · Workflow publishes the static browser app.
