Files
web-app-launcher/plans/service-integrations/CONTEXT.md
T
alexei.dolgolyov 50e8519220 feat(service-integrations): phase 2 — integration widget & app form UI
- Add 6 renderer components: StatCard, Gauge, List, Progress, AlertBanner, Chart
- Add IntegrationWidget container with auto-refresh, loading, error states
- Add IntegrationAlertOverlay for layout-level critical alerts
- Add IntegrationConfigFields for dynamic form generation from Zod schemas
- Register integration type in WidgetRenderer
- Extend WidgetCreationForm with integration app/endpoint pickers
- Extend AppForm with integration config section and test connection button
- Add /api/integrations/alerts endpoint
2026-03-25 22:07:51 +03:00

58 lines
2.1 KiB
Markdown

# Feature Context: Service Integrations
## Configuration
- **Development mode:** Automated
- **Execution mode:** Orchestrator
- **Strategy:** Big Bang
- **Build:** `npm run build`
- **Test:** `npm test`
- **Lint:** `npm run lint`
- **Check:** `npm run check`
- **Dev server:** `npm run dev` (port: 5173)
## Current State
Feature not yet started. Codebase is stable on master with 14 widget types, full app CRUD, healthcheck system, and notification infrastructure.
## Existing Patterns to Follow
- **Service pattern**: See `appService.ts`, `metricService.ts`, `systemStatsService.ts` for adapter/client/transform pattern
- **Caching**: `metricService.ts` has TTL-based cache — reuse for integration data
- **API envelope**: All routes use `success()`, `error()`, `paginated()` from response helpers
- **Zod validation**: All inputs validated via Zod schemas in `validators.ts`
- **Widget rendering**: `WidgetRenderer.svelte` dispatches to type-specific components
- **Config storage**: Widget configs stored as stringified JSON in `Widget.config`
- **Encrypted JSON**: `SystemSettings.oauthConfig` pattern for storing credentials
## Temporary Workarounds
(none yet)
## Cross-Phase Dependencies
- Phase 1 (architecture) must complete before all other phases
- Phase 2 (UI) must complete before Phase 10 (polish)
- Phases 3-9 (individual integrations) depend only on Phase 1
- Phase 10 depends on all prior phases
## Deferred Work
(none yet)
## Failed Approaches
(none yet)
## Review Findings Log
(none yet)
## Phase Execution Log
| Phase | Agent Used | Test Writer | Parallel | Notes |
|-------|-----------|-------------|----------|-------|
| (not started) | | | | |
## Environment & Runtime Notes
- Platform: Windows 10, Git Bash shell
- Database: SQLite via Prisma
- NUT integration requires raw TCP socket (Node `net` module)
- Deluge uses JSON-RPC, NPM uses session-based auth
## Implementation Notes
- Integration credentials stored encrypted in `integrationConfig` (JSON string on App model)
- NUT is the only non-HTTP integration — uses direct TCP protocol
- Alert banners (NUT on-battery, Authentik brute-force) need layout-level rendering, not just widget-level