# angel-informatico/maize-event architecture

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

- Interactive diagram: https://gitdiagram.com/angel-informatico/maize-event
- Repository: https://github.com/angel-informatico/maize-event

## Overview

Pokémon Maize Event Giveaway is a Flask website (also usable as an offline desktop app) that generates 13-number redemption codes. The player submits a Trainer ID and event Pokémon choice; the Flask route validates the form and ID, selects that event’s Pokémon attributes, generates the code, and renders the result. The code applies Trainer-ID XOR encoding and checksums; Pikablue additionally randomizes Fly or Surf. The README documents five event variants and in-game redemption. The database write shown in source is commented out. The map reflects sampled runtime code and documented capabilities; event configuration and generation share one source file.

Main entry points: [`app/views.py`](https://github.com/angel-informatico/maize-event/blob/master/app/views.py) (Giveaway route), [`app/templates/index.html`](https://github.com/angel-informatico/maize-event/blob/master/app/templates/index.html) (Giveaway page), [`app/__init__.py`](https://github.com/angel-informatico/maize-event/blob/master/app/__init__.py) (Flask app), [`desktop.py`](https://github.com/angel-informatico/maize-event/blob/master/desktop.py) (Desktop launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_route["Giveaway route<br/>[views.py]"]
  node_form["Trainer ID form<br/>[forms.py]"]
  node_page["Giveaway page<br/>[index.html]"]
  node_styles["Page styling<br/>[main.css]"]
end

subgraph group_code["Event code generation"]
  node_events["Event definitions<br/>[views.py]"]
  node_random["Pikablue move choice<br/>[views.py]"]
  node_generator["Code generator<br/>[views.py]"]
end

subgraph group_entry["Runtime entry points"]
  node_flask["Flask app<br/>[__init__.py]"]
  node_desktop["Desktop launcher<br/>[desktop.py]"]
  node_webview["Desktop window<br/>[desktop.py]"]
  node_vercel["Vercel adapter<br/>[index.py]"]
end

node_player(("Player"))
node_game(("Pokémon Maize"))

node_player -->|"opens"| node_page
node_page -->|"submits choices"| node_route
node_route -->|"validates"| node_form
node_route -->|"selects event"| node_events
node_route -->|"requests move"| node_random
node_route -->|"requests code"| node_generator
node_random -->|"provides move"| node_generator
node_route -->|"renders result"| node_page
node_page -->|"shows code"| node_player
node_player -.->|"redeems code"| node_game
node_flask -->|"registers routes"| node_route
node_desktop -->|"starts server"| node_flask
node_desktop -->|"opens window"| node_webview
node_webview -->|"loads local app"| node_flask
node_vercel -->|"exports app"| node_flask

click node_flask "https://github.com/angel-informatico/maize-event/blob/master/app/__init__.py"
click node_route "https://github.com/angel-informatico/maize-event/blob/master/app/views.py"
click node_form "https://github.com/angel-informatico/maize-event/blob/master/app/forms.py"
click node_page "https://github.com/angel-informatico/maize-event/blob/master/app/templates/index.html"
click node_styles "https://github.com/angel-informatico/maize-event/blob/master/app/static/css/main.css"
click node_events "https://github.com/angel-informatico/maize-event/blob/master/app/views.py"
click node_random "https://github.com/angel-informatico/maize-event/blob/master/app/views.py"
click node_generator "https://github.com/angel-informatico/maize-event/blob/master/app/views.py"
click node_desktop "https://github.com/angel-informatico/maize-event/blob/master/desktop.py"
click node_webview "https://github.com/angel-informatico/maize-event/blob/master/desktop.py"
click node_vercel "https://github.com/angel-informatico/maize-event/blob/master/api/index.py"

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_route,node_form,node_page,node_styles toneBlue
class node_events,node_random,node_generator toneAmber
class node_flask,node_desktop,node_webview,node_vercel toneMint
class node_player,node_game toneIndigo
```

## Components

### Web experience

- [Giveaway route](https://github.com/angel-informatico/maize-event/blob/master/app/views.py): `app/views.py`
- [Trainer ID form](https://github.com/angel-informatico/maize-event/blob/master/app/forms.py): `app/forms.py`
- [Giveaway page](https://github.com/angel-informatico/maize-event/blob/master/app/templates/index.html): `app/templates/index.html`
- [Page styling](https://github.com/angel-informatico/maize-event/blob/master/app/static/css/main.css): `app/static/css/main.css`

### Event code generation

- [Event definitions](https://github.com/angel-informatico/maize-event/blob/master/app/views.py): `app/views.py`
- [Pikablue move choice](https://github.com/angel-informatico/maize-event/blob/master/app/views.py): `app/views.py`
- [Code generator](https://github.com/angel-informatico/maize-event/blob/master/app/views.py): `app/views.py`

### Runtime entry points

- [Flask app](https://github.com/angel-informatico/maize-event/blob/master/app/__init__.py): `app/__init__.py`
- [Desktop launcher](https://github.com/angel-informatico/maize-event/blob/master/desktop.py): `desktop.py`
- [Desktop window](https://github.com/angel-informatico/maize-event/blob/master/desktop.py): `desktop.py`
- [Vercel adapter](https://github.com/angel-informatico/maize-event/blob/master/api/index.py): `api/index.py`

### Other components

- **Player**
- **Pokémon Maize**

## Connections

- Player → Giveaway page: opens
- Giveaway page → Giveaway route: submits choices
- Giveaway route → Trainer ID form: validates
- Giveaway route → Event definitions: selects event
- Giveaway route → Pikablue move choice: requests move
- Giveaway route → Code generator: requests code
- Pikablue move choice → Code generator: provides move
- Giveaway route → Giveaway page: renders result
- Giveaway page → Player: shows code
- Player → Pokémon Maize: redeems code
- Flask app → Giveaway route: registers routes
- Desktop launcher → Flask app: starts server
- Desktop launcher → Desktop window: opens window
- Desktop window → Flask app: loads local app
- Vercel adapter → Flask app: exports app
