feat: Rearchitect Foxy Dev Team with FastAPI, React, SQLite, and a new Telegram bot, updating deployment configurations and documentation.
This commit is contained in:
parent
a927534d16
commit
023e399d1d
@ -5,7 +5,7 @@
|
||||
# into a single production-ready image.
|
||||
#
|
||||
# Build: docker build -t foxy-dev-team .
|
||||
# Run: docker run -p 8000:8000 --env-file backend/.env foxy-dev-team
|
||||
# Run: docker run -p 7000:7000 --env-file backend/.env foxy-dev-team
|
||||
# ═══════════════════════════════════════════════════════════════════════════════
|
||||
|
||||
# ─── Stage 1: Frontend Build ──────────────────────────────────────────────────
|
||||
@ -47,15 +47,15 @@ COPY --from=frontend-build /build/dist ./static
|
||||
|
||||
# Healthcheck
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
||||
CMD curl -f http://localhost:8000/api/health || exit 1
|
||||
CMD curl -f http://localhost:7000/api/health || exit 1
|
||||
|
||||
# Runtime config
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
LOG_LEVEL=info
|
||||
|
||||
EXPOSE 8000
|
||||
EXPOSE 7000
|
||||
|
||||
USER foxy
|
||||
|
||||
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7000"]
|
||||
|
||||
18
README.md
18
README.md
@ -167,7 +167,7 @@ cd foxy-dev-team
|
||||
cd backend
|
||||
cp .env.example .env # ⚠️ Éditer avec vos valeurs !
|
||||
pip install -r requirements.txt
|
||||
python -m uvicorn app.main:app --port 8000 --reload
|
||||
python -m uvicorn app.main:app --port 7000 --reload
|
||||
|
||||
# 3. Frontend (nouveau terminal)
|
||||
cd frontend
|
||||
@ -233,7 +233,7 @@ docker build -t foxy-dev-team .
|
||||
# Exécuter
|
||||
docker run -d \
|
||||
--name foxy-api \
|
||||
-p 8000:8000 \
|
||||
-p 7000:7000 \
|
||||
--env-file backend/.env \
|
||||
foxy-dev-team
|
||||
|
||||
@ -242,7 +242,7 @@ docker build -t foxy-telegram -f Dockerfile.telegram .
|
||||
docker run -d \
|
||||
--name foxy-telegram \
|
||||
--env-file backend/.env \
|
||||
-e FOXY_API_URL=http://foxy-api:8000 \
|
||||
-e FOXY_API_URL=http://foxy-api:7000 \
|
||||
--network container:foxy-api \
|
||||
foxy-telegram
|
||||
```
|
||||
@ -251,7 +251,7 @@ docker run -d \
|
||||
|
||||
| Service | Image | Port | Description |
|
||||
|---|---|---|---|
|
||||
| `foxy-api` | `Dockerfile` | `8000` | Backend + Frontend statique |
|
||||
| `foxy-api` | `Dockerfile` | `7000` | Backend + Frontend statique |
|
||||
| `foxy-telegram` | `Dockerfile.telegram` | — | Bot Telegram (API-backed) |
|
||||
|
||||
Le `Dockerfile` principal utilise un **build multi-stage** :
|
||||
@ -357,7 +357,7 @@ foxy-dev-team/
|
||||
|
||||
## 📡 API Reference
|
||||
|
||||
Base URL : `http://localhost:8000`
|
||||
Base URL : `http://localhost:7000`
|
||||
|
||||
### Health
|
||||
|
||||
@ -399,9 +399,9 @@ Base URL : `http://localhost:8000`
|
||||
|
||||
| Endpoint | Description |
|
||||
|---|---|
|
||||
| `ws://host:8000/ws/live` | Temps réel : `agent_status`, `log`, `project_update` |
|
||||
| `ws://host:7000/ws/live` | Temps réel : `agent_status`, `log`, `project_update` |
|
||||
|
||||
> 📖 Documentation interactive Swagger : `http://localhost:8000/docs`
|
||||
> 📖 Documentation interactive Swagger : `http://localhost:7000/docs`
|
||||
|
||||
---
|
||||
|
||||
@ -449,7 +449,7 @@ Le bot Telegram v3 (`foxy-telegram-bot-v3.py`) interagit exclusivement via l'API
|
||||
```bash
|
||||
export TELEGRAM_BOT_TOKEN="votre_token"
|
||||
export TELEGRAM_CHAT_ID="votre_chat_id"
|
||||
export FOXY_API_URL="http://localhost:8000" # URL de l'API backend
|
||||
export FOXY_API_URL="http://localhost:7000" # URL de l'API backend
|
||||
```
|
||||
|
||||
---
|
||||
@ -467,7 +467,7 @@ Cela crée 2 services systemd (user mode) :
|
||||
|
||||
| Service | Description | Dépendance |
|
||||
|---|---|---|
|
||||
| `foxy-api` | Backend FastAPI (port 8000) | — |
|
||||
| `foxy-api` | Backend FastAPI (port 7000) | — |
|
||||
| `foxy-telegram` | Bot Telegram v3 | `foxy-api` |
|
||||
|
||||
### Commandes de gestion
|
||||
|
||||
@ -19,13 +19,13 @@ services:
|
||||
container_name: foxy-api
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "${API_PORT:-8000}:8000"
|
||||
- "${API_PORT:-7000}:7000"
|
||||
env_file:
|
||||
- backend/.env
|
||||
volumes:
|
||||
- foxy-data:/app/data
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
|
||||
test: ["CMD", "curl", "-f", "http://localhost:7000/api/health"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
@ -46,7 +46,7 @@ services:
|
||||
env_file:
|
||||
- backend/.env
|
||||
environment:
|
||||
- FOXY_API_URL=http://foxy-api:8000
|
||||
- FOXY_API_URL=http://foxy-api:7000
|
||||
depends_on:
|
||||
foxy-api:
|
||||
condition: service_healthy
|
||||
|
||||
@ -112,7 +112,7 @@ GET /api/logs → Audit logs filtrables
|
||||
cd backend
|
||||
cp .env.example .env # Configurer les variables
|
||||
pip install -r requirements.txt
|
||||
python -m uvicorn app.main:app --port 8000
|
||||
python -m uvicorn app.main:app --port 7000
|
||||
|
||||
# Frontend
|
||||
cd frontend
|
||||
@ -121,6 +121,6 @@ npm run dev
|
||||
|
||||
# Telegram Bot
|
||||
cd scripts
|
||||
export TELEGRAM_BOT_TOKEN="..." TELEGRAM_CHAT_ID="..." FOXY_API_URL="http://localhost:8000"
|
||||
export TELEGRAM_BOT_TOKEN="..." TELEGRAM_CHAT_ID="..." FOXY_API_URL="http://localhost:7000"
|
||||
python3 foxy-telegram-bot-v3.py
|
||||
```
|
||||
|
||||
@ -11,11 +11,11 @@ export default defineConfig({
|
||||
port: 5173,
|
||||
proxy: {
|
||||
'/api': {
|
||||
target: 'http://localhost:8000',
|
||||
target: 'http://localhost:7000',
|
||||
changeOrigin: true,
|
||||
},
|
||||
'/ws': {
|
||||
target: 'ws://localhost:8000',
|
||||
target: 'ws://localhost:7000',
|
||||
ws: true,
|
||||
},
|
||||
},
|
||||
|
||||
@ -22,7 +22,7 @@ import httpx
|
||||
|
||||
TELEGRAM_BOT_TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN", "")
|
||||
TELEGRAM_CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "")
|
||||
API_BASE_URL = os.environ.get("FOXY_API_URL", "http://localhost:8000")
|
||||
API_BASE_URL = os.environ.get("FOXY_API_URL", "http://localhost:7000")
|
||||
POLL_TIMEOUT = 30
|
||||
|
||||
# ─── LOGGING ───────────────────────────────────────────────────────────────────
|
||||
@ -204,7 +204,7 @@ async def cmd_aide(tg: TelegramClient, chat_id: str):
|
||||
"<b>/reset</b> ID — Réinitialiser un projet\n"
|
||||
"<b>/aide</b> — Cette aide\n\n"
|
||||
"━━━━━━━━━━━━━━━━━━━━\n"
|
||||
f"🌐 Dashboard : <a href='{API_BASE_URL.replace(':8000', ':5173')}'>Ouvrir</a>"
|
||||
f"🌐 Dashboard : <a href='{API_BASE_URL.replace(':7000', ':5173')}'>Ouvrir</a>"
|
||||
)
|
||||
|
||||
|
||||
|
||||
@ -66,7 +66,7 @@ StartLimitBurst=3
|
||||
Type=simple
|
||||
WorkingDirectory=$PROJECT_DIR/backend
|
||||
EnvironmentFile=$ENV_FILE
|
||||
ExecStart=$(command -v python3) -m uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
ExecStart=$(command -v python3) -m uvicorn app.main:app --host 0.0.0.0 --port 7000
|
||||
Restart=on-failure
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
@ -138,6 +138,6 @@ echo " journalctl --user -u foxy-api -f"
|
||||
echo " journalctl --user -u foxy-telegram -f"
|
||||
echo ""
|
||||
log " Dashboard : http://localhost:5173"
|
||||
log " API : http://localhost:8000"
|
||||
log " API Docs : http://localhost:8000/docs"
|
||||
log " API : http://localhost:7000"
|
||||
log " API Docs : http://localhost:7000/docs"
|
||||
log "═══════════════════════════════════════════════════════════"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user