# BIM Twin Viewer Interactive IFC-based 3D building model viewer. Upload an IFC file to inspect building elements, their properties, and navigate the model in a browser-based 3D view. ## Tech stack - **Backend:** Python 3.12, FastAPI, SQLAlchemy (async), IfcOpenShell - **Frontend:** Vue.js 3, Three.js - **Database:** PostgreSQL 16 - **Infrastructure:** Docker Compose, Caddy, Forgejo CI ## Quick start ```bash cp .env.example .env # Edit .env and set DB_PASSWORD docker compose up -d ``` - **API:** http://localhost:8000 - **API docs:** http://localhost:8000/docs - **Frontend:** http://localhost:5173 ## Project structure ``` . ├── backend/ │ ├── app/ │ │ ├── api/ # FastAPI route handlers │ │ ├── models/ # SQLAlchemy ORM models │ │ ├── schemas/ # Pydantic request/response schemas │ │ └── services/ # Business logic (IFC parsing) │ ├── tests/ │ ├── Dockerfile │ └── requirements.txt ├── frontend/ │ ├── src/ │ │ ├── components/ # Vue components (viewer, panels) │ │ ├── views/ # Page-level views │ │ └── composables/ # Reusable composition functions │ ├── Dockerfile │ └── package.json ├── data/ │ └── sample/ # Example IFC files for testing ├── docs/ ├── docker-compose.yml └── README.md ``` ## API overview | Method | Endpoint | Description | |--------|---------------------------------------|---------------------------| | GET | `/health` | Health check | | POST | `/api/upload` | Upload and parse IFC file | | GET | `/api/projects` | List all projects | | GET | `/api/projects/{id}/elements` | List elements (filterable)| | GET | `/api/elements/{id}` | Element detail + properties| ## Running tests ```bash # Backend docker compose exec backend pytest -v # Or locally cd backend python -m pytest -v ``` ## License MIT