r/ForgeYourProject • • 11d ago

Launch full-stack-viltrum-template: a small teaching app for my V web framework, no ORM, no Docker, no React build

Last week I posted Viltrum here, my web framework for V. A framework on its own doesn't show much about what using it actually feels like, so I keep a small full-stack template next to it.

It's inspired by fastapi/full-stack-fastapi-template, but it's not a port. It's deliberately much smaller:

  • a landing page at / that shows live facts read from the running process
  • an admin dashboard, server-rendered with V's built-in $tmpl, with a session cookie login
  • a JSON API under /api/v1 that takes either a Bearer token or the same cookie
  • an in-memory store. No ORM, no Docker, no React build

The code is split by responsibility: models, store, auth, web routes, API routes, views. The idea is you swap store.v for a real database later and keep the handlers thin.

One thing worth knowing if you try it: in Viltrum 1.x, whatever a handler reads from the request (form values, headers, params, body) points into the connection's buffer and is only valid until the handler returns. So store.v clones every string it keeps. That comes with the zero-allocation core, and the template is where I show how to live with it.

Tests run end to end through handle_raw with no socket, so v test . runs anywhere. Serving needs Linux because the engine is epoll (WSL2 works on Windows).

Things I skipped on purpose: ORM, OAuth, email recovery, Docker, and TLS in-process (put Caddy or nginx in front).

Repo: https://github.com/Tuntii/full-stack-viltrum-template

If you picked up a starter like this, what's the first thing you'd want added? A real database adapter, or something else?

2 Upvotes

0 comments sorted by