Skip to content

Refactor app.py into focused dashboard modules #43

Description

@raychrisgdp

Goal

Break down the current monolithic app.py into smaller, focused modules while preserving dashboard behavior and data-source provenance.

Why

app.py currently mixes Flask app setup, API routes, update endpoints, request parsing, response shaping, and page routes. Recent performance work moved aggregation into dashboard/snapshot.py, but the route layer still carries enough responsibility that future token/source changes are harder to review safely.

Scope

  • Keep behavior stable unless a sub-issue explicitly changes it.
  • Preserve existing API contracts, source labels, token definitions, and simulated mode behavior.
  • Prefer small, reviewable PRs over a single broad rewrite.
  • Update tests with each behavior-preserving move so regressions are visible.

Proposed Sub-Issues

  • Move dashboard API routes out of app.py into a focused module or blueprint.
  • Move local update/version routes and helpers out of app.py.
  • Centralize shared request parsing and response helpers.
  • Extract large inline frontend JS/CSS only if route/template cleanup leaves the template as the next bottleneck.

Done

  • app.py is mostly Flask wiring and page route registration.
  • API/update route modules have clear ownership and tests.
  • Existing review commands pass: scripts/review.sh, unit tests, and py_compile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions