Backend-first SPA framework in Python.
This project includes:
- LuaTemplate file served by the backend
.lspacomponents (HTML + Python) with component import support- Client hydration at component level
- DOM diff renderer inspired by React's virtual DOM flow
useStatehook-style state management- Base app definitions isolated in
lua_template/spa.config.json
- Python 3.10+
- Poetry installed
poetry installlua-spa create my_project
lua-spa create my_project ./appspoetry run lua-spa serveEnable hot reload:
poetry run lua-spa serve --reloadOpen in browser:
http://127.0.0.1:8000
Docs are available in the docs/ directory:
Run locally:
cd docs
npx docusaurus startlua-spa/
pyproject.toml
src/
lua_spa/
app.py
framework.py
main.py
lua_template/
index.lspa
spa.config.json
components/
tests/
poetry run pytestWith coverage:
poetry run pytest --cov=src/lua_spa --cov-report=termComponents are .lspa files composed of:
- optional imports
<python>block (executed on backend)<template>block (HTML)
