Skip to content

Final Submission: Integrated Digital Twin with responsive UI dashboard - #6

Merged
bonk18 merged 1 commit into
mainfrom
final-submission
Jul 22, 2026
Merged

Final Submission: Integrated Digital Twin with responsive UI dashboard#6
bonk18 merged 1 commit into
mainfrom
final-submission

Conversation

@bonk18

@bonk18 bonk18 commented Jul 22, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings July 22, 2026 17:35
@bonk18
bonk18 merged commit 15ceb59 into main Jul 22, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR integrates a “digital twin” simulation and safety-intelligence generation endpoints into the FastAPI backend, and adds configuration to serve a frontend UI from the same service.

Changes:

  • Adds global CORS middleware and mounts a static frontend at /.
  • Introduces new /intelligence and /simulation API routers and wires them into the application.
  • Expands the interventions API with a POST endpoint for triggering interventions.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.

File Description
backend/app/main.py Adds CORS middleware, includes new routers, and mounts the frontend static directory.
backend/app/api/simulation.py Adds a digital-twin-backed simulation controller and endpoints, with optional intelligence fusion.
backend/app/api/interventions.py Updates interventions routing and adds a POST endpoint accepting a request body.
backend/app/api/intelligence.py Adds an intelligence generation endpoint backed by the RAG/LLM service layer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/app/main.py
Comment on lines +25 to +31
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
Comment on lines +5 to 8
router = APIRouter(
prefix="/api/interventions",
tags=["Interventions"]
)
from app.api.intelligence import get_intelligence_service
from app.schemas import RiskEngineInput

router = APIRouter(prefix="/api/simulation", tags=["simulation"])
Comment on lines +10 to +12
# Setup paths for digital twin
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
sys.path.append(os.path.join(BASE_DIR, "digital twin"))
def _process_row(self, row: dict):
self.last_state = row

zone_ids = ["ZONE_A", "ZONE_B", "ZONE_C", "ZONE_D", "ZONE_E", "ZONE_F", "ZONE_G"]
import time
from typing import Dict, Any, List
from pathlib import Path
from pydantic import BaseModel
Comment on lines +160 to +162
class StartRequest(BaseModel):
scenario: str
speed: float = 1.0
"alert_id": "ALT-" + str(int(time.time()))
})

sim_ctrl = SimulationController()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants