Guides Overview
This tutorial builds one ToDo application from scratch across six sequential steps. By the end, you will have a working single-page app with reactive filtering, reusable components, hash-routed views, validated forms, async HTTP loading, error recovery, and a static production bundle.
Each step runs a live interactive PyScript demo and shows its full standalone app.py source at the bottom of the page, so you can read and test every milestone independently.
Prerequisites#
- Completed Quickstart and Project Structure
- A local project created with
webcompy initand dependencies installed viauv sync
Tutorial roadmap#
| Step | Topic | What the app gains | Time |
|---|---|---|---|
| 1 | Step 1: App Shell | Seeded tasks in a ReactiveList, filter state, use_computed, repeat(..., key=...) |
~10 min |
| 2 | Step 2: Components | Extracted TodoItem and TodoToolbar components using props and slots |
~10 min |
| 3 | Step 3: Navigation | Flat Router (/, /active, /done), RouterLink active styling, and RouterView |
~10 min |
| 4 | Step 4: Forms | Add-task form with use_field, validators, use_form, FormField, Input, and Checkbox |
~15 min |
| 5 | Step 5: Remote Data | Typed HttpClient requests, use_async_result loading/error UI, and an in-app FetchMiddleware mock |
~15 min |
| 6 | Step 6: Deploy | ErrorBoundary recovery and static build output with webcompy generate |
~10 min |
How each step builds on the last#
- Shell first, interactivity second: Start by proving that reactive collections and derived counts render cleanly before adding child components or routes.
- Basic-tier APIs throughout: Every step stays within core WebComPy primitives (
webcompy.signal,webcompy.components,webcompy.elements,webcompy.router,webcompy.forms,webcompy.ui, andwebcompy.ajax), except Step 5's compact client-sideFetchMiddlewaremock so remote requests work identically on static hosting. - Self-contained demos: Every step embeds a runnable iframe backed by its own
app.pyfile and finishes with links to deeper reference pages.
Next steps#
- Start building the app shell in Step 1: App Shell.