How amb1/sgh_masterthesis works
Main Components
• Backend (located under /local):
– Data Ingestion & Processing: The Python scripts (e.g., scripts/process_citygml.py) are responsible for loading CityGML, fetching additional data via WFS and OSM, and creating/updating the project directories (e.g., local/projects/CityGMLProject) for City Energy Analyst (CEA).
– Configuration & Workflow Management: The cfg folder holds various YAML configuration files (for CEA and data sources) that define data mapping, available layers, and analysis workflows.
– Utility Modules: Under local/utils (including submodules like CEA, data_processing, data_sources, helper, etc.) that encapsulate the logic for processing data, mapping CityGML to IFC, and performing additional helper functions.
– Execution & Orchestration: The main entry points like run_cea.py and the various scripts coordinate the pipeline from data ingestion to project creation.
• Frontend (located under /web):
– User Interface & Components: Written in React and TypeScript, with components (e.g., Auth, Projects, Config, CesiumViewer) managing user interactions, authentication, and layout.
– Visualization: CesiumJS is integrated (as seen in CesiumViewer and CesiumConfig components) to render 3D geospatial data.
– API Communication: The frontend contains API endpoints (in web/src/app/api/) and service modules (e.g., citygmlService.ts, viennaService.ts, wfsService.ts) for interacting with the backend and possibly Supabase for auth and backend data.
– Supabase Integration: Used for authentication and possibly database interactions, as referenced in the Supabase configuration folders and related scripts.
Relationships and Interactions
• Data Flow:
– The backend ingests and processes CityGML data, enriches it via external data sources (WFS, OSM), and produces outputs that are either stored in project folders or made available via API endpoints.
– The frontend communicates with the backend via RESTful API endpoints (found in web/src/app/api) to retrieve processed data and project boundaries.
– The frontend then utilizes CesiumJS and other UI components to display the 3D visualization and data analytics to the user.
• Dependencies:
– The backend is loosely coupled with the frontend through clearly defined service endpoints and data contracts.
– Both parts of the application are connected via configuration files (both YAML and JSON) that define data mappings, processing parameters, and service endpoints.
Architectural Patterns & Design Principles
• Separation of Concerns: Clearly delineated boundaries between the Python backend (data processing, workflow orchestration) and the React frontend (user interactions, 3D visual rendering).
• Modularization: Both directories (local and web) contain modular components (scripts, utilities, API endpoints, UI components) that are isolated and reusable.
• Configuration-Driven Behavior: The backend uses YAML files to define mappings and workflows, allowing flexibility in adapting to various data sources and processing requirements.
• Integration via APIs: The frontend’s API layer (and the SaaS components via Supabase) indicates a clear contract for communication between the UI and the processing backend.
Relevant Technologies, Frameworks & Libraries
• Backend: Python 3.9+, CEA (City Energy Analyst) workflow, CityGML processing utilities, YAML configuration.
• Frontend: React 18 with TypeScript, Vite (for module bundling and HMR), CesiumJS (3D visualization), Supabase, TailwindCSS.