feat(v0.9.0): dashboard enrichi — BackupRun, stats API, KPIs, charts, i18n input#10
Merged
Conversation
…tecture Backend: - Add IInputProvider + IOutputProvider interfaces with ProviderMeta, FileToArchive, ArchiveResult and OutputRow shared types in src/providers/ - Implement InputProviderRegistry and OutputProviderRegistry (self-registering pattern via OnModuleInit) - Extract HTTP-REST fetch logic from BackupRunner into HttpRestInputProvider - Extract mail send logic from BackupRunner into MailOutputProvider - Add ProvidersModule with GET /api/providers endpoint exposing registered providers - BackupRunner delegates to registries — adding a new provider only requires implementing the interface and registering in ProvidersModule Frontend: - Add frontend provider registry (input-registry.ts, output-registry.ts) - Register http-rest and mail built-in providers in providers/index.ts - Convert /input/http-rest/* static routes to /input/[type]/* dynamic routes that resolve components via the registry at runtime - Input selector page (/input) is now fully data-driven from the registry - providersService.list() added for GET /api/providers
… codes Introduce OrbixException base class and domain-specific subclasses (input, archive, output, vault, url-source). LogsWriter gains an exception() helper that embeds the class name in the detail field for easy tracing. Runner and providers now throw typed exceptions instead of raw Error objects; catch blocks use logs.exception() for typed paths and fall back to logs.error() for unexpected errors.
Add VaultDecryptionFailedException for corrupted vault payloads. Update input.service test(), mail.service send(), vault.service testEmail(), backup.scheduler cron catch, and vault.scheduler cron catch to use OrbixException subclasses and logs.exception() consistently across the entire backend. input.service test() now returns errorCode for typed errors.
UX / Frontend - Replace loading text with shadcn Skeleton components across all list and detail pages - Add empty state cards (vault variable-set, contacts, templates) - Fix loading state on settings page (ZIP info secondary loader) - Add skeleton.tsx component with SkeletonListItems and SkeletonForm helpers Backend robustness - HTTP input: add 30s AbortController timeout on all fetch paths - Archiver: destroy on error to release file handles - Backup runner: path traversal guard on file/folder sources Security - RateLimitGuard: in-memory sliding window (20 req/min/IP) on auth endpoints - Global JwtAuthGuard via APP_GUARD — all routes protected by default Tests - input.service.spec: add CRUD + test() coverage (mock fetchWithConfig) - create-input.dto.spec: 9 validation tests - create-backup.dto.spec: 12 validation tests (fix reflect-metadata import) Documentation - README.md: product facade with pipeline diagram, quick start, config table - docs/architecture.md: system overview, module map, execution flow - docs/modules.md: all modules with endpoints and field references - docs/providers.md: provider pattern guide with SFTP and webhook examples - docs/data-model.md: full Prisma schema reference Docker - docker-compose.prod.yml: healthcheck on the orbix service - .env.example: documented comments for all variables
Formatting and style corrections applied by ESLint --fix on all modified files. No logic changes.
Sortie des champs smtpStatus* de VaultEntity vers une table VaultHealthCheck dédiée (relation 1-1), migration Prisma, service et types backend mis à jour, UI frontend adaptée (badge de statut, page email vault).
Composant <BackupPipeline /> avec renderer registry extensible : sources groupées (file/folder), flèche fan-out SVG animée, panneau de détail par nœud. Détails email enrichis (destinataires, compte SMTP, template, overrides). Intégré dans la liste des backups et StepValidate.
Recurring : plusieurs règles (jours + heure) par backup, ordre jours Lun→Sam→Dim. Le scheduler enregistre un CronJob par règle. Interval : date de début (obligatoire, passée ou future) et date de fin optionnelle ; le scheduler diffère ou arrête le job selon ces dates. Migration de données transparente (ancien format scheduleConfig préservé).
…format Remove stale smtpStatus* fields from VaultEntity, add VaultHealthCheck section (1-1 relation, agnostic health check). Document scheduleConfig shapes per scheduleType including new multi-rule recurring format.
- Prisma: add BackupRun model with indexes + relation on Backup - BackupRunner: create run at start, update on success/error (size, filesCount, duration) - BackupScheduler: pass triggerType scheduler/manual; purge cron every hour using backupRetentionDays - StatsModule: GET /api/stats?period=7d|30d|365d with counts, recentRuns, lastRuns, nextScheduled, logsByLevel, errorsByDay - Frontend: stats service + new dashboard with 6 KPI cards, 6 charts and last-runs table
- BackupRunner.run() accepts triggerType ('manual'|'scheduler'|'api'), creates BackupRun on start, updates on success/error
- BackupScheduler: purgeOldRuns() cron hourly, deletes BackupRun older than backupRetentionDays
- StatsService: periodStats (totalRuns, successRate, avgSizeBytes, avgDurationMs), UTC-safe date bucketing in fillRunDays/fillLogDays, finishedAt included in recentRunsRaw for duration calc
- VaultService: minor formatting
- KPI cards: icon left + title/value right layout, 2-row grid (3 cols), compact padding - Exécutions par jour: monthly grouping for 365d period, fixed height h-[200px] - Resultats globaux: remove self-start, flex-col fill, larger donut (180px), legend - Taille/Duree charts: custom MetricTooltip (no concatenation), top margin for Y-axis - Vault page: equal card heights via flex flex-1 - shadcn chart component added
…hboard formatters - stats.service.spec.ts: counts, periodStats (rate/size/duration), UTC bucketing, lastRuns mapping (20 tests) - backup.scheduler.spec.ts: purgeOldRuns cutoff date, retentionDays from settings, log on purge (4 tests) - backup.runner.spec.ts: triggerType variants, BackupRun not created when backup missing (4 new tests) - dashboard.utils.ts: extract formatSize/formatDuration/formatDay/formatMonth/groupByMonth from page.tsx - dashboard.utils.test.ts: formatters + groupByMonth UTC safety (19 tests) - docs/data-model.md: add BackupRun table with columns, indexes, purge cron note
# Conflicts: # backend/src/modules/backup/backup.scheduler.ts # backend/src/modules/vault/vault.service.ts # docs/data-model.md
providers/index.ts now stores i18n keys (input.type.httpRest, input.typeDesc.httpRest) instead of hardcoded English strings. input/page.tsx renders them with t() so the selector card respects the active locale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
GET /api/stats) : KPIs, période configurable (7j/30j/365j), runs récents par jour, derniers runst()au lieu d'être hardcodésTest plan
BackupRuns'insèrent en basepnpm run test+pnpm run lint+pnpm exec tsc --noEmit→ 0 erreurs