From c03f66cbbf0acb12a2979372aefcfb50f352b8ac Mon Sep 17 00:00:00 2001 From: Luca Sacchi Ricciardi Date: Wed, 8 Apr 2026 00:29:12 +0200 Subject: [PATCH] docs: add frontend missing features analysis - forgot password and user profile management --- todo.md | 178 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 178 insertions(+) diff --git a/todo.md b/todo.md index 079d7e8..0b44603 100644 --- a/todo.md +++ b/todo.md @@ -368,6 +368,184 @@ Prossimi passi operativi: --- +## 🚨 ATTIVITÀ MANCANTI - Analisi Frontend v1.0.0 + +### 🔍 Analisi Completa Funzionalità Mancanti + +#### 1. 🔐 Authentication - Forgot Password (CRITICO) +**Stato:** Backend API pronte ✅ | Frontend: Non implementato ❌ + +**Descrizione:** +Il sistema ha già le API backend complete per il reset password: +- `POST /api/v1/auth/reset-password-request` - Richiesta reset +- `POST /api/v1/auth/reset-password` - Conferma con token +- Email service pronto per inviare link di reset + +**Manca nel Frontend:** +- [ ] **Pagina ForgotPassword.tsx** - Form inserimento email +- [ ] **Pagina ResetPassword.tsx** - Form inserimento nuova password con token +- [ ] **Route in App.tsx** - `/forgot-password` e `/reset-password` +- [ ] **Link funzionante in Login.tsx** - Sostituire l'alert "Coming soon" +- [ ] **Hook useForgotPassword.ts** - Gestione chiamate API +- [ ] **Validazione form** - Email valida, password strength +- [ ] **Messaggi successo/errore** - Toast notifications + +**Priorità:** 🔴 Alta - Bloccante per UX + +--- + +#### 2. 👤 User Profile Management (MEDIO) +**Stato:** Non implementato ❌ + +**Descrizione:** +Gli utenti non possono gestire il proprio profilo. Attualmente dopo il login non c'è modo di: +- Vedere i propri dati +- Cambiare password +- Aggiornare informazioni profilo +- Vedere storico attività + +**Manca nel Frontend:** +- [ ] **Pagina Profile.tsx** - Vista profilo utente +- [ ] **Pagina Settings.tsx** - Impostazioni generali (non solo API keys) +- [ ] **Sottopagine Settings:** + - [ ] `/settings/profile` - Dati personali + - [ ] `/settings/password` - Cambio password + - [ ] `/settings/notifications` - Preferenze notifiche + - [ ] `/settings/account` - Gestione account (delete, export) +- [ ] **Route in App.tsx** - Route protette per settings +- [ ] **Menu utente in Header** - Dropdown con "Profile", "Settings", "Logout" +- [ ] **Hook useProfile.ts** - Gestione dati utente +- [ ] **Form validazione** - Nome, email, avatar, ecc. + +**API Backend Necessarie:** +- [ ] `GET /api/v1/auth/me` - Get current user ✅ (già esiste) +- [ ] `PUT /api/v1/auth/me` - Update profile (da verificare) +- [ ] `POST /api/v1/auth/change-password` - Change password ✅ (già esiste) +- [ ] `DELETE /api/v1/auth/me` - Delete account (da implementare) + +**Priorità:** 🟡 Media - Miglioramento UX importante + +--- + +#### 3. 📧 Email Templates & Notifications (BASSO) +**Stato:** Backend pronto ✅ | Frontend: Non visibile ❌ + +**Descrizione:** +Il sistema può inviare email ma l'utente non ha visibilità sullo stato. + +**Manca:** +- [ ] **Pagina Notifications.tsx** - Centro notifiche +- [ ] **Badge notifiche** - Icona con contatore in header +- [ ] **Toast real-time** - Notifiche WebSocket/SSE +- [ ] **Impostazioni notifiche** - Tipologie e frequenze + +**Priorità:** 🟢 Bassa - Nice to have + +--- + +### 📋 Piano di Implementazione + +#### Fase 1: Forgot Password (Priorità Alta) +**Task Frontend:** +1. [ ] Creare `ForgotPassword.tsx` con: + - Form email con validazione + - Chiamata a `/reset-password-request` + - Messaggio successo (non rivelare se email esiste) + - Link "Torna al login" + +2. [ ] Creare `ResetPassword.tsx` con: + - Lettura token da URL query param + - Form nuova password + conferma + - Validazione password strength + - Chiamata a `/reset-password` + - Redirect a login dopo successo + +3. [ ] Aggiornare `App.tsx`: + - Aggiungere route `/forgot-password` + - Aggiungere route `/reset-password` + +4. [ ] Aggiornare `Login.tsx`: + - Sostituire alert con Link a `/forgot-password` + +5. [ ] Creare hook `useAuth.tsx`: + - Aggiungere `requestPasswordReset(email)` + - Aggiungere `resetPassword(token, newPassword)` + +**Task Backend (se necessario):** +- Verificare che le API siano testate e funzionanti ✅ + +**Stima:** 1-2 giorni + +--- + +#### Fase 2: User Profile (Priorità Media) +**Task Frontend:** +1. [ ] Creare `Profile.tsx`: + - Card informazioni utente + - Avatar placeholder + - Dati: nome, email, data registrazione, ultimo login + - Bottone "Edit Profile" + - Bottone "Change Password" + +2. [ ] Creare `SettingsLayout.tsx`: + - Sidebar con navigazione settings + - Items: Profile, Password, Notifications, API Keys, Account + +3. [ ] Creare `SettingsProfile.tsx`: + - Form editabile nome, email + - Upload avatar (futuro) + - Bottone "Save Changes" + +4. [ ] Creare `SettingsPassword.tsx`: + - Form: current password, new password, confirm + - Validazione strength + - Bottone "Update Password" + +5. [ ] Aggiornare `App.tsx`: + - Route `/settings` → redirect a `/settings/profile` + - Route `/settings/profile` → SettingsProfile + - Route `/settings/password` → SettingsPassword + - Route esistente `/settings/api-keys` → ApiKeys + +6. [ ] Aggiornare `Header.tsx`: + - Aggiungere dropdown menu utente + - Items: "Profile", "Settings", "API Keys", "Dark Mode", "Logout" + - Icona utente con avatar/placeholder + +7. [ ] Creare/aggiornare hook `useProfile.ts`: + - `getProfile()` - GET /auth/me + - `updateProfile(data)` - PUT /auth/me + - `changePassword(data)` - POST /auth/change-password + +**Task Backend (se necessario):** +- Verificare `PUT /api/v1/auth/me` esista o crearla +- Verificare `DELETE /api/v1/auth/me` per cancellazione account + +**Stima:** 3-4 giorni + +--- + +### ✅ Checklist Implementazione + +- [ ] **Fase 1: Forgot Password** + - [ ] ForgotPassword.tsx + - [ ] ResetPassword.tsx + - [ ] Route in App.tsx + - [ ] Hook useAuth aggiornato + - [ ] Test end-to-end + +- [ ] **Fase 2: User Profile** + - [ ] Profile.tsx + - [ ] SettingsLayout.tsx + - [ ] SettingsProfile.tsx + - [ ] SettingsPassword.tsx + - [ ] Header dropdown menu + - [ ] Routes protette + - [ ] Hook useProfile + - [ ] Test funzionalità + +--- + ## 💡 MIGLIORAMENTI FUTURI (Backlog) ### Performance