metalfrom.eu/apps/api/migrations
Nicolas Fryder a7d7bc94de feat(admin): dashboard admin complet (auth forte, API, monitoring)
Nouveau service apps/admin (admin.metalfrom.eu / admin.dev.metalfrom.eu) :
- Frontend statique vanilla JS/CSS reprenant le design system du site
  (login, dashboard stats, table bands éditable, queue d'enrichissement,
  historique crawl_run, logs live, checkpoints, journal d'audit)
- nginx reverse-proxy /admin/api/* et /admin/auth/* vers le service api
  interne (same-origin côté navigateur, pas de CORS cross-site nécessaire
  pour le cookie de session)

apps/api :
- Nouvelle auth dédiée au dashboard, séparée du token BM_IMPORT_TOKEN
  existant : login bcrypt + session JWT en cookie httpOnly/secure/
  sameSite=strict, rate-limit + lockout après 5 échecs/15min, seeding
  du compte admin via env vars (jamais de mot de passe en clair en DB
  ou en git)
- Routes /admin/api/* : stats, queue (breakdown priorité identique au
  crawler Python), bands (recherche/tri/pagination/édition + audit log),
  crawl-runs, crawl-checkpoints, logs, audit-log
- trustProxy activé (Traefik + nginx en amont)

apps/crawler :
- log_event() écrit dans la nouvelle table crawl_log (run start/finish/
  erreurs) pour que le dashboard affiche les logs sans exposer le socket
  Docker (choix délibéré : pas de docker.sock monté, accès DB only)

migration 006_admin_dashboard.sql : admin_users, admin_login_attempts,
admin_audit_log, crawl_log

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-30 22:15:13 +02:00
..
001_initial_schema.sql feat(db): système de migrations SQL + refonte schéma 2026-06-27 15:09:35 +02:00
002_add_missing_columns.sql feat(db): système de migrations SQL + refonte schéma 2026-06-27 15:09:35 +02:00
003_geocode_tables.sql feat(db): système de migrations SQL + refonte schéma 2026-06-27 15:09:35 +02:00
004_crawl_tracking.sql feat(db): système de migrations SQL + refonte schéma 2026-06-27 15:09:35 +02:00
005_fix_checkpoints_and_data.sql fix(crawler): FlareSolverr persistent sessions + DB data field + scraper schema 2026-06-30 20:29:33 +02:00
006_admin_dashboard.sql feat(admin): dashboard admin complet (auth forte, API, monitoring) 2026-06-30 22:15:13 +02:00