# eugene234466/holycode architecture

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

- Interactive diagram: https://gitdiagram.com/eugene234466/holycode
- Repository: https://github.com/eugene234466/holycode

## Overview

HolyCode is a Flask community platform for daily scripture-based coding devotionals and challenges, with anonymous submissions, voting, learning tools, image generation, and push alerts. The main user flow runs through Flask routes to PostgreSQL and, for concept explanations and images, the relevant services. A separate scheduled flow generates daily content from scripture and Groq, persists it, then notifies subscribers. The graph preserves README-described archive, PWA, and code-card capabilities; those routes/templates are incompletely sampled, so only documented or excerpt-visible relationships are shown.

Main entry points: [`app.py`](https://github.com/eugene234466/holycode/blob/main/app.py) (Flask routes), [`services/scheduler.py`](https://github.com/eugene234466/holycode/blob/main/services/scheduler.py) (Daily scheduler), [`services/notifications.py`](https://github.com/eugene234466/holycode/blob/main/services/notifications.py) (Push notifications), [`static/js/app.js`](https://github.com/eugene234466/holycode/blob/main/static/js/app.js) (Browser client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Daily content"]
  node_scheduler["Daily scheduler<br/>[scheduler.py]"]
  node_bible["Scripture fetch<br/>[bible.py]"]
  node_ai["Groq generation<br/>[groq_ai.py]"]
end

subgraph group_community["Community experience"]
  node_app["Flask routes<br/>[app.py]"]
  node_community_data["Submissions and votes<br/>[app.py]"]
  node_archive["Devotional archive<br/>[app.py]"]
  node_images["Image generation<br/>[image_gen.py]"]
end

subgraph group_platform["Persistence and delivery"]
  node_database[("PostgreSQL data<br/>[db.py]")]
  node_config["Runtime config<br/>[config.py]"]
  node_notifications["Push notifications<br/>[notifications.py]"]
end

subgraph group_client["Web client"]
  node_templates["Page templates"]
  node_browser["Browser client<br/>[app.js]"]
  node_service_worker["Offline worker<br/>[sw.js]"]
end

node_visitor(("Visitor"))
node_push_service["Web push service"]
node_pollinations["Pollinations image API"]
node_scripture_api["OurManna API"]

node_visitor -->|"requests pages"| node_app
node_app -->|"reads and writes"| node_database
node_app -.->|"renders pages"| node_templates
node_app -->|"requests explanations"| node_ai
node_app -->|"generates images"| node_images
node_app -->|"notifies winner"| node_notifications
node_app -->|"starts and invokes"| node_scheduler
node_scheduler -->|"fetches verse"| node_bible
node_scheduler -->|"generates content"| node_ai
node_scheduler -->|"stores daily content"| node_database
node_scheduler -->|"sends alerts"| node_notifications
node_bible -->|"fetches verse"| node_scripture_api
node_ai -.->|"gets challenge verse"| node_scripture_api
node_notifications -->|"loads subscribers"| node_database
node_notifications -->|"sends push"| node_push_service
node_app -->|"handles submissions and likes"| node_community_data
node_app -.->|"serves past content"| node_archive
node_images -->|"requests AI image"| node_pollinations
node_browser -->|"calls app routes"| node_app
node_browser -->|"registers worker"| node_service_worker
node_service_worker -->|"caches assets"| node_browser

click node_app "https://github.com/eugene234466/holycode/blob/main/app.py"
click node_scheduler "https://github.com/eugene234466/holycode/blob/main/services/scheduler.py"
click node_bible "https://github.com/eugene234466/holycode/blob/main/services/bible.py"
click node_ai "https://github.com/eugene234466/holycode/blob/main/services/groq_ai.py"
click node_database "https://github.com/eugene234466/holycode/blob/main/database/db.py"
click node_config "https://github.com/eugene234466/holycode/blob/main/config.py"
click node_notifications "https://github.com/eugene234466/holycode/blob/main/services/notifications.py"
click node_community_data "https://github.com/eugene234466/holycode/blob/main/app.py"
click node_archive "https://github.com/eugene234466/holycode/blob/main/app.py"
click node_images "https://github.com/eugene234466/holycode/blob/main/services/image_gen.py"
click node_templates "https://github.com/eugene234466/holycode/tree/main/templates"
click node_browser "https://github.com/eugene234466/holycode/blob/main/static/js/app.js"
click node_service_worker "https://github.com/eugene234466/holycode/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_scheduler,node_bible,node_ai toneBlue
class node_app,node_community_data,node_archive,node_images toneAmber
class node_database,node_config,node_notifications,node_pollinations,node_scripture_api toneMint
class node_templates,node_browser,node_service_worker toneRose
class node_visitor,node_push_service toneIndigo
```

## Components

### Daily content

- [Daily scheduler](https://github.com/eugene234466/holycode/blob/main/services/scheduler.py): `services/scheduler.py`
- [Scripture fetch](https://github.com/eugene234466/holycode/blob/main/services/bible.py): `services/bible.py`
- [Groq generation](https://github.com/eugene234466/holycode/blob/main/services/groq_ai.py): `services/groq_ai.py`

### Community experience

- [Flask routes](https://github.com/eugene234466/holycode/blob/main/app.py): `app.py`
- [Submissions and votes](https://github.com/eugene234466/holycode/blob/main/app.py): `app.py`
- [Devotional archive](https://github.com/eugene234466/holycode/blob/main/app.py): `app.py`
- [Image generation](https://github.com/eugene234466/holycode/blob/main/services/image_gen.py): `services/image_gen.py`

### Persistence and delivery

- [PostgreSQL data](https://github.com/eugene234466/holycode/blob/main/database/db.py): `database/db.py`
- [Runtime config](https://github.com/eugene234466/holycode/blob/main/config.py): `config.py`
- [Push notifications](https://github.com/eugene234466/holycode/blob/main/services/notifications.py): `services/notifications.py`

### Web client

- [Page templates](https://github.com/eugene234466/holycode/tree/main/templates): `templates`
- [Browser client](https://github.com/eugene234466/holycode/blob/main/static/js/app.js): `static/js/app.js`
- [Offline worker](https://github.com/eugene234466/holycode/blob/main/sw.js): `sw.js`

### Other components

- **Visitor**
- **Web push service**
- **Pollinations image API**
- **OurManna API**

## Connections

- Visitor → Flask routes: requests pages (evidence: `README.md`)
- Flask routes → PostgreSQL data: reads and writes (evidence: `app.py`)
- Flask routes → Page templates: renders pages (evidence: `README.md`)
- Flask routes → Groq generation: requests explanations (evidence: `app.py`)
- Flask routes → Image generation: generates images (evidence: `app.py`)
- Flask routes → Push notifications: notifies winner (evidence: `app.py`)
- Flask routes → Daily scheduler: starts and invokes (evidence: `app.py`)
- Daily scheduler → Scripture fetch: fetches verse (evidence: `services/scheduler.py`)
- Daily scheduler → Groq generation: generates content (evidence: `services/scheduler.py`)
- Daily scheduler → PostgreSQL data: stores daily content (evidence: `services/scheduler.py`)
- Daily scheduler → Push notifications: sends alerts (evidence: `services/scheduler.py`)
- Scripture fetch → OurManna API: fetches verse (evidence: `services/bible.py`)
- Groq generation → OurManna API: gets challenge verse (evidence: `services/groq_ai.py`)
- Push notifications → PostgreSQL data: loads subscribers (evidence: `services/notifications.py`)
- Push notifications → Web push service: sends push (evidence: `services/notifications.py`)
- Flask routes → Submissions and votes: handles submissions and likes (evidence: `app.py`)
- Flask routes → Devotional archive: serves past content (evidence: `README.md`)
- Image generation → Pollinations image API: requests AI image (evidence: `services/image_gen.py`)
- Browser client → Flask routes: calls app routes (evidence: `static/js/app.js`)
- Browser client → Offline worker: registers worker (evidence: `static/js/app.js`)
- Offline worker → Browser client: caches assets (evidence: `sw.js`)
