refactor: simplify app system to convention over configuration
Replace class-based app system with convention-based discovery for simpler
app development with zero boilerplate.
Before (class-based):
- apps/home/__init__.py - HomeApp class inheriting from BaseApp
- apps/home/templates/workspace.html - nested in templates/ folder
- Manual path overrides needed to avoid collisions
- Confusing template resolution (relative vs absolute paths)
After (convention-based):
- apps/home/app.json - {"icon": "🏠", "label": "Home"}
- apps/home/workspace.html - directly in app folder
- apps/home/routes.py - Flask blueprint (auto-discovered)
- apps/home/service.html - optional background service
- apps/home/hooks.py - optional dynamic logic (future)
Changes:
- Refactor apps/__init__.py to use dataclass App instead of BaseApp ABC
- Discovery now looks for routes.py + workspace.html (required)
- Optional files auto-detected: service.html, app_bar.html, hooks.py
- Template paths resolve automatically relative to app folder
- Metadata (icon, label) loaded from app.json with sensible defaults
- Blueprint auto-discovered by finding *_bp variable in routes.py
- Update convey/__init__.py to add apps/ to Jinja template search path
- Remove apps/home/__init__.py and apps/dev/__init__.py classes
- Move templates from apps/{name}/templates/ to apps/{name}/ directly
- Add app.json files for metadata
- Remove template_folder from blueprints (no longer needed)
Benefits:
- No Python classes, inheritance, or method overriding needed
- No template path collisions (automatic resolution)
- Creating new apps is trivial (3 files: routes.py, workspace.html, app.json)
- Clear separation: routes.py for logic, templates for UI, app.json for metadata
- Optional hooks.py for dynamic logic when needed
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>