@@ -234,6 +234,54 @@ dotnet run --project src/InsightLearn.Application
234234# Expected: App starts successfully
235235```
236236
237+ #### 🔐 Session Timeout & Auto-Logout (v2.1.0-dev)
238+
239+ ** Status** : ✅ Implemented 2025-11-26
240+ ** Purpose** : Auto-logout utenti inattivi dopo 30 minuti per sicurezza
241+
242+ ** Componenti Implementati** :
243+ 1 . ** [ SessionTimeoutService.cs] ( src/InsightLearn.WebAssembly/Services/Auth/SessionTimeoutService.cs ) ** - Service C# per monitoraggio inattività
244+ - Timer inattività con check ogni 30 secondi
245+ - Warning countdown 5 minuti prima della scadenza
246+ - Eventi: ` OnWarningShown ` , ` OnSessionExpired ` , ` OnCountdownTick `
247+ - Reset automatico su attività utente
248+
249+ 2 . ** [ sessionTimeout.js] ( src/InsightLearn.WebAssembly/wwwroot/js/sessionTimeout.js ) ** - JavaScript per tracking attività
250+ - Event listeners: mousemove, keydown, click, scroll, touchstart
251+ - Debounce 5 secondi per performance
252+ - Visibility change detection (tab switching)
253+ - JSInterop callback ` OnUserActivity `
254+
255+ 3 . ** [ SessionTimeoutWarning.razor] ( src/InsightLearn.WebAssembly/Components/SessionTimeoutWarning.razor ) ** - Componente UI warning
256+ - Modal overlay con countdown
257+ - Pulsante "Stay Logged In" per estendere sessione
258+ - Pulsante "Logout Now" per uscita immediata
259+ - Auto-redirect a ` /login?expired=true ` alla scadenza
260+
261+ ** Configurazione** (valori default):
262+ ``` csharp
263+ // In SessionTimeoutService.cs
264+ public int TimeoutMinutes { get ; set ; } = 30 ; // Timeout totale
265+ public int WarningMinutes { get ; set ; } = 5 ; // Warning prima della scadenza
266+ ```
267+
268+ ** Flusso** :
269+ 1 . Utente loggato → Service inizializza tracking
270+ 2 . 25 minuti inattività → Warning modal con countdown 5:00
271+ 3 . Utente attività → Warning chiuso, timer reset
272+ 4 . 30 minuti inattività → Auto-logout, redirect a ` /login?expired=true `
273+
274+ ** Registrazione** (Program.cs WebAssembly):
275+ ``` csharp
276+ builder .Services .AddScoped <SessionTimeoutService >();
277+ ```
278+
279+ ** Integrazione** (MainLayout.razor):
280+ ``` razor
281+ <!-- Session Timeout Warning - Auto logout after inactivity (v2.1.0-dev) -->
282+ <SessionTimeoutWarning />
283+ ```
284+
237285### 🔴 CRITOCO: Endpoint Configuration (Database-Driven Architecture)
238286
239287⚠️ ** TUTTI GLI ENDPOINT SONO MEMORIZZATI NEL DATABASE** ⚠️
@@ -3166,6 +3214,147 @@ Professional student learning interface matching LinkedIn Learning quality stand
31663214
31673215---
31683216
3169- ** Last Updated** : 2025-11-18
3170- ** Document Version** : 1.0
3171- ** Status** : ✅ Ready for Development Kickoff
3217+ # # 📊 Work Progress Status (v2.1.0-dev) - Updated 2025-11-26
3218+
3219+ # ## Overall Completion: **95%** ✅ Production Ready
3220+
3221+ | Area | Status | Completion |
3222+ | ------| --------| ------------|
3223+ | Admin Console (22 pages) | ✅ Complete | 100% |
3224+ | Session Timeout Feature | ✅ Complete | 100% |
3225+ | Student Learning Space | ✅ Complete | 100% |
3226+ | Video Player Component | ✅ Complete | 100% |
3227+ | Analytics Service | ✅ Complete | 100% |
3228+ | API Endpoints | ✅ Mostly Complete | 91% (42/46) |
3229+ | CSS/Styling | ✅ Complete | 100% |
3230+
3231+ ---
3232+
3233+ # ## 🔴 Pending Work Items - Task Decomposition
3234+
3235+ # ### ITEM #1: AI Chat Endpoints (SignalR Integration)
3236+ | Attribute | Value |
3237+ | -----------| -------|
3238+ | ** Assigned To** | 🔧 Backend Developer |
3239+ | ** Priority** | LOW (Phase 4) |
3240+ | ** Effort** | 8-10 hours |
3241+ | ** Complexity** | Complex |
3242+ | ** Status** | ⏳ Pending |
3243+
3244+ ** Sub-tasks:**
3245+ 1. ` POST /api/ai-chat/message` - Context-aware message with video timestamp
3246+ 2. ` GET /api/ai-chat/history` - Pagination support
3247+ 3. ` POST /api/ai-chat/sessions/{sessionId}/end` - Session cleanup
3248+ 4. ` GET /api/ai-chat/sessions` - List sessions per lesson
3249+
3250+ ** Files to modify:**
3251+ - ` src/InsightLearn.Application/Program.cs` (lines 4990-5061)
3252+ - ` src/InsightLearn.Application/Services/AIChatService.cs` (NEW)
3253+ - ` src/InsightLearn.Application/Hubs/ChatHub.cs` (NEW - SignalR)
3254+
3255+ ---
3256+
3257+ # ### ITEM #2: Reports Page - Data Generation
3258+ | Attribute | Value |
3259+ | -----------| -------|
3260+ | ** Assigned To** | 🔧 Fullstack Developer |
3261+ | ** Priority** | MEDIUM |
3262+ | ** Effort** | 4-6 hours |
3263+ | ** Complexity** | Medium |
3264+ | ** Status** | ⏳ Pending |
3265+
3266+ ** Sub-tasks:**
3267+ 1. Create ` ReportGenerationService.cs` backend service
3268+ 2. Implement PDF export (iTextSharp or QuestPDF)
3269+ 3. Implement Excel export (EPPlus or ClosedXML)
3270+ 4. Connect Reports.razor UI to backend endpoints
3271+
3272+ ** Files to modify:**
3273+ - ` src/InsightLearn.Application/Services/ReportGenerationService.cs` (NEW)
3274+ - ` src/InsightLearn.WebAssembly/Pages/Admin/Reports.razor`
3275+ - ` src/InsightLearn.Application/Program.cs` (add endpoints)
3276+
3277+ ---
3278+
3279+ # ### ITEM #3: VideoPlayer Progress Tracking Refactor
3280+ | Attribute | Value |
3281+ | -----------| -------|
3282+ | ** Assigned To** | 🎨 Frontend Developer |
3283+ | ** Priority** | LOW (Optional) |
3284+ | ** Effort** | 1 hour |
3285+ | ** Complexity** | Simple |
3286+ | ** Status** | ⏳ Pending |
3287+
3288+ ** Sub-tasks:**
3289+ 1. Move progress tracking logic to ` IVideoProgressClientService`
3290+ 2. Remove direct API calls from component
3291+
3292+ ** Files to modify:**
3293+ - ` src/InsightLearn.WebAssembly/Components/VideoPlayer.razor.cs` (line ~ 156)
3294+
3295+ ---
3296+
3297+ # ### ITEM #4: EnrollmentCard Toast Notification
3298+ | Attribute | Value |
3299+ | -----------| -------|
3300+ | ** Assigned To** | 🎨 Frontend Developer |
3301+ | ** Priority** | LOW |
3302+ | ** Effort** | 30 minutes |
3303+ | ** Complexity** | Simple |
3304+ | ** Status** | ⏳ Pending |
3305+
3306+ ** Sub-tasks:**
3307+ 1. Replace ` JS.InvokeVoidAsync(" alert" , ...)` with ` ToastService.ShowSuccess(...)`
3308+
3309+ ** Files to modify:**
3310+ - ` src/InsightLearn.WebAssembly/Components/EnrollmentCard.razor`
3311+
3312+ ---
3313+
3314+ # ## ✅ Recently Completed (2025-11-26)
3315+
3316+ | Feature | Expert | Status |
3317+ | ---------| --------| --------|
3318+ | Session Timeout Service | Backend Dev | ✅ Complete |
3319+ | Session Timeout JS Interop | Frontend Dev | ✅ Complete |
3320+ | Session Timeout Warning UI | UI/UX | ✅ Complete |
3321+ | MainLayout Integration | Frontend Dev | ✅ Complete |
3322+ | Admin Analytics Service | Backend Dev | ✅ Complete |
3323+ | IAdminAnalyticsService Interface | Backend Dev | ✅ Complete |
3324+ | WASM Docker Image Build | DevOps | ✅ Complete |
3325+ | K3s Deployment Rollout | DevOps | ✅ Complete |
3326+
3327+ ---
3328+
3329+ # ## 📋 Expert Assignment Matrix
3330+
3331+ | Expert Role | Pending Tasks | Total Effort |
3332+ | -------------| ---------------| --------------|
3333+ | 🔧 ** Backend Developer** | AI Chat Endpoints, Report Service | 12-16 hours |
3334+ | 🎨 ** Frontend Developer** | VideoPlayer refactor, EnrollmentCard fix | 1.5 hours |
3335+ | 🔧 ** Fullstack Developer** | Reports Page complete | 4-6 hours |
3336+ | 🚀 ** DevOps** | Git commit, CI/CD | 1 hour |
3337+
3338+ ---
3339+
3340+ # ## 🎯 Recommended Sprint Plan
3341+
3342+ ** Sprint 1 (Quick Wins - 2 hours)**
3343+ - [ ] # 4 EnrollmentCard Toast (30 min) - Frontend Dev
3344+ - [ ] # 3 VideoPlayer Refactor (1 hour) - Frontend Dev
3345+ - [ ] Git commit all changes - DevOps
3346+
3347+ ** Sprint 2 (Reports - 6 hours)**
3348+ - [ ] # 2 Reports Page Backend (4 hours) - Fullstack Dev
3349+ - [ ] # 2 Reports Page UI Connection (2 hours) - Fullstack Dev
3350+
3351+ ** Sprint 3 (AI Chat - 10 hours)** - Phase 4
3352+ - [ ] # 1 SignalR Hub Setup (2 hours) - Backend Dev
3353+ - [ ] # 1 AI Chat Service (4 hours) - Backend Dev
3354+ - [ ] # 1 AI Chat Endpoints (4 hours) - Backend Dev
3355+
3356+ ---
3357+
3358+ ** Last Updated** : 2025-11-26
3359+ ** Document Version** : 1.1
3360+ ** Status** : ✅ 95% Complete - Production Ready
0 commit comments