feat: scaffold backend with FastAPI, config files, and health endpoint
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
0
backend/config/__init__.py
Normal file
0
backend/config/__init__.py
Normal file
20
backend/config/services.yaml
Normal file
20
backend/config/services.yaml
Normal file
@@ -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
|
||||||
16
backend/config/settings.yaml
Normal file
16
backend/config/settings.yaml
Normal file
@@ -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
|
||||||
25
backend/main.py
Normal file
25
backend/main.py
Normal file
@@ -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"}
|
||||||
0
backend/modules/__init__.py
Normal file
0
backend/modules/__init__.py
Normal file
8
backend/requirements.txt
Normal file
8
backend/requirements.txt
Normal file
@@ -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
|
||||||
0
backend/routers/__init__.py
Normal file
0
backend/routers/__init__.py
Normal file
Reference in New Issue
Block a user