# lacambraeron/rrw architecture

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

- Interactive diagram: https://gitdiagram.com/lacambraeron/rrw
- Repository: https://github.com/lacambraeron/rrw

## Overview

Arizona Red Ribbon Week is a Flask campaign site with a PostgreSQL-backed event scheduler and protected staff tools. Visitors browse campaign information and submit event requests; staff review requests, approve event details, view an approved-events calendar, and export scheduler data. The site also provides a school-planning map and links to pledge and prevention resources. Routes and storage are sampled; other feature links reflect README documentation, so their internal wiring is not expanded beyond the documented behavior.

Main entry points: [`app/storage.py`](https://github.com/lacambraeron/rrw/blob/main/app/storage.py) (Database access), [`app/routes.py`](https://github.com/lacambraeron/rrw/blob/main/app/routes.py) (Campaign pages), [`app/__init__.py`](https://github.com/lacambraeron/rrw/blob/main/app/__init__.py) (Flask app), [`app/templates/pledge.html`](https://github.com/lacambraeron/rrw/blob/main/app/templates/pledge.html) (Pledge form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Campaign site"]
  node_flask["Flask app<br/>[__init__.py]"]
  node_campaign["Campaign pages<br/>[routes.py]"]
  node_campaign_views["Campaign templates"]
  node_pledge["Pledge form<br/>[pledge.html]"]
  node_resources["Prevention resources<br/>[routes.py]"]
end

subgraph group_scheduler["Event scheduler"]
  node_scheduler_routes["Registration workflow<br/>[routes.py]"]
  node_registration_view["Registration templates<br/>[register.html]"]
  node_storage["Database access<br/>[storage.py]"]
end

subgraph group_staff["Staff tools"]
  node_admin["Request review<br/>[routes.py]"]
  node_calendar["Approved calendar<br/>[routes.py]"]
  node_backup["Excel export<br/>[routes.py]"]
  node_mail["Approval email<br/>[routes.py]"]
end

subgraph group_planning["School planning"]
  node_map["School planning map<br/>[routes.py]"]
  node_school_data["School datasets"]
end

node_visitor(("Visitor"))
node_staff_actor(("Staff user"))
node_resources_site["Arizona resources site"]
node_google_form["Google Form"]
node_postgres[("PostgreSQL")]
node_smtp["SMTP service"]
node_geocoder["Census geocoder"]

node_visitor -->|"requests pages"| node_flask
node_flask -->|"dispatches routes"| node_campaign
node_campaign -->|"renders pages"| node_campaign_views
node_campaign -->|"renders pledge"| node_pledge
node_pledge -.->|"embeds form"| node_google_form
node_campaign -->|"redirects request"| node_resources
node_resources -->|"redirects to"| node_resources_site
node_visitor -->|"submits request"| node_scheduler_routes
node_scheduler_routes -->|"renders workflow"| node_registration_view
node_scheduler_routes -->|"reads and writes"| node_storage
node_flask -->|"initializes database"| node_storage
node_storage -->|"queries and migrates"| node_postgres
node_staff_actor -->|"reviews requests"| node_admin
node_staff_actor -->|"views events"| node_calendar
node_staff_actor -->|"requests export"| node_backup
node_admin -->|"reads and updates"| node_storage
node_calendar -->|"reads approvals"| node_storage
node_backup -->|"reads registrations"| node_storage
node_admin -->|"sends approval email"| node_mail
node_mail -.->|"sends message"| node_smtp
node_visitor -->|"opens map"| node_map
node_map -->|"loads map data"| node_school_data
node_map -->|"reads approved locations"| node_storage
node_map -.->|"geocodes addresses"| node_geocoder

click node_flask "https://github.com/lacambraeron/rrw/blob/main/app/__init__.py"
click node_campaign "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_campaign_views "https://github.com/lacambraeron/rrw/tree/main/app/templates"
click node_pledge "https://github.com/lacambraeron/rrw/blob/main/app/templates/pledge.html"
click node_resources "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_scheduler_routes "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_registration_view "https://github.com/lacambraeron/rrw/blob/main/app/templates/register.html"
click node_storage "https://github.com/lacambraeron/rrw/blob/main/app/storage.py"
click node_admin "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_calendar "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_backup "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_mail "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_map "https://github.com/lacambraeron/rrw/blob/main/app/routes.py"
click node_school_data "https://github.com/lacambraeron/rrw/tree/main/app/static/resources"

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_flask,node_campaign,node_campaign_views,node_pledge,node_resources,node_staff_actor toneBlue
class node_scheduler_routes,node_registration_view,node_storage,node_postgres toneAmber
class node_admin,node_calendar,node_backup,node_mail toneMint
class node_map,node_school_data toneRose
class node_visitor,node_resources_site,node_google_form,node_smtp,node_geocoder toneIndigo
```

## Components

### Campaign site

- [Flask app](https://github.com/lacambraeron/rrw/blob/main/app/__init__.py): `app/__init__.py`
- [Campaign pages](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`
- [Campaign templates](https://github.com/lacambraeron/rrw/tree/main/app/templates): `app/templates`
- [Pledge form](https://github.com/lacambraeron/rrw/blob/main/app/templates/pledge.html): `app/templates/pledge.html`
- [Prevention resources](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`

### Event scheduler

- [Registration workflow](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`
- [Registration templates](https://github.com/lacambraeron/rrw/blob/main/app/templates/register.html): `app/templates/register.html`
- [Database access](https://github.com/lacambraeron/rrw/blob/main/app/storage.py): `app/storage.py`

### Staff tools

- [Request review](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`
- [Approved calendar](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`
- [Excel export](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`
- [Approval email](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`

### School planning

- [School planning map](https://github.com/lacambraeron/rrw/blob/main/app/routes.py): `app/routes.py`
- [School datasets](https://github.com/lacambraeron/rrw/tree/main/app/static/resources): `app/static/resources`

### Other components

- **Visitor**
- **Staff user**
- **Arizona resources site**
- **Google Form**
- **PostgreSQL**
- **SMTP service**
- **Census geocoder**

## Connections

- Visitor → Flask app: requests pages
- Flask app → Campaign pages: dispatches routes
- Campaign pages → Campaign templates: renders pages
- Campaign pages → Pledge form: renders pledge
- Pledge form → Google Form: embeds form
- Campaign pages → Prevention resources: redirects request
- Prevention resources → Arizona resources site: redirects to
- Visitor → Registration workflow: submits request
- Registration workflow → Registration templates: renders workflow
- Registration workflow → Database access: reads and writes
- Flask app → Database access: initializes database
- Database access → PostgreSQL: queries and migrates
- Staff user → Request review: reviews requests
- Staff user → Approved calendar: views events
- Staff user → Excel export: requests export
- Request review → Database access: reads and updates
- Approved calendar → Database access: reads approvals
- Excel export → Database access: reads registrations
- Request review → Approval email: sends approval email
- Approval email → SMTP service: sends message
- Visitor → School planning map: opens map
- School planning map → School datasets: loads map data
- School planning map → Database access: reads approved locations
- School planning map → Census geocoder: geocodes addresses
