Lightweight full-stack async Python web framework built on Starlette designed for rapid development without compromising in UX
Project description
Z8ter
Z8ter is a lightweight, async Python web framework built on Starlette, designed for rapid development without compromising UX. It combines SSR-first rendering, auto-discovered routes, auth scaffolding, and CLI tooling into one cohesive developer experience.
⚠️ Status: Public Alpha — Z8ter is under active development and not yet recommended for production. APIs and module paths may change without notice.
Quickstart
z8 new myapp
cd myapp
python3 -m venv venv
source venv/bin/activate # Windows: .\.venv\Scripts\activate
pip install -r requirements.txt
z8 run dev
Features
- File-based routing — Files under
views/map to routes automatically, each paired with a Jinja template and optional Python logic. - SSR + Islands — Server-side rendering by default, with per-page JS “islands” in
static/js/pages/<page_id>.jsfor interactivity. - Decorator-driven APIs — Define class-based APIs using decorators; auto-mounted under
/api/<id>. - Auth & Guards — Session middleware, Argon2 password hashing, and decorators like
@login_requiredfor route protection. - Composed Builder —
AppBuilderwires config, templating, Vite, sessions, and error handling in a predictable order. - CLI Tooling — Scaffold apps, views, and APIs with
z8 new,z8 create_page,z8 create_api; serve withz8 run dev. - React, DaisyUI, Tailwind Ready — Ships with modern frontend defaults for seamless full-stack workflows.
Installation
pip install z8ter
Authentication Example
from z8ter.endpoints.view import View
from z8ter.auth.guards import login_required
class Dashboard(View):
@login_required
async def get(self, request):
return self.render(request, "dashboard.jinja")
AppBuilder Example
from z8ter.builders.app_builder import AppBuilder
from myapp.repos import MySessionRepo, MyUserRepo
builder = AppBuilder()
builder.use_config(".env")
builder.use_templating()
builder.use_vite()
builder.use_app_sessions(secret_key="supersecret")
builder.use_auth_repos(session_repo=MySessionRepo(), user_repo=MyUserRepo())
builder.use_authentication()
builder.use_errors()
app = builder.build(debug=True)
Module Overview
| Module | Purpose |
|---|---|
z8ter.auth |
Auth contracts, Argon2 crypto, guards, and session middleware |
z8ter.builders |
AppBuilder and composable setup steps for config, templating, vite, auth, errors |
z8ter.cli |
CLI entrypoints: new, create_page, create_api, and run dev |
z8ter.endpoints |
Base API and View classes for SSR and REST endpoints |
z8ter.route_builders |
Discovers SSR and API routes from filesystem |
z8ter.responses / requests |
Wrappers around Starlette primitives |
z8ter.logging_utils |
Rich logging with CancelledError suppression |
z8ter.errors |
Centralized 404/500 error handling |
z8ter.vite |
Dev/prod script tag helpers for Vite asset loading |
z8ter.config |
Config loader with BASE_DIR and Starlette settings |
z8ter.core |
Lightweight ASGI wrapper around Starlette |
Framework Architecture
Backend Flow
route_builderswalks your project structure to register SSRViewclasses and API mounts.View.render()mergescontent/*.yamldata into Jinja templates, injectingpage_idfor client hydration.API.endpoint()decorators map handlers into Starlette routes automatically.- Auth pipeline:
middleware → guards → session managerensures secure user sessions. - Unified error and response modules abstract Starlette internals.
Frontend Pipeline
src/ts/app.tsbootstraps JS “islands” usingdata-pageattributes.- Solid.js components (e.g.
z8-clock.tsx) render inline viasolid-element(no shadow DOM). vite.config.tscompiles and writes manifest under/static/js/.vite.z8ter/vite.pyinjects dev or manifest-based<script>tags dynamically.- Tailwind and DaisyUI ship preconfigured for cohesive UI design.
CLI & Scaffolding
z8 new→ initializes a full project tree (safe for wheel installs).z8 create_page/create_api→ generate views, content YAML, and JS islands.z8 run dev→ launches Uvicorn with rich logging and live reload.
Philosophy
“Small surface area, sharp tools.”
- SSR-first with optional client interactivity
- Conventions over configuration
- Predictable lifecycle: builder → routes → middleware → templates
- Full-stack parity between Python and JS layers
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file z8ter-0.2.6.tar.gz.
File metadata
- Download URL: z8ter-0.2.6.tar.gz
- Upload date:
- Size: 196.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1518c3107189756d9058ff005e43c1e966d49c745a1e2f1171549d637b8f620f
|
|
| MD5 |
66f1fdcff640158abdc429e7a7b68920
|
|
| BLAKE2b-256 |
0dec4ce196292deb38515c7b4e8bd5e737c1bf09117295ec796d3d80b6b63395
|
File details
Details for the file z8ter-0.2.6-py3-none-any.whl.
File metadata
- Download URL: z8ter-0.2.6-py3-none-any.whl
- Upload date:
- Size: 221.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9d7cf2285fc42a590025071f6c62307c24efc89c11d2cc3e2c43b018b8882c8e
|
|
| MD5 |
863e9079924718a19b3a53373c65e909
|
|
| BLAKE2b-256 |
d43f8737d1f0432f6c60d63796aee7e4a413cdb64995ab05ddaca751342e08f0
|