refactor(appview): implement dependency injection pattern (#11)
Introduces a proper dependency injection pattern to make the appview
more testable and configurable. This change improves separation of
concerns and enables easier mocking in tests.
Changes:
- Add AppContext interface and factory (app-context.ts)
- Extract app creation logic to createApp() (create-app.ts)
- Add test helper createTestContext() (test-context.ts)
- Refactor index.ts to use composition root pattern
- Wrap startup in async main() for better error handling
Benefits:
- Dependencies can be easily swapped for testing
- Clear composition root at application startup
- Proper lifecycle management (creation and cleanup)
- More testable architecture with explicit dependencies