Skip to content

pyxle-framework/Pyxle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Pyxle

The Python full-stack framework.
Server logic in Python. UI in React. One file.

PyPI   Website


# pages/index.pyxl

@server
async def load(request):
    return {"message": "Hello from Python"}

# --- JSX ---
export default function Home({ data }) {
    return <h1>{data.message}</h1>;
}

Pyxle compiles .pyxl files into Python server modules and React client components. @server loaders run on the backend, SSR renders the HTML, React hydrates on the client.

Get started

pip install pyxle-framework
pyxle init my-app && cd my-app
pyxle install
pyxle dev

Open http://localhost:8000.

Features

.pyxl files -- Python + React in a single file, split at compile time File-based routing -- pages/ maps to URLs, dynamic segments with [param].pyxl SSR -- Server-side rendering via esbuild + React 18 @server / @action -- Typed data loading and form mutations Layouts -- Nested layouts and templates with slot composition Vite HMR -- Fast refresh in development Tailwind -- Pre-configured out of the box Production build -- pyxle build + pyxle serve for deployment

Documentation

Full docs at pyxle.dev/docs:

CLI

pyxle init <name>     Scaffold a new project
pyxle install         Install Python + Node dependencies
pyxle dev             Development server with HMR
pyxle build           Production build
pyxle serve           Serve the production build

Requirements

Python 3.10+ and Node.js 18+.

Contributing

git clone https://github.com/pyxle-framework/pyxle.git
cd pyxle
pip install -e ".[dev]"
pytest

Links

About

Meet Pyxle - where Python and React unites

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors