About Pickle-Reactor

A Next.js-style Python framework using Pyodide and VDOM diffing.

✨ Features

  • 🐍 Write UI components in Python (server & client)
  • ⚑ Server-Side Rendering (SSR) for fast initial load
  • πŸ”„ Virtual DOM with efficient diffing algorithm
  • 🎯 React-style hooks (use_state) for state management
  • πŸ—ΊοΈ File-based routing (Next.js-style)
  • πŸ” HTML escaping for XSS protection
  • 🌐 Runs Python in browser via Pyodide WebAssembly
  • 🎨 Component-based architecture

πŸ—οΈ Architecture

Pickle-Reactor uses a hybrid rendering approach:

  • Server (FastAPI): Renders components to HTML for initial page load
  • Client (Pyodide): Hydrates HTML with interactivity using Python in WebAssembly
  • VDOM: Efficient DOM updates using Preact-style O(n) diffing
  • State: React-style hooks for component state management
  • Routing: File-based routing with server and client-side navigation

πŸ› οΈ Technology Stack

  • Pyodide 0.24+: Python 3.11 in WebAssembly
  • FastAPI: Modern async Python web framework
  • PyScript pydom: Pythonic DOM manipulation
  • VDOM: Custom Python implementation with Preact-style diffing
  • pytest: Comprehensive testing (unit, integration, E2E)

πŸš€ Implementation Phases

  • βœ… Phase 1: VNode, SSR, Pyodide Bootstrap
  • βœ… Phase 2: ComponentInstance, use_state, mount/rerender
  • βœ… Phase 3: patch(), events, keyed children
  • βœ… Phase 4: Routing, multiple pages
  • βœ… Phase 5: Data loading, server actions
  • βœ… Phase 6: CLI, development server, production build

Ready to build interactive Python web apps? Try the Todo demo or go back home!