From f1c20c0461c73527c96170d4261622e7c11cc581 Mon Sep 17 00:00:00 2001 From: "I. Alcaraz Salazar" Date: Sun, 15 Feb 2026 08:04:13 +0000 Subject: [PATCH] feat: scaffold backend with FastAPI, config files, and health endpoint Co-Authored-By: Claude Opus 4.6 --- backend/config/__init__.py | 0 backend/config/services.yaml | 20 ++++++++++++++++++++ backend/config/settings.yaml | 16 ++++++++++++++++ backend/main.py | 25 +++++++++++++++++++++++++ backend/modules/__init__.py | 0 backend/requirements.txt | 8 ++++++++ backend/routers/__init__.py | 0 7 files changed, 69 insertions(+) create mode 100644 backend/config/__init__.py create mode 100644 backend/config/services.yaml create mode 100644 backend/config/settings.yaml create mode 100644 backend/main.py create mode 100644 backend/modules/__init__.py create mode 100644 backend/requirements.txt create mode 100644 backend/routers/__init__.py diff --git a/backend/config/__init__.py b/backend/config/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/config/services.yaml b/backend/config/services.yaml new file mode 100644 index 0000000..901a99e --- /dev/null +++ b/backend/config/services.yaml @@ -0,0 +1,20 @@ +nodes: + - name: "Router Principal" + ip: "192.168.1.1" + username: "admin" + password: "admin" + icon: "router" + connections: [] + + - name: "Servidor Ejemplo" + ip: "192.168.1.10" + username: "root" + password: "password" + public_url: "https://ejemplo.com" + icon: "server" + connections: ["Router Principal"] + +network_scan: + enabled: true + subnet: "192.168.1.0/24" + interval_minutes: 10 diff --git a/backend/config/settings.yaml b/backend/config/settings.yaml new file mode 100644 index 0000000..3b8eabe --- /dev/null +++ b/backend/config/settings.yaml @@ -0,0 +1,16 @@ +display: + resolution: "3840x2160" + rotation_interval_seconds: 30 + transition: "fade" + theme: "dark" + +odoo: + url: "http://localhost:8069" + database: "odoo" + username: "admin" + password: "admin" + +refresh: + odoo_minutes: 5 + network_minutes: 10 + ping_seconds: 60 diff --git a/backend/main.py b/backend/main.py new file mode 100644 index 0000000..b6e2512 --- /dev/null +++ b/backend/main.py @@ -0,0 +1,25 @@ +from contextlib import asynccontextmanager +from fastapi import FastAPI +from fastapi.middleware.cors import CORSMiddleware + + +@asynccontextmanager +async def lifespan(app: FastAPI): + # Startup + yield + # Shutdown + + +app = FastAPI(title="TV Dashboard API", lifespan=lifespan) + +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_methods=["*"], + allow_headers=["*"], +) + + +@app.get("/api/health") +async def health(): + return {"status": "ok"} diff --git a/backend/modules/__init__.py b/backend/modules/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/requirements.txt b/backend/requirements.txt new file mode 100644 index 0000000..e8b6b36 --- /dev/null +++ b/backend/requirements.txt @@ -0,0 +1,8 @@ +fastapi==0.115.6 +uvicorn[standard]==0.34.0 +python-nmap==0.7.1 +PyYAML==6.0.2 +websockets==14.1 +httpx==0.28.1 +pydantic==2.10.4 +pydantic-settings==2.7.1 diff --git a/backend/routers/__init__.py b/backend/routers/__init__.py new file mode 100644 index 0000000..e69de29