# learnacha/course-explainer-app architecture

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

- Interactive diagram: https://gitdiagram.com/learnacha/course-explainer-app
- Repository: https://github.com/learnacha/course-explainer-app

## Overview

1. **Overall shape**
   - This is a small **server-rendered Flask application** written in Python.
   - The architecture is simple: **HTTP request → Flask route/view → course data/model → Jinja template → HTML/CSS response**.

2. **Application entry point**
   - `src/app.py` is the bootstrap layer that starts the Flask app and wires routes together.
   - There is no evidence of a separate backend service, queue, or API layer; this is a single-process web app.

3. **Request handling layer**
   - `src/views.py` contains the route handlers and page logic.
   - It is the main boundary between the web framework and the app’s content, deciding which template to render and what data to pass in.

4. **Data/content layer**
   - `src/models.py` holds the course data structures or course-related definitions.
   - The repository tree does not show a database, ORM migrations, or persistence subsystem, so the app appears to rely on **local/static in-memory data** rather than external storage.

5. **Presentation layer**
   - `src/templates/` contains Jinja templates for the pages:
     - `layout.html` is the shared base frame
     - `index.html` is the course listing/home page
     - `course.html` is the course detail page
     - `contact.html` is an additional informational page
   - This indicates a classic template inheritance setup, with page-specific content plugged into a common shell.

6. **Static assets**
   - `src/static/css/styles.css` provides the styling.
   - Static files are served directly by Flask, separate from the request/view/model path.

7. **User-facing routes and pages**
   - The README describes a home page with a list of courses and a detailed course page.
   - The presence of `contact.html` suggests a small additional route beyond the core course browsing flow.

8. **Primary data flow**
   - The key flow is: **browser requests a page → Flask route in `views.py` → course data from `models.py` → render Jinja template → return HTML**.
   - CSS is then loaded as a separate static request to style those rendered pages.

9. **Testing boundary**
   - `tests/test_app.py` covers the app’s routes and view behavior, so tests are focused on **HTTP-level correctness** rather than internal business logic.
   - `test-output/take_screenshots.py` suggests a visual verification step, likely for confirming rendered pages and layout.

10. **Tooling/infrastructure**
   - `requirements.txt` captures the Python/Flask dependencies.
   - `.github/workflows/` indicates CI automation is present, but it supports the app rather than shaping runtime architecture.
   - The `.claude` files are developer-assistant tooling and do not affect production behavior.

11. **Diagram boundary guidance**
   - Draw this repo as a **monolithic web app** with three main internal boxes:
     - **Flask app/routing**
     - **Course data/model**
     - **Jinja templates + static CSS**
   - There are no visible external services, databases, or microservices to include in the main architecture diagram.

