Skip to content

Port to modern Python stack (Python 3 + Flask + Fly.io) #3

@simonbc

Description

@simonbc

Goal

Port the 2007 Jottit codebase (Python 2, web.py 0.22, Jinja 1, psycopg2 0.6, reCAPTCHA v1) to a modern Python stack and deploy it to Fly.io — as a natural progression of what's here, not a from-scratch rewrite.

Target stack

  • Python 3.12, Flask + Blueprints with host_matching=True (subdomain routing day 1)
  • SQLAlchemy Core + Alembic
  • mistune v3 (markdown) replacing markdown2 1.0
  • nh3 (HTML sanitizer) replacing the bespoke sanitize.py
  • Cloudflare Turnstile replacing reCAPTCHA v1
  • uv + ruff + pyright for tooling
  • Deployed to Fly.io (Dockerfile + fly.toml + wildcard cert)

Approach

Incremental — one small PR per step, merged to main continuously. Original 2007 code at app.py, db.py, etc. stays as the starting point; new code lands in a jottit/ package alongside.

Milestones

  • M1: Project skeleton (Flask app, blueprints, DB tables)
  • M2: Site resolver + index/new-site flow
  • M3: Page view + edit + draft
  • M4: Auth (sessions, claim, signin, password)
  • M5: Admin (settings, design, URL, delete, export)
  • M6: History, diff, revert, changes, atom feeds
  • M7: Templates port (Jinja 1 → Jinja2)
  • M8: Turnstile + Alembic + Dockerfile + fly.toml

Each PR in this effort links back here.

🤖 Tracked with Claude Code

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