foxy-dev-team/docs/walkthrough.md

5.4 KiB

🦊 Foxy Dev Team v2.0 — Refonte complète

Résumé

Refonte complète du système Foxy Dev Team : remplacement du daemon foxy-autopilot.py et de la gestion d'état fichier par une architecture moderne FastAPI + React + SQLite.


Architecture livrée

graph LR
    subgraph Frontend
        A[React + TypeScript + TailwindCSS]
    end
    subgraph Backend
        B[FastAPI + SQLAlchemy]
        C[(SQLite)]
        D[WebSocket Hub]
    end
    subgraph External
        E[Telegram Bot v3]
        F[OpenClaw CLI]
    end
    A -- REST API --> B
    A -- WebSocket --> D
    B --> C
    E -- REST API --> B
    B --> F

Fichiers créés

Backend (backend/app/)

Fichier Rôle
config.py Pydantic-settings, .env loader
database.py Async SQLAlchemy engine + session
models.py 4 tables ORM (Project, Task, AgentExecution, AuditLog)
schemas.py Pydantic request/response schemas
workflows.py Moteur de workflows dynamique (4 types)
notifications.py Service Telegram async (httpx)
openclaw.py Intégration OpenClaw async
main.py Application FastAPI principale

API Routers (backend/app/routers/)

Fichier Endpoints
projects.py CRUD projets + /start, /pause, /stop, /reset
agents.py Status agents + historique
logs.py Audit logs avec filtres
workflows.py Définitions des 4 workflows
config.py Gestion config (secrets masqués)
ws.py WebSocket hub temps réel

Frontend (frontend/src/)

Fichier Page
App.tsx Layout principal + sidebar + routing
Dashboard.tsx Vue d'ensemble (stats, agents, activité)
Projects.tsx Liste projets + création + contrôle
Agents.tsx Cartes agents avec stats
Logs.tsx Table audit en temps réel
Settings.tsx Configuration + workflows

Telegram Bot

Fichier Rôle
foxy-telegram-bot-v3.py Bot async via API centralisée (remplace les subprocess)

Vérification

API Endpoints testés

GET  /api/health     → {"status": "ok", "version": "2.0.0"}
POST /api/projects   → Création projet avec audit log
GET  /api/projects   → Liste avec task_count/tasks_done
GET  /api/agents     → 6 agents avec modèles et stats
GET  /api/workflows  → 4 workflows (SOFTWARE_DESIGN, SYSADMIN_DEBUG, DEVOPS_SETUP, SYSADMIN_ADJUST)
GET  /api/logs       → Audit logs filtrables

Dashboard vérifié visuellement

![Dashboard principal — stat cards, projets en cours, agents, activité récente](C:/Users/bruno/.gemini/antigravity/brain/8671b437-c23e-40f7-ac31-e12ef1c7eb72/dashboard_main.png)
<!-- slide -->
![Agents — 6 cartes avec modèles IA et statistiques d'exécution](C:/Users/bruno/.gemini/antigravity/brain/8671b437-c23e-40f7-ac31-e12ef1c7eb72/agents_page.png)
<!-- slide -->
![Logs en temps réel — table d'audit avec filtres et auto-scroll](C:/Users/bruno/.gemini/antigravity/brain/8671b437-c23e-40f7-ac31-e12ef1c7eb72/logs_page.png)

Enregistrement du Dashboard

Navigation complète du Dashboard


Démarrage rapide

# Backend
cd backend
cp .env.example .env  # Configurer les variables
pip install -r requirements.txt
python -m uvicorn app.main:app --port 8000

# Frontend
cd frontend
npm install
npm run dev

# Telegram Bot
cd scripts
export TELEGRAM_BOT_TOKEN="..." TELEGRAM_CHAT_ID="..." FOXY_API_URL="http://localhost:8000"
python3 foxy-telegram-bot-v3.py