- NiceGUI apps start with
ui.run()which launches the web server - The app uses FastAPI/Starlette underneath with Uvicorn as the ASGI server
- Frontend uses Vue.js, Quasar, and Tailwind CSS
From the documentation analysis:
- No explicit mention of
app.storage.generalbeing client-side localStorage - Storage appears to be a NiceGUI abstraction but implementation details not clear
- The framework focuses on reactive UI elements, not persistent storage
- Built on top of FastAPI (ASGI framework)
- Uses WebSocket connections for real-time updates
- Docker deployment is well-supported
- Can run behind reverse proxies (nginx examples provided)
The documentation doesn't clearly explain:
- Whether
app.storageis server-side or client-side - How storage persists across server restarts
- Best practices for state persistence
- Lifecycle hooks for initialization
-
Storage Type Unclear: The docs don't confirm if
app.storage.generalis browser localStorage or server-side storage -
No State Persistence Examples: No examples show persisting game state across server restarts
-
Docker/Production Focus: Examples focus on deployment but not on state management
-
Testing Approach: The testing framework uses a
Screenclass for UI testing, not state persistence testing
Since NiceGUI documentation doesn't provide clear guidance on persistent storage:
- Assume Client-Side: Treat
app.storage.generalas client-side until proven otherwise - Implement Server-Side: Create our own server-side persistence layer
- Use FastAPI Features: Leverage the underlying FastAPI for lifecycle management
- File/DB Storage: Implement file or database storage independent of NiceGUI
- Test if
app.storage.generalsurvives server restarts (empirical testing) - Implement server-side storage solution (file or SQLite)
- Use FastAPI lifecycle events for initialization
- Create proper state management layer