All ArticlesOPINION

FastHTML + Faststrap: The Python Full-Stack I've Been Building For

For the first few years of my career, my full-stack stack was React on the frontend and FastAPI on the backend. It worked. It also meant maintaining two codebases in two languages, managing cross-origin auth, serialising data twice, and keeping TypeScript types in sync with Python Pydantic models.

When I found FastHTML, I was sceptical. A Python web framework that generates HTML components? That sounded like early 2000s PHP cgi-bin energy.

I was wrong.

What FastHTML Actually Is

FastHTML is not a template engine. It's a component framework where Python objects are the HTML. There's no template syntax to learn, no context processors, no Jinja2 escaping edge cases. You write Python, and you get HTML — typed, composable, and testable.

Faststrap adds Bootstrap 5 component abstractions on top: Button(), Card(), Row(), Col(), Icon() — all returning proper FastHTML elements with Bootstrap classes applied. It also includes SEO helpers, theme management, toggle groups, and effect utilities.

The HTMX Advantage

HTMX fills the gap that used to require React: partial page updates, out-of-band swaps, inline form submissions, polling. Combined with FastHTML's server-side rendering, the result is an interactive UI with no JavaScript framework — just HTML attributes that trigger HTTP requests.

For the Student EWS project (an academic monitoring system I built recently), the inline score entry works entirely via HTMX: click a cell, it becomes an input, blur saves the score, triggers a full recompute chain (GPA → risk → alerts), and swaps four separate DOM elements via OOB (out-of-band) updates. Zero JavaScript written.

Where It Wins

  • No context switching — backend and frontend in one Python process
  • Vercel-ready — stateless ASGI, deploys cleanly
  • Composability — components are just Python functions, so testing is trivial
  • Faststrap's SEO moduleSEO(), PageMeta(), StructuredData() out of the box

Where It Needs Work

  • The ecosystem is small — fewer ready-made component libraries than React
  • Complex client-side state (drag and drop, canvas, realtime collaboration) still needs JavaScript
  • Debugging rendered HTML can be noisy when component trees are deep

My Verdict

For Python developers building information-dense, server-rendered applications — dashboards, portals, SaaS products, data platforms — FastHTML + Faststrap is the most productive stack I've used. The code-to-working-product ratio is the best I've experienced in 5 years of professional development.

I'm building everything new with it, and I'm not going back.