Skip to content

[P2] Split app.py (~1,000 lines, ~50 routes) into Flask blueprints #9

Description

@ShadowWalkerNC

Summary

app.py currently owns all ~50 routes across auth, billing, API, website hub, and webhooks in a single ~1,000-line file. This makes it difficult to navigate, test, and onboard contributors.

Proposed Structure

blueprints/
  auth.py        # login, register, logout, OAuth flows (FB, Google, TikTok)
  billing.py     # Stripe checkout, portal, plan upgrade routes
  api.py         # /api/* endpoints (push_all, publish, history, etc.)
  website.py     # website hub editor + public site renderer
  webhooks.py    # stripe_webhook (already CSRF-exempt)

app.py becomes a thin factory that registers blueprints and initializes extensions.

Effort: ~1 day

Part of full audit: #1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions