Quick Start
Create a working Pyxle app in under 5 minutes.
1. Scaffold a new project
pyxle init my-appThis creates a my-app/ directory with a complete starter project.
2. Install dependencies
cd my-app
pyxle installThis runs both pip install -r requirements.txt and npm install. You can also run them separately:
pip install -r requirements.txt
npm install3. Start the dev server
pyxle devOpen http://localhost:8000 in your browser. You should see the Pyxle starter page — a centered card showing the framework version, server time, and a link to edit pages/index.pyxl.
Tailwind compiles automatically because the scaffold ships with postcss.config.cjs — PostCSS runs as part of the Vite pipeline, so there's nothing separate to start.
What just happened?
When you ran pyxle dev, the framework:
- Compiled
pages/index.pyxl-- split the Python server code from the React JSX - Started Vite -- the JavaScript bundler that serves your React components with hot reload
- Started Starlette -- the Python ASGI server that handles routing, SSR, and API requests
- Ran the
@serverloader -- fetched data on the server and passed it as props to React - Rendered HTML on the server -- sent fully-rendered HTML to the browser (SSR)
- Hydrated on the client -- React took over the server-rendered HTML for interactivity
4. Make a change
Open pages/index.pyxl in your editor. Change the message returned by load_home:
@server
async def load_home(request):
now = datetime.now(tz=timezone.utc)
return {
"version": __version__,
"time": now.strftime("%H:%M:%S UTC"),
"message": "Hello from my Pyxle app!",
}Save the file. The browser reloads automatically with your updated message.
5. Check your routes
pyxle routesThis prints the route table derived from your pages/ directory:
Route File Loader
/ pages/index.pyxl load_home
/api/pulse pages/api/pulse.py --6. Validate your project
pyxle checkThis validates .pyxl syntax, checks your config file, and reports any issues.
Next steps
- Understand what each file does: Project Structure
- Learn the
.pyxlfile format: `.pyxl` Files - Add a new page with data loading: Data Loading