Global Architecture
SecuFile — Global Architecture
Global Architecture
Global Architecture
Architecture Diagram
+-------------------------------------------------------------+
| CLIENTS |
+----------+-----------+-----------+-----------+---------------+
| Desktop | Mobile | Web UI | API | Share Links |
| (Future) | (Future) | (React) | (Direct) | (Public) |
+----+-----+-----+-----+-----+----+-----+-----+-------+-------+
| | | | |
+-----------+-----------+-----------+-------------+
|
+--------v--------+
| Nginx Ingress |
| (TLS / OVH K8s)|
+--------+--------+
|
+--------------+--------------+
| |
+--------v--------+ +--------v--------+
| WebGUI Frontend | | WebGUI Backend |
| (React 18) | | (Python FastAPI) |
| Port 80 (nginx) | | Port 8001 |
+--------+---------+ +--------+---------+
| |
+-----------------------------+
|
+--------v--------+
| Go API (Gin) |
| Port 8080 |
| REST API v1 |
+--------+--------+
|
+------------------+------------------+
| | |
+-------v-------+ +------v------+ +-------v-------+
| PostgreSQL | | S3 OVH | | Redis |
| (Metadata, | | (Encrypted | | (Rate limit, |
| users, | | files) | | sessions, |
| billing) | | | | cache) |
+---------------+ +------+------+ +---------------+
|
+--------v--------+
| OVH KMS |
| (RSA Keys) |
+-----------------+Main Components
1. Go API (filesecure) - System Core
The Go backend is the central component. It handles:
- JWT and MFA authentication
- File encryption/decryption (AES-256-GCM, RSA-4096)
- OVH S3 storage (upload, download, streaming)
- Organization, user, plan, and subscription management
- Stripe billing
- Share links and transfers
- Audit trail and compliance
- Prometheus metrics
Framework: Gin (Go HTTP framework) Port: 8080 Number of services: 30+ services injected at startup
2. WebGUI Backend (Python FastAPI)
The Python backend serves as an intermediate layer between the React frontend and the Go API. It handles:
- Request proxying to the Go API with authentication management
- Zitadel SSO (complete OIDC flow)
- Emails via Resend API (6 HTML templates)
- Admin dashboard (data aggregation)
- S3 collection scheduler (hourly statistics)
- OVH billing (billing API)
Framework: FastAPI Port: 8001 Database: Shared PostgreSQL with the Go backend
3. WebGUI Frontend (React 18)
The React frontend provides the complete user interface:
- 19 main pages + 5 admin pages + 8 public pages
- Client-side encryption via Web Crypto API
- File and folder management (drag & drop, batch operations)
- Superadmin dashboard with S3 metrics and billing
- Public share links with Loi 25 consent
- Secure transfers
- SSO and MFA
Framework: React 18 with React Router UI: shadcn/ui (Tailwind CSS) Build: ~530 kB (production)
4. Data Infrastructure
| Service | Role | Details |
|---|---|---|
| PostgreSQL | Primary relational database | 26 migrations, 45+ tables, shared Go/Python schemas |
| Redis | Cache and rate limiting | Distributed rate limiting via atomic Lua script, in-memory fallback |
| S3 OVH | Object storage | Dedicated buckets per organization, multi-region (BHS/GRA) |
| OVH KMS | Key management | Protection of organization RSA-4096 private keys |
| ClamAV | Antivirus | Optional scanning of uploaded files |