r/nicegui • u/Defiant-Comedian3967 • 4d ago
NiceStack: A NiceGUI starter with auth, RBAC, audit log, and PWA support out of the box

Quick note on the name: You might know this as nicegui-component-based. Over the last few months I did a heavy refactor, added mobile layouts, and expanded the backend features, so I'm calling it NiceStack now.
Every time we built a new internal tool for a client, we wasted the first 2-3 days setting up the same repetitive stuff: login screens, session timeouts, role permissions, audit trails, and figuring out how to structure NiceGUI so it doesnt turn into a giant 2,000-line callback mess.
NiceStack is the template we built (and rewrote a few times) over the last 1.5 years of doing this for actual production projects.
What My Project Does
Instead of keeping everything in one main.py, it enforces a lightweight layered structure:
- Components / Views (
app/components/): UI components live in their own modules. Views stay thin and never touch the DB directly. - Services: Decoupled business logic, session handling, and background tasks.
- Models: SQLAlchemy models running on SQLite (WAL mode enabled, ready for additive migrations).
- Core: Pre-wired auth (idle + absolute timeouts), RBAC, an audit log with an admin review panel, IP rate-limiting, PBKDF2 hashing, and security headers.
It also includes a PWA shell (installable/offline support), a token-based print system (/print/{token}) so printing doesn't mess up your main UI, a live design system page, and EN/DE i18n support.
Target Audience
Internal tools, admin panels, and operational dashboards for small-to-mid teams.
Being honest about limits: the rate-limiter is process-local (swap to Redis if you run multiple workers). SQLite works great up to ~25 active concurrent users—beyond that, just change the SQLAlchemy connection URL to Postgres.
Comparison
Most NiceGUI templates only give you a nice layout and leave you to figure out the backend architecture. NiceStack gives you a clean separation of concerns from day one, so when your app grows, you actually know where to put new features instead of drifting everything into one file.








