SecuFile
Stack technique détaillée
Technologies et frameworks utilisés
Stack technique detaillee
Book: SecuFile — Stockage sécurisé de fichiers | Chapter: Architecture
Stack technique detaillee
Backend Go (filesecure)
Langage et frameworks
| Technologie | Version | Usage |
|---|---|---|
| Go | 1.25 | Langage principal |
| Gin | v1.10+ | Framework HTTP/REST |
| pgx/v5 | v5.7+ | Driver PostgreSQL (connection pool) |
| go-redis/v9 | v9.7+ | Client Redis |
| aws-sdk-go-v2 | latest | Client S3 OVH |
| golang-migrate | v4 | Migrations de base de donnees |
| prometheus | latest | Metriques |
| golang.org/x/crypto | v0.48.0 | Cryptographie (HKDF, OAEP) |
| stripe-go | v82 | Integration Stripe |
Structure du projet Go
filesecure/backend/
+-- cmd/
| +-- api/main.go # Point d'entree principal
| +-- cleanup-s3/main.go # Outil de nettoyage S3
| +-- init-keys/main.go # Initialisation cles RSA
+-- internal/
| +-- config/config.go # Configuration (env vars)
| +-- database/ # Connexion et migrations PostgreSQL
| +-- handlers/ # 47 fichiers de handlers HTTP
| | +-- auth.go # Authentification (login, register, MFA, SSO)
| | +-- file.go # Operations fichiers
| | +-- folder.go # Gestion dossiers
| | +-- sharelink.go # Liens de partage
| | +-- organization.go # Organisations multi-tenant
| | +-- subscription.go # Abonnements SaaS
| | +-- stripe_webhook.go # Webhooks Stripe
| | +-- ...
| +-- middleware/ # Middlewares HTTP
| | +-- auth.go # JWT authentication
| | +-- csrf.go # CSRF protection (Content-Type)
| | +-- rate_limit.go # Rate limiting (Redis + in-memory)
| | +-- logging.go # Request logging (slog)
| | +-- metrics.go # Prometheus HTTP metrics
| | +-- body_limit.go # Body size limit (1MB/25MB)
| +-- models/models.go # Modeles de donnees
| +-- services/ # 64 fichiers de services
| +-- auth.go # Logique d'authentification
| +-- file.go # Logique fichiers
| +-- file_client_encryption.go # Chiffrement cote client
| +-- rsa_keys.go # Gestion cles RSA + KMS
| +-- organization.go # Logique multi-tenant
| +-- stripe_integration.go # Integration Stripe
| +-- ...
+-- pkg/
| +-- crypto/crypto.go # AES-256-GCM, KMS wrapping
| +-- kms/ # KMS provider abstraction
| +-- logging/logging.go # Setup slog (JSON/text)
| +-- metrics/metrics.go # Definitions Prometheus
| +-- ovh/ # Client OVH (storage provisioning)
| +-- secretsloader/ # Chargement secrets
| +-- storage/s3.go # Client S3 (upload, download, streaming)
+-- migrations/ # 26 migrations SQL (up/down)
+-- Dockerfile # Build multi-stage GoWebGUI Backend (Python)
Langage et frameworks
| Technologie | Version | Usage |
|---|---|---|
| Python | 3.11+ | Langage |
| FastAPI | 0.100+ | Framework API async |
| asyncpg | latest | Driver PostgreSQL async |
| httpx | latest | Client HTTP async |
| ovh | 1.2.0 | Client API OVH (billing) |
| resend | latest | API d'envoi d'emails |
Structure du projet Python
filesecure-webgui/backend/
+-- server.py # Point d'entree FastAPI
+-- config.py # Configuration
+-- db_postgres.py # Connexion PostgreSQL
+-- email_service.py # 6 templates email HTML
+-- models.py # Modeles Pydantic
+-- routes/ # 26 modules de routes
| +-- auth.py # Authentification proxy
| +-- share.py # Share links proxy
| +-- transfers.py # Transferts
| +-- admin_dashboard.py # Dashboard superadmin
| +-- sso.py # SSO Zitadel (OIDC)
| +-- audit.py # Audit logs
| +-- ...
+-- services/
| +-- ovh_billing.py # Facturation OVH S3
+-- utils/
| +-- audit.py # Logger d'audit
| +-- scheduler.py # Collecte S3 periodique
+-- migrations/ # Migrations WebGUIFrontend React
Langage et frameworks
| Technologie | Version | Usage |
|---|---|---|
| React | 18 | Framework UI |
| React Router | v6 | Routing |
| Tailwind CSS | 3 | Styling |
| shadcn/ui | latest | Composants UI |
| Recharts | latest | Graphiques |
| Axios | latest | Client HTTP |
| TinyMCE | latest | Editeur de texte enrichi |
| Stripe.js | latest | Elements de paiement |
Structure du projet React
filesecure-webgui/frontend/src/
+-- App.js # Routes principales
+-- contexts/
| +-- AuthContext.jsx # Authentification (JWT)
| +-- EncryptionContext.jsx # Chiffrement cote client
| +-- LanguageContext.jsx # Internationalisation
| +-- StripeContext.jsx # Integration Stripe Elements
+-- pages/
| +-- DashboardPage.jsx # Dashboard (share links, metriques)
| +-- FilesPage.jsx # Gestionnaire de fichiers
| +-- ShareLinkPage.jsx # Page publique share link
| +-- TransferPage.jsx # Page publique transfert
| +-- UsersPage.jsx # Gestion utilisateurs
| +-- SubscriptionPage.jsx # Gestion abonnement
| +-- AuditLogsPage.jsx # Logs d'audit
| +-- admin/ # Pages d'administration
| +-- public/ # Pages marketing publiques
+-- components/
| +-- StorageDashboard.jsx # Dashboard S3 superadmin
| +-- CreateTransferDialog.jsx # Dialog creation transfert
| +-- EncryptedUploadDialog.jsx # Upload chiffre
| +-- Sidebar.jsx # Navigation laterale
| +-- ...