Skip to main content

Backend-first SPA framework in Python.

Project description

lua-spa logo

LUA-SPA

Backend-first SPA framework in Python.

This project includes:

  • LuaTemplate file served by the backend
  • .lspa components (HTML + Python) with component import support
  • Client hydration at component level
  • DOM diff renderer inspired by React's virtual DOM flow
  • useState hook-style state management
  • Base app definitions isolated in lua_template/spa.config.json

Requirements

  • Python 3.10+
  • Poetry installed

How to use

Install locally (development)

poetry install

Create a new project

lua-spa create my_project
lua-spa create my_project ./apps

Run the application

poetry run lua-spa serve

Enable hot reload:

poetry run lua-spa serve --reload

Open in browser:

http://127.0.0.1:8000

Documentation

Docs are available in the docs/ directory:

Run locally:

cd docs
npx docusaurus start

Project Structure

lua-spa/
  pyproject.toml
  src/
    lua_spa/
      app.py
      framework.py
      main.py
  lua_template/
    index.lspa
    spa.config.json
    components/
  tests/

Tests

poetry run pytest

With coverage:

poetry run pytest --cov=src/lua_spa --cov-report=term

Component Format

Components are .lspa files composed of:

  • optional imports
  • <python> block (executed on backend)
  • <template> block (HTML)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lua_spa-1.0.2.tar.gz (2.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lua_spa-1.0.2-py3-none-any.whl (2.3 MB view details)

Uploaded Python 3

File details

Details for the file lua_spa-1.0.2.tar.gz.

File metadata

  • Download URL: lua_spa-1.0.2.tar.gz
  • Upload date:
  • Size: 2.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lua_spa-1.0.2.tar.gz
Algorithm Hash digest
SHA256 291f5ebdbbabfe6bbb575beba97803b646f0a4863960b18701ed769c7c57cd27
MD5 5897f0d86dd3765660df0f2d039d6ee1
BLAKE2b-256 e512c6271a3889f456300e89da07fa633a6c085816066fdca72884fa11d268c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for lua_spa-1.0.2.tar.gz:

Publisher: release-and-deploy.yaml on roderiano/lua-spa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lua_spa-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: lua_spa-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 2.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for lua_spa-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 16c7e8bb0f36da40f85af15515079181111ffa3552f9e106e2eeca726b5dd9cd
MD5 dc186ad4625ee2e357681ce1f111ee7a
BLAKE2b-256 2cfc63ed3e0dd60f15da57d8ec70ab51f6909b67e0c1e67fc7cefb36b46bda88

See more details on using hashes here.

Provenance

The following attestation bundles were made for lua_spa-1.0.2-py3-none-any.whl:

Publisher: release-and-deploy.yaml on roderiano/lua-spa

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page