diff --git a/README.md b/README.md index 2d6c347..86c2240 100644 --- a/README.md +++ b/README.md @@ -59,12 +59,28 @@ Pour approfondir vos connaissances techniques sur le projet : ## Comment l'utiliser ? -### Installation locale +### Déploiement en Production -1. Clonez le dépôt. -2. Installez les dépendances avec `pnpm install`. -3. Configurez les variables d'environnement (voir `.env.example`). -4. Lancez les services via Docker ou manuellement. +Le projet est prêt pour la production via Docker Compose. + +1. **Prérequis** : Docker et Docker Compose installés. +2. **Variables d'environnement** : Copiez `.env.example` en `.env.prod` et ajustez les valeurs (clés secrètes, hosts, Sentry DSN, etc.). +3. **Lancement** : + ```bash + docker-compose -f docker-compose.prod.yml up -d + ``` +4. **Services inclus** : + - **Frontend** : Next.js en mode standalone optimisé. + - **Backend** : NestJS avec clustering et monitoring Sentry. + - **Caddy** : Gestion automatique du SSL/TLS. + - **ClamAV** : Scan antivirus en temps réel des médias. + - **Redis** : Cache, sessions et limitation de débit (Throttling/Bot detection). + - **MinIO** : Stockage compatible S3. + +### Sécurité et Performance +- **Transcodage Auto** : Toutes les images sont converties en WebP et les vidéos en WebM pour minimiser la bande passante. +- **Bot Detection** : Système intégré de détection et de bannissement automatique des crawlers malveillants via Redis. +- **Monitoring** : Tracking d'erreurs et profilage de performance via Sentry (Node.js et Next.js). ### Clés API diff --git a/backend/src/auth/dto/register.dto.ts b/backend/src/auth/dto/register.dto.ts index 435435c..80ea025 100644 --- a/backend/src/auth/dto/register.dto.ts +++ b/backend/src/auth/dto/register.dto.ts @@ -12,7 +12,8 @@ export class RegisterDto { @IsNotEmpty() @MaxLength(32) @Matches(/^[a-z0-9_]+$/, { - message: "username must contain only lowercase letters, numbers, and underscores", + message: + "username must contain only lowercase letters, numbers, and underscores", }) username!: string; diff --git a/frontend/src/app/(auth)/login/page.tsx b/frontend/src/app/(auth)/login/page.tsx index 2836bbc..7f2d7d6 100644 --- a/frontend/src/app/(auth)/login/page.tsx +++ b/frontend/src/app/(auth)/login/page.tsx @@ -108,7 +108,10 @@ export default function LoginPage() { {show2fa ? ( -
+ - )} @@ -133,7 +147,8 @@ export function TwoFactorSetup() { Configurer la 2FA - Scannez le QR Code ci-dessous avec votre application d'authentification (Google Authenticator, Authy, etc.). + Scannez le QR Code ci-dessous avec votre application d'authentification + (Google Authenticator, Authy, etc.). @@ -143,13 +158,17 @@ export function TwoFactorSetup() { )}
-

Ou entrez ce code manuellement :

+

+ Ou entrez ce code manuellement : +

{secret}
-

Entrez le code à 6 chiffres pour confirmer :

+

+ Entrez le code à 6 chiffres pour confirmer : +

@@ -166,9 +185,18 @@ export function TwoFactorSetup() {
- - + @@ -181,7 +209,8 @@ export function TwoFactorSetup() { Désactiver la 2FA - Veuillez entrer le code de votre application pour désactiver la double authentification. + Veuillez entrer le code de votre application pour désactiver la double + authentification. @@ -200,9 +229,19 @@ export function TwoFactorSetup() { - - + diff --git a/frontend/src/services/admin.service.ts b/frontend/src/services/admin.service.ts index d53dc3c..832535a 100644 --- a/frontend/src/services/admin.service.ts +++ b/frontend/src/services/admin.service.ts @@ -18,7 +18,10 @@ export const adminService = { return response.data; }, - updateReportStatus: async (reportId: string, status: ReportStatus): Promise => { + updateReportStatus: async ( + reportId: string, + status: ReportStatus, + ): Promise => { await api.patch(`/reports/${reportId}/status`, { status }); }, diff --git a/frontend/src/services/auth.service.ts b/frontend/src/services/auth.service.ts index 3d1a3e8..b4e8ec1 100644 --- a/frontend/src/services/auth.service.ts +++ b/frontend/src/services/auth.service.ts @@ -1,5 +1,9 @@ import api from "@/lib/api"; -import type { LoginResponse, RegisterPayload, TwoFactorSetupResponse } from "@/types/auth"; +import type { + LoginResponse, + RegisterPayload, + TwoFactorSetupResponse, +} from "@/types/auth"; export const AuthService = { async login(email: string, password: string): Promise { @@ -31,7 +35,9 @@ export const AuthService = { }, async setup2fa(): Promise { - const { data } = await api.post("/users/me/2fa/setup"); + const { data } = await api.post( + "/users/me/2fa/setup", + ); return data; },