Arnaud Dartois e5e88ff83f chore: remove dead Heimdall.Contracts project
Project had zero source files, no project references, and no consumers.
It only added build overhead and Docker cache layer noise.
2026-07-17 19:25:32 +00:00
2026-07-16 20:49:23 +02:00
2026-07-16 20:49:23 +02:00

Heimdall — Plateforme de Surveillance Vidéo

Heimdall est une plateforme de surveillance vidéo multi-sites avec détection IA. Architecture .NET 10 Clean Architecture avec Blazor Server + PostgreSQL.

Architecture

Heimdall.Central (Api + Web + Workers)         Heimdall.Agent
┌──────────────────────────────┐               ┌──────────────┐
│  🌐 Blazor UI (MudBlazor)    │               │  📹 FFmpeg   │
│  🔌 REST API                 │ ←──HTTPS──→   │  🧠 IA locale│
│  ⏰ Hangfire Workers          │               │  💓 Heartbeat│
│  🗄️ PostgreSQL                │               └──────────────┘
└──────────────────────────────┘

Projets

Projet Rôle
Heimdall.Domain Entités, énums, value objects
Heimdall.Application Interfaces services, DTOs, validation
Heimdall.Infrastructure EF Core, Identity, JWT, API Key, Hangfire
Heimdall.Api REST API (controllers, middleware)
Heimdall.Web Blazor Server UI (MudBlazor)
Heimdall.Workers Hangfire background jobs (heartbeat monitor)
Heimdall.Agent Agent d'enregistrement et heartbeat

Démarrage rapide

1. Docker (production)

# Copier la configuration
cp .env.example .env
# Éditer les secrets (JWT__Key, mots de passe)
nano .env

# Lancer
docker compose -f docker/docker-compose.yml up -d

Accès :

2. Développement

Prérequis : .NET 10 SDK, PostgreSQL 17

# Lancer PostgreSQL
docker run -d --name pg -e POSTGRES_DB=heimdall -e POSTGRES_USER=heimdall \
  -e POSTGRES_PASSWORD=heimdall -p 5432:5432 postgres:17-alpine

# Lancer l'API
make dev-api

# Lancer le worker (dans un autre terminal)
make dev-worker

# Lancer le web UI (dans un autre terminal)
make dev-web

Commandes Make

make build       # Build .NET
make test        # Run tests
make docker-up   # docker compose up
make docker-down # docker compose down
make dev-api     # API en dev
make dev-web     # Web UI en dev

Authentification

Méthode Usage Endpoints
JWT Humains (Admin/Supervisor/Viewer) POST /api/auth/login
API Key Agents Authorization: Bearer <key>
2FA TOTP Sécurité renforcée POST /api/auth/2fa/verify

Comptes par défaut (dev) :

  • admin@heimdall.test / Admin123! — Admin

API — Endpoints principaux

Méthode Endpoint Auth Description
POST /api/auth/register - Créer un compte
POST /api/auth/login - Connexion
GET /api/sites JWT Lister les sites
POST /api/sites JWT Créer un site
POST /api/sites/{id}/tokens JWT Générer token agent
POST /api/agents/register - Enregistrer un agent
POST /api/agents/{id}/heartbeat API Key Heartbeat agent
GET /api/users JWT Lister utilisateurs
POST /api/users JWT Créer utilisateur
PUT /api/users/{id}/roles JWT Modifier rôles
POST /api/users/{id}/lock JWT Verrouiller compte
POST /api/users/{id}/reset-password JWT Reset mot de passe
GET /api/cameras/by-site/{siteId} JWT Caméras d'un site
POST /api/cameras JWT Ajouter une caméra
GET /api/stats JWT Statistiques globales
GET /api/audit-logs JWT Journal d'audit

Sécurité

  • JWT 15min access + refresh token
  • API Key HMACSHA256 + comparaison constant-time
  • Rate limiting : 10 req/min auth, 200 req/min API
  • CORS configurable
  • Journal d'audit : toutes les actions critiques sont loguées
  • ASP.NET Identity : lockout après 5 tentatives

Tests

# Tout exécuter
dotnet test

# Résultat attendu
34 tests — 0 failed, 0 skipped
Suite Tests Ce qui est testé
Domain 13 Entités (Site, Agent, Camera)
Integration 16 API (Auth, Sites, Users, Cameras, Agents)
Placeholder 5 Projets vides

Déploiement Docker

# docker-compose.yml minimal
services:
  heimdall-central:
    build:
      context: .
      dockerfile: docker/Dockerfile.central
    environment:
      DATABASE_URL: "Host=postgresql;Port=5432;Database=heimdall;Username=heimdall;Password=heimdall"
      JWT__Key: "<votre-clé-32-caractères-min>"
    ports:
      - "5000:8080"

Stack technique

Technologie Version
.NET 10.0
EF Core 10.0.8
Npgsql 10.0.3
PostgreSQL 17
Blazor Server 10.0
MudBlazor 9.1.0
Hangfire 1.8.17
xUnit -
Shouldly -
S
Description
Intelligent Local AI Video Surveillance Platform https://www.tordais.cc
Readme
32 MiB
0 Stars 0 Watchers 0 Forks
1.0.8
Latest
2026-11-14 13:00:15 +01:00
Languages
C# 81.3%
HTML 11.4%
Shell 3.4%
Python 1.6%
PowerShell 1%
Other 1.3%