Main entry points: [`src/views.py`](https://github.com/learnacha/course-explainer-app/blob/main/src/views.py) (Routes), [`src/app.py`](https://github.com/learnacha/course-explainer-app/blob/main/src/app.py) (App bootstrap), [`src/templates/layout.html`](https://github.com/learnacha/course-explainer-app/blob/main/src/templates/layout.html) (Layout), [`tests/test_app.py`](https://github.com/learnacha/course-explainer-app/blob/main/tests/test_app.py) (App tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_app["App bootstrap<br/>Flask entrypoint<br/>[app.py]"]
  node_views["Routes<br/>HTTP handlers<br/>[views.py]"]
end

subgraph group_content["Content"]
  node_models["Course data<br/>in-memory model<br/>[models.py]"]
  node_layout["Layout<br/>base template<br/>[layout.html]"]
  node_index["Home page<br/>Jinja template<br/>[index.html]"]
  node_course["Course page<br/>Jinja template<br/>[course.html]"]
  node_contact["Contact page<br/>Jinja template<br/>[contact.html]"]
  node_styles["Stylesheet<br/>CSS asset<br/>[styles.css]"]
end

subgraph group_quality["Quality"]
  node_tests["App tests<br/>pytest suite<br/>[test_app.py]"]
  node_screenshots["Screenshots<br/>visual check"]
end

subgraph group_tooling["Tooling"]
  node_deps["Dependencies<br/>python requirements<br/>[requirements.txt]"]
  node_ci["CI workflows<br/>automation<br/>[claude.yml]"]
  node_review["Review workflow<br/>automation"]
  node_claude["Claude tools<br/>assistant tooling<br/>[.claude]"]
end

node_app -->|"registers"| node_views
node_views -->|"reads"| node_models
node_views -->|"renders"| node_index
node_views -->|"renders"| node_course
node_views -->|"renders"| node_contact
node_index -->|"extends"| node_layout
node_course -->|"extends"| node_layout
node_contact -->|"extends"| node_layout
node_layout -->|"links"| node_styles
node_tests -->|"exercises"| node_app
node_screenshots -->|"verifies"| node_app
node_ci -->|"runs"| node_tests
node_review -->|"checks"| node_tests
node_deps -->|"supports"| node_app
node_claude -->|"supports"| node_screenshots

click node_app "https://github.com/learnacha/course-explainer-app/blob/main/src/app.py"
click node_views "https://github.com/learnacha/course-explainer-app/blob/main/src/views.py"
click node_models "https://github.com/learnacha/course-explainer-app/blob/main/src/models.py"
click node_layout "https://github.com/learnacha/course-explainer-app/blob/main/src/templates/layout.html"
click node_index "https://github.com/learnacha/course-explainer-app/blob/main/src/templates/index.html"
click node_course "https://github.com/learnacha/course-explainer-app/blob/main/src/templates/course.html"
click node_contact "https://github.com/learnacha/course-explainer-app/blob/main/src/templates/contact.html"
click node_styles "https://github.com/learnacha/course-explainer-app/blob/main/src/static/css/styles.css"
click node_tests "https://github.com/learnacha/course-explainer-app/blob/main/tests/test_app.py"
click node_screenshots "https://github.com/learnacha/course-explainer-app/blob/main/test-output/take_screenshots.py"
click node_deps "https://github.com/learnacha/course-explainer-app/blob/main/requirements.txt"
click node_ci "https://github.com/learnacha/course-explainer-app/blob/main/.github/workflows/claude.yml"
click node_review "https://github.com/learnacha/course-explainer-app/blob/main/.github/workflows/claude-code-review.yml"
click node_claude "https://github.com/learnacha/course-explainer-app/blob/main/.claude"

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_views toneBlue
class node_models,node_layout,node_index,node_course,node_contact,node_styles toneAmber
class node_tests,node_screenshots toneMint
class node_deps,node_ci,node_review,node_claude toneRose
```

## Components

### Runtime

Flask app and request handling

- [App bootstrap](https://github.com/learnacha/course-explainer-app/blob/main/src/app.py): Flask entrypoint · Starts the Flask app and wires the web application together · `src/app.py`
- [Routes](https://github.com/learnacha/course-explainer-app/blob/main/src/views.py): HTTP handlers · Defines page routes and controls which views are rendered · `src/views.py`

### Content

Course data and page templates

- [Course data](https://github.com/learnacha/course-explainer-app/blob/main/src/models.py): in-memory model · Holds course-related data and definitions used by the views · `src/models.py`
- [Layout](https://github.com/learnacha/course-explainer-app/blob/main/src/templates/layout.html): base template · Shared page shell used by the site templates · `src/templates/layout.html`
- [Home page](https://github.com/learnacha/course-explainer-app/blob/main/src/templates/index.html): Jinja template · Renders the course listing landing page · `src/templates/index.html`
- [Course page](https://github.com/learnacha/course-explainer-app/blob/main/src/templates/course.html): Jinja template · Renders the course detail page · `src/templates/course.html`
- [Contact page](https://github.com/learnacha/course-explainer-app/blob/main/src/templates/contact.html): Jinja template · Renders the additional contact or info page · `src/templates/contact.html`
- [Stylesheet](https://github.com/learnacha/course-explainer-app/blob/main/src/static/css/styles.css): CSS asset · Provides the site styling for rendered pages · `src/static/css/styles.css`

### Quality

Tests and verification tooling

- [App tests](https://github.com/learnacha/course-explainer-app/blob/main/tests/test_app.py): pytest suite · Exercises route behavior and HTTP-level correctness · `tests/test_app.py`
- [Screenshots](https://github.com/learnacha/course-explainer-app/blob/main/test-output/take_screenshots.py): visual check · Runs page capture and verification for rendered UI · `test-output/take_screenshots.py`

### Tooling

Repo automation and assistant helpers

- [Dependencies](https://github.com/learnacha/course-explainer-app/blob/main/requirements.txt): python requirements · Declares Flask and other runtime dependencies · `requirements.txt`
- [CI workflows](https://github.com/learnacha/course-explainer-app/blob/main/.github/workflows/claude.yml): automation · GitHub Actions workflows for repository automation · `.github/workflows/claude.yml`
- [Review workflow](https://github.com/learnacha/course-explainer-app/blob/main/.github/workflows/claude-code-review.yml): automation · Automated code review workflow configuration · `.github/workflows/claude-code-review.yml`
- [Claude tools](https://github.com/learnacha/course-explainer-app/blob/main/.claude): assistant tooling · Local assistant commands, skills, and support files · `.claude`

## Connections

- App bootstrap → Routes: registers · The app bootstrap imports and wires the route handlers
- Routes → Course data: reads · Route handlers pull course data for page rendering
- Routes → Home page: renders · The home route renders the course listing template
- Routes → Course page: renders · The detail route renders the course page template
- Routes → Contact page: renders · The additional route renders the contact template
- Home page → Layout: extends · Home page inherits the shared page shell
- Course page → Layout: extends · Course page inherits the shared page shell
- Contact page → Layout: extends · Contact page inherits the shared page shell
- Layout → Stylesheet: links · The base template loads the shared stylesheet
- App tests → App bootstrap: exercises · HTTP tests validate the Flask application behavior
- Screenshots → App bootstrap: verifies · Visual checks capture and confirm rendered pages
- CI workflows → App tests: runs · CI automation executes the test suite
- Review workflow → App tests: checks · Review automation depends on test outcomes
- Dependencies → App bootstrap: supports · Python dependencies enable the Flask runtime
- Claude tools → Screenshots: supports · Assistant tooling includes UI verification helpers
