Quick Start
First Run
1. Run Rancher Desktop
Run Rancher Desktop ready to start Docker container
2. Configure environment vars:
Copy .env-example to .env, and edit as needed
3. Bring up the Docker container:
For the first time, or after editing any config files:
docker compose up --build
For subsequent runs:
docker compose up
4. Browse site
Visit: http://localhost:5000
5. Shutdown the app and stop container
Ctrl+C
6. Remove the Docker container if needed
docker compose down
Create Your App
1. Define database schema in db/config.py
See schema doc for more details
2. Define routes and handlers in __init__.py
See CRUD example doc for examples
Design Patterns to Follow…
-
Route Pattern (See routes guide)
@app.get("/path") def handler(): return render_template("page.jinja") -
Database Query Pattern (see sqlite guide)
with connect_db() as db: sql = "SELECT * FROM table WHERE col=?" params = (value,) rows = db.execute(sql, params).fetchall() -
Form Processing Pattern (see forms guide)
@app.post("/path") def handler(): value = request.form.get('field', '').strip() value = html.escape(value) # ... validate, then save
3. Edit / create page templates
See jinja doc for more details