diff --git a/README.md b/README.md index f97c3b8..7f53eba 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,36 @@ -## Architecture +# Lit + Zustand Architecture -* Lit-based web components +A modern, no-build web application architecture using Lit web components with Zustand state management and IndexedDB persistence. -* No-build tooling (importmap only) +## For TSX/React Developers + +If you're coming from React/TSX, here's how this architecture maps to familiar concepts: + +| React/TSX Pattern | This Architecture | +|-------------------|-------------------| +| `useState` / `useReducer` | Zustand vanilla store | +| `useEffect` + state subscription | `StoreController` (ReactiveController) | +| Context API | Global Zustand store | +| `localStorage` / `sessionStorage` | IndexedDB via persist middleware | +| JSX | Lit's `html` tagged template literals | +| CSS-in-JS / CSS Modules | Lit's `css` tagged template literals | +| React Router | Simple route state in store | +| Build step (Vite/Webpack) | Import maps (no build!) | + +### Key Differences + +1. **No Virtual DOM**: Lit uses native Web Components with efficient DOM updates +2. **No Build Step**: Import maps let you use npm packages directly from CDN +3. **Reactive Controllers**: Replace hooks - attach to component lifecycle +4. **Tagged Templates**: Instead of JSX, use `html\`