How lilfanq/nguyen-luong-nhat-phuong_24ct1_cnpm_loki works
LOKI is a browser workspace for gaming peripherals. The main workflow runs through the React app: users sign in or use a guest session, choose a device and profile, configure settings or apply recommendations, and review setup diagnostics. Profiles and device workspace state are mainly browser-local; signed-in profile names and account roles use Supabase. The assistant can request replies from a Supabase Edge Function. Edges reflect sampled source references and README-documented behavior; unsampled implementation details are omitted rather than inferred.
Main entry points: App.jsx Workspace app · authService.js Auth service · profileService.js Profile persistence · mockData.js Catalog and sample data
Components 23
Workspace
- Workspace app
frontend/src/App.jsx
Devices
- Device catalog
frontend/src/features/devices/DeviceCatalogPanel.jsx - Device settings
frontend/src/features/devices/WorkspaceSettings.jsx - Settings defaults
frontend/src/features/devices/deviceSettings.js - Browser WebHID
Profiles and insights
- Profile panels
frontend/src/features/profiles/ProfilePanels.jsx - Profile persistence
frontend/src/profileService.js - Browser storage
- Recommendations
frontend/src/features/recommendations/RecommendationPanels.jsx - Setup diagnostics
frontend/src/features/insights/InsightPanels.jsx - Catalog and sample data
frontend/src/mockData.js - Assistant service
frontend/src/features/assistant/assistantService.js
Identity and administration
- Sign-in form
frontend/src/features/auth/AuthFormPanel.jsx - Signed-in session
frontend/src/features/auth/AuthenticatedSessionPanel.jsx - Guest session
frontend/src/features/auth/GuestSessionPanel.jsx - Auth service
frontend/src/features/auth/authService.js - Account administration
frontend/src/features/admin/AdminDashboard.jsx - Role policies
backend/supabase/admin_roles.sql
Backend services
- Supabase client
frontend/src/supabaseClient.js - Supabase platform
- Profile migration
backend/supabase/migrations/202610090001_user_profiles.sql - LOKI chat function
backend/supabase/functions/loki-chat/index.ts
Other components
- Workspace user
Connections 30
- Workspace user → Workspace app: uses
README.md - Workspace app → Sign-in form: renders
frontend/src/App.jsx - Workspace app → Signed-in session: renders
frontend/src/App.jsx - Workspace app → Guest session: renders
frontend/src/App.jsx - Workspace app → Device catalog: renders
frontend/src/App.jsx - Workspace app → Device settings: renders
frontend/src/App.jsx - Workspace app → Account administration: renders
frontend/src/App.jsx - Workspace app → Profile panels: renders
frontend/src/App.jsx - Workspace app → Recommendations: renders
frontend/src/App.jsx - Workspace app → Setup diagnostics: renders
frontend/src/App.jsx - Workspace app → Assistant service: requests replies
frontend/src/features/assistant/assistantService.js - Workspace app → Profile persistence: loads and saves
frontend/src/App.jsx - Device settings → Settings defaults: uses defaults
frontend/src/features/devices/WorkspaceSettings.jsx - Workspace app → Browser WebHID: accesses devices
README.md - Sign-in form → Auth service: submits auth
- Workspace app → Auth service: checks roles
frontend/src/App.jsx - Auth service → Supabase client: uses client
frontend/src/features/auth/authService.js - Account administration → Auth service: manages roles
frontend/src/features/admin/AdminDashboard.jsx - Auth service → Supabase platform: queries accounts
frontend/src/features/auth/authService.js - Role policies → Supabase platform: defines protections
README.md - Profile panels → Workspace app: reports profile actions
frontend/src/App.jsx - Profile persistence → Browser storage: reads and writes
frontend/src/profileService.js - Workspace app → Supabase client: loads client
frontend/src/App.jsx - Profile persistence → Supabase platform: syncs names
README.md - Profile migration → Supabase platform: creates profile table
README.md - Recommendations → Catalog and sample data: reads recommendations
frontend/src/features/recommendations/RecommendationPanels.jsx - Setup diagnostics → Catalog and sample data: reads diagnostics
frontend/src/features/insights/InsightPanels.jsx - Workspace app → Catalog and sample data: uses recommendations
frontend/src/App.jsx - Assistant service → Supabase platform: invokes function
frontend/src/features/assistant/assistantService.js - Supabase platform → LOKI chat function: dispatches chat