# andreemiranda/geradorlotofacil architecture

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

- Interactive diagram: https://gitdiagram.com/andreemiranda/geradorlotofacil
- Repository: https://github.com/andreemiranda/geradorlotofacil

## Overview

Lotofácil Pro is a browser-based Lotofácil game generator. The main workflow is choosing or randomly generating a 15-number base, producing nine 9+6 combinations, rejecting duplicates, and managing the results by exporting or copying them. The README documents these product capabilities; the sampled JavaScript entry is only a placeholder, so the application internals are represented at the documented level. The sampled server and service worker show delivery and offline-cache behavior directly.

Main entry points: [`index.html`](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html) (Group management), [`server.js`](https://github.com/andreemiranda/geradorlotofacil/blob/main/server.js) (HTTP server), [`sw.js`](https://github.com/andreemiranda/geradorlotofacil/blob/main/sw.js) (Offline service worker), [`styles.css`](https://github.com/andreemiranda/geradorlotofacil/blob/main/styles.css) (Responsive styling)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_gameplay["Game generation"]
  node_base_input["Base numbers<br/>[index.html]"]
  node_surpresinha["Surpresinha<br/>[index.html]"]
  node_validation["Input validation<br/>[index.html]"]
  node_combination_generator["Combination generator<br/>[index.html]"]
  node_duplicate_history["Duplicate history<br/>[index.html]"]
end

subgraph group_results["Result management"]
  node_results_view["Games display<br/>[index.html]"]
  node_group_management["Group management<br/>[index.html]"]
  node_txt_export["TXT export<br/>[index.html]"]
  node_clipboard["Clipboard copy<br/>[index.html]"]
end

subgraph group_webapp["Web application"]
  node_page["Web interface<br/>[index.html]"]
  node_styles["Responsive styling<br/>[styles.css]"]
end

subgraph group_runtime["Delivery and offline"]
  node_pwa_manifest["PWA manifest<br/>[manifest.json]"]
  node_service_worker["Offline service worker<br/>[sw.js]"]
  node_static_assets["Embedded asset fallbacks<br/>[embedded-assets.js]"]
  node_http_server["HTTP server<br/>[server.js]"]
end

node_player(("Player"))
node_browser(("Browser"))

node_player -->|"enters numbers"| node_base_input
node_player -->|"requests random base"| node_surpresinha
node_base_input -->|"validates input"| node_validation
node_surpresinha -->|"provides base"| node_combination_generator
node_validation -->|"provides base"| node_combination_generator
node_combination_generator -->|"checks uniqueness"| node_duplicate_history
node_duplicate_history -->|"adds unique games"| node_results_view
node_player -->|"manages results"| node_group_management
node_group_management -->|"exports games"| node_txt_export
node_group_management -->|"copies games"| node_clipboard
node_browser -.->|"requests app"| node_http_server
node_http_server -->|"serves fallback page"| node_page
node_http_server -->|"uses asset fallbacks"| node_static_assets
node_browser -->|"runs offline caching"| node_service_worker
node_service_worker -->|"caches app page"| node_page
node_browser -.->|"loads install metadata"| node_pwa_manifest
node_page -.->|"uses styling"| node_styles

click node_base_input "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_surpresinha "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_validation "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_combination_generator "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_duplicate_history "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_results_view "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_group_management "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_txt_export "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_clipboard "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_page "https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html"
click node_styles "https://github.com/andreemiranda/geradorlotofacil/blob/main/styles.css"
click node_pwa_manifest "https://github.com/andreemiranda/geradorlotofacil/blob/main/manifest.json"
click node_service_worker "https://github.com/andreemiranda/geradorlotofacil/blob/main/sw.js"
click node_static_assets "https://github.com/andreemiranda/geradorlotofacil/blob/main/embedded-assets.js"
click node_http_server "https://github.com/andreemiranda/geradorlotofacil/blob/main/server.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_base_input,node_surpresinha,node_validation,node_combination_generator,node_duplicate_history,node_browser toneBlue
class node_results_view,node_group_management,node_txt_export,node_clipboard toneAmber
class node_page,node_styles toneMint
class node_pwa_manifest,node_service_worker,node_static_assets,node_http_server toneRose
class node_player toneIndigo
```

## Components

### Game generation

- [Base numbers](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Surpresinha](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Input validation](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Combination generator](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Duplicate history](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`

### Result management

- [Games display](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Group management](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [TXT export](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Clipboard copy](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`

### Web application

- [Web interface](https://github.com/andreemiranda/geradorlotofacil/blob/main/index.html): `index.html`
- [Responsive styling](https://github.com/andreemiranda/geradorlotofacil/blob/main/styles.css): `styles.css`

### Delivery and offline

- [PWA manifest](https://github.com/andreemiranda/geradorlotofacil/blob/main/manifest.json): `manifest.json`
- [Offline service worker](https://github.com/andreemiranda/geradorlotofacil/blob/main/sw.js): `sw.js`
- [Embedded asset fallbacks](https://github.com/andreemiranda/geradorlotofacil/blob/main/embedded-assets.js): `embedded-assets.js`
- [HTTP server](https://github.com/andreemiranda/geradorlotofacil/blob/main/server.js): `server.js`

### Other components

- **Player**
- **Browser**

## Connections

- Player → Base numbers: enters numbers (evidence: `README.md`)
- Player → Surpresinha: requests random base (evidence: `README.md`)
- Base numbers → Input validation: validates input (evidence: `README.md`)
- Surpresinha → Combination generator: provides base (evidence: `README.md`)
- Input validation → Combination generator: provides base (evidence: `README.md`)
- Combination generator → Duplicate history: checks uniqueness (evidence: `README.md`)
- Duplicate history → Games display: adds unique games (evidence: `README.md`)
- Player → Group management: manages results (evidence: `README.md`)
- Group management → TXT export: exports games (evidence: `README.md`)
- Group management → Clipboard copy: copies games (evidence: `README.md`)
- Browser → HTTP server: requests app
- HTTP server → Web interface: serves fallback page (evidence: `server.js`)
- HTTP server → Embedded asset fallbacks: uses asset fallbacks (evidence: `server.js`)
- Browser → Offline service worker: runs offline caching (evidence: `sw.js`)
- Offline service worker → Web interface: caches app page (evidence: `sw.js`)
- Browser → PWA manifest: loads install metadata
- Web interface → Responsive styling: uses styling
