From 8dcb27d81e5cccbd75ed4c26cf4a9eff3567ef97 Mon Sep 17 00:00:00 2001 From: Arthur Lempereur Date: Thu, 23 Oct 2025 18:02:21 +0200 Subject: [PATCH] docs: Complete wiki documentation migration --- API-Reference.md | 421 ++++++++++++++++++++++++++++++++++++++ Changelog.md | 132 ++++++++++++ Configuration-Firebase.md | 158 ++++++++++++++ Dépannage.md | 259 +++++++++++++++++++++++ Déploiement.md | 341 ++++++++++++++++++++++++++++++ Développement.md | 381 ++++++++++++++++++++++++++++++++++ Home.md | 92 ++++++++- Installation.md | 187 +++++++++++++++++ Quick-Start.md | 162 +++++++++++++++ Tests.md | 243 ++++++++++++++++++++++ 10 files changed, 2375 insertions(+), 1 deletion(-) create mode 100644 API-Reference.md create mode 100644 Changelog.md create mode 100644 Configuration-Firebase.md create mode 100644 Dépannage.md create mode 100644 Déploiement.md create mode 100644 Développement.md create mode 100644 Installation.md create mode 100644 Quick-Start.md create mode 100644 Tests.md diff --git a/API-Reference.md b/API-Reference.md new file mode 100644 index 0000000..ffee22f --- /dev/null +++ b/API-Reference.md @@ -0,0 +1,421 @@ +# 📚 API Reference + +Documentation des services, hooks et composants de WalletTracker. + +## Services Firebase + +### authService + +Service de gestion de l'authentification. + +#### `signup(email, password, displayName)` +Crée un nouveau compte utilisateur. + +```typescript +import { authService } from '../services/authService'; + +await authService.signup( + 'user@example.com', + 'password123', + 'John Doe' +); +``` + +#### `login(email, password)` +Connecte un utilisateur existant. + +```typescript +await authService.login('user@example.com', 'password123'); +``` + +#### `logout()` +Déconnecte l'utilisateur actuel. + +```typescript +await authService.logout(); +``` + +--- + +### transactionService + +Service de gestion des transactions. + +#### `addTransaction(userId, type, amount, category, date, note)` +Ajoute une nouvelle transaction. + +```typescript +import { transactionService } from '../services/transactionService'; + +await transactionService.addTransaction( + userId, + 'expense', // 'expense' ou 'income' + 50.00, // montant + 'Alimentation', // catégorie + new Date(), // date + 'Courses du mois' // note (optionnel) +); +``` + +#### `subscribeToTransactions(userId, callback)` +Écoute les changements de transactions en temps réel. + +```typescript +const unsubscribe = transactionService.subscribeToTransactions( + userId, + (transactions) => { + console.log('Transactions mises à jour:', transactions); + } +); + +// N'oubliez pas de se désabonner +return () => unsubscribe(); +``` + +#### `getTransactionsByMonth(userId, year, month)` +Récupère les transactions d'un mois spécifique. + +```typescript +const transactions = await transactionService.getTransactionsByMonth( + userId, + 2025, + 10 // Octobre +); +``` + +--- + +### subscriptionService + +Service de gestion des abonnements. + +#### `addSubscription(userId, name, amount, category, frequency, nextPaymentDate, reminderDays)` +Ajoute un nouvel abonnement. + +```typescript +import { subscriptionService } from '../services/subscriptionService'; + +await subscriptionService.addSubscription( + userId, + 'Netflix', + 15.99, + 'Divertissement', + 'monthly', // 'daily', 'weekly', 'monthly', 'yearly' + new Date('2025-11-01'), + 3 // rappel 3 jours avant +); +``` + +#### `subscribeToSubscriptions(userId, callback)` +Écoute les changements d'abonnements en temps réel. + +```typescript +const unsubscribe = subscriptionService.subscribeToSubscriptions( + userId, + (subscriptions) => { + console.log('Abonnements mis à jour:', subscriptions); + } +); +``` + +--- + +### categoryService + +Service de gestion des catégories. + +#### `getCategories(userId)` +Récupère les catégories de l'utilisateur. + +```typescript +import { categoryService } from '../services/categoryService'; + +const categories = await categoryService.getCategories(userId); +``` + +#### `initializeDefaultCategories(userId)` +Initialise les catégories par défaut. + +```typescript +await categoryService.initializeDefaultCategories(userId); +``` + +Les catégories par défaut incluent : +- **Dépenses** : Alimentation, Transport, Logement, Santé, Loisirs, Shopping, Éducation, Autres +- **Revenus** : Salaire, Freelance, Investissements, Cadeaux, Autres + +--- + +## Hooks personnalisés + +### useAuth + +Hook pour gérer l'authentification. + +```typescript +import { useAuth } from '../hooks/useAuth'; + +function MyComponent() { + const { user, initializing, logout } = useAuth(); + + if (initializing) { + return ; + } + + if (!user) { + return ; + } + + return ( + + Bienvenue {user.displayName} +