- FastAPI with async SQLAlchemy models for IFC elements - IFC file upload and parsing via IfcOpenShell - REST API for projects, elements, and properties - Vue.js 3 frontend shell with Three.js dependency - Docker Compose for full-stack local development - PostgreSQL 16 as database - CI pipeline for Forgejo Actions - Project documentation and API overview
78 lines
2.1 KiB
Markdown
78 lines
2.1 KiB
Markdown
# 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
|
|
|