# sencsu0-sudo/factures-csu architecture

> Architecture diagram of the GitHub repository sencsu0-sudo/factures-csu, 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/sencsu0-sudo/factures-csu
- Repository: https://github.com/sencsu0-sudo/factures-csu

## Overview

This appears to be a Senegal CSU invoicing PWA. The tree and service-worker comments indicate an app entry page, install metadata, offline caching, and Apps Script requests; the README is empty and index.html was not sampled, so invoice-entry and synchronization details cannot be traced. The service worker caches app resources for offline use and lets Google-hosted API requests go directly to the network. The available evidence does not show how the UI registers the worker or invokes the API.

Main entry points: [`sw.js`](https://github.com/sencsu0-sudo/factures-csu/blob/main/sw.js) (Service worker), [`index.html`](https://github.com/sencsu0-sudo/factures-csu/blob/main/index.html) (Invoice app), [`manifest.json`](https://github.com/sencsu0-sudo/factures-csu/blob/main/manifest.json) (Install metadata)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_invoice["Invoice app"]
  node_app["Invoice app<br/>[index.html]"]
end

subgraph group_pwa["Offline runtime"]
  node_manifest["Install metadata<br/>[manifest.json]"]
  node_worker["Service worker<br/>[sw.js]"]
  node_cache[("Resource cache")]
end

node_user(("User"))
node_apps_script{{"Apps Script API"}}

node_user -.->|"opens"| node_app
node_worker -->|"caches resources"| node_cache
node_worker -->|"caches app page"| node_app
node_worker -->|"caches metadata"| node_manifest
node_worker -->|"passes requests"| node_apps_script

click node_app "https://github.com/sencsu0-sudo/factures-csu/blob/main/index.html"
click node_manifest "https://github.com/sencsu0-sudo/factures-csu/blob/main/manifest.json"
click node_worker "https://github.com/sencsu0-sudo/factures-csu/blob/main/sw.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_app,node_user toneBlue
class node_manifest,node_worker,node_cache toneAmber
class node_apps_script toneMint
```

## Components

### Invoice app

- [Invoice app](https://github.com/sencsu0-sudo/factures-csu/blob/main/index.html): `index.html`

### Offline runtime

- [Install metadata](https://github.com/sencsu0-sudo/factures-csu/blob/main/manifest.json): `manifest.json`
- [Service worker](https://github.com/sencsu0-sudo/factures-csu/blob/main/sw.js): `sw.js`
- **Resource cache**

### Other components

- **User**
- **Apps Script API**

## Connections

- User → Invoice app: opens
- Service worker → Resource cache: caches resources (evidence: `sw.js`)
- Service worker → Invoice app: caches app page (evidence: `sw.js`)
- Service worker → Install metadata: caches metadata (evidence: `sw.js`)
- Service worker → Apps Script API: passes requests (evidence: `sw.js`)
