How kohs2k21/2026-2-cecd2-1-powercode-03 works
Powercode is an ESB/log anomaly-monitoring project with a dashboard, backend integration, and a PostgreSQL worker runtime boundary. The documented dashboard workflow is users signing in, viewing home or analysis, and inspecting anomaly evidence; the backend exposes authentication, user, and anomaly APIs, while the worker files show observation persistence and queue mechanics. The README identifies the frontend, backend, and worker but does not document their runtime wiring. Unsampled dashboard and worker subsystems are represented only where the tree or README supports their role; uncertain cross-process links are omitted.
Main entry points: App.tsx Dashboard Shell · auth.ts Token Authorization · userRepository.ts User Repository · pg_queue.py Postgres Queue
Components 24
Dashboard
- Dashboard Shell
server/frontend/src/app/App.tsx - Anomaly Analysis
server/frontend/src/features/analysis - Home Dashboard
server/frontend/src/features/home - Admin Views
server/frontend/src/features/admin_model/AdminModelPlaceholder.tsx - Settings Views
server/frontend/src/features/settings - Browser Storage
server/frontend/src/lib/storage.ts - API Client
server/frontend/src/services/api/client.ts
Backend API
- Backend Service
server/backend/src/index.ts - Auth Routes
server/backend/src/routes/authRoutes.ts - Authentication
server/backend/src/controllers/authController.ts - Token Authorization
server/backend/src/middleware/auth.ts - User Routes
server/backend/src/routes/userRoutes.ts - User Management
server/backend/src/controllers/userController.ts - User Repository
server/backend/src/repository/userRepository.ts - Anomaly Routes
server/backend/src/routes/anomalyRoutes.ts - Anomaly Ingest
server/backend/src/controllers/anomalyController.ts - Risk Scoring
server/backend/src/services/anomalyService.ts
Worker Runtime
- Observation Storage
server/worker/collector/storage.py - Postgres Queue
server/worker/pg_queue.py - Queue Input Reader
server/worker/detector/input_reader.py - Training Lease
server/worker/trainer/lease.py
Automation
- Sync Automation
automation/services/sync/app.py - Webhook Automation
automation/webhook/src/index.ts
Other components
- Operator
Connections 21
- Operator → Dashboard Shell: uses
server/frontend/src/app/App.tsx - Dashboard Shell → Anomaly Analysis: opens view
server/frontend/src/app/App.tsx - Dashboard Shell → Home Dashboard: opens view
server/frontend/src/app/App.tsx - Dashboard Shell → Admin Views: opens view
server/frontend/src/app/App.tsx - Dashboard Shell → Settings Views: opens view
server/frontend/src/app/App.tsx - Dashboard Shell → API Client: requests user
server/frontend/src/app/App.tsx - Dashboard Shell → Browser Storage: stores session
server/frontend/src/app/App.tsx - Dashboard Shell → Anomaly Analysis: renders
server/frontend/src/app/App.tsx - Auth Routes → Authentication: routes to
server/backend/src/routes/authRoutes.ts - User Routes → User Management: routes to
server/backend/src/routes/userRoutes.ts - Anomaly Routes → Anomaly Ingest: routes to
server/backend/src/routes/anomalyRoutes.ts - Auth Routes → Token Authorization: guards
server/backend/src/routes/authRoutes.ts - User Routes → Token Authorization: guards
server/backend/src/routes/userRoutes.ts - Anomaly Routes → Token Authorization: guards
server/backend/src/routes/anomalyRoutes.ts - Authentication → User Repository: reads users
server/backend/src/controllers/authController.ts - User Management → User Repository: manages users
server/backend/src/controllers/userController.ts - Token Authorization → User Repository: checks user
server/backend/src/middleware/auth.ts - Anomaly Ingest → Risk Scoring: scores logs
server/backend/src/controllers/anomalyController.ts - Observation Storage → Postgres Queue: enqueues detection
server/worker/collector/storage.py - Queue Input Reader → Postgres Queue: claims messages
server/worker/detector/input_reader.py - Training Lease → Postgres Queue: leases jobs
server/worker/trainer/lease.py