Skip to content

Commit 6f80de2

Browse files
jochem25claude
andcommitted
feat: migrate cloud storage to project container model
Replace legacy paths (70_BIM, 99_overige_documenten/bim-validator) with new project container structure (models/, validation/, project.wefc). All reads try new path first with automatic fallback to legacy paths. Writes always go to the new structure. - nextcloud_client.py: DIR_MODELS/DIR_VALIDATION constants, manifest CRUD (read/write/upsert), list_models/list_validation_files with fallback, upload_to_validation, download_from with fallback - volume_reader.py: fallback in list_bim_files, list_output_files, get_file_path; read_manifest from volume mount - routers/cloud.py: endpoints use new paths, manifest endpoint, validation save with WefcValidation manifest update - models/cloud.py: ManifestHeader + ManifestResponse models - 26 tests (19 client + 7 endpoints), all passing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b4ae89a commit 6f80de2

8 files changed

Lines changed: 1280 additions & 107 deletions

File tree

STATUS.md

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Project Status — 2026-03-29
1+
# Project Status — 2026-03-30
22

3-
## Huidige fase: Fase 7 (Hybrid Cloud + Multi-tenant) — deployed
3+
## Huidige fase: Fase 7 (Hybrid Cloud + Multi-tenant + Project Container) — in progress
44

55
### Wat is af
66
- Fase 0: Research & validatie
@@ -13,41 +13,36 @@
1313
- Fase 6: Nextcloud Cloud Storage — WebDAV, save/open dialog
1414
- **Fase 7a: Project Management** — PostgreSQL backend, REST API, frontend UI
1515
- **Fase 7b: Hybrid Nextcloud I/O** — volume mount reads, WebDAV writes, multi-tenant
16+
- **Fase 7c: Project Container Model** — migratie naar models/validation/ structuur met project.wefc manifest
1617

17-
### Gedaan in vorige sessie (2026-03-28)
18-
- Project management systeem gebouwd (full-stack):
19-
- Backend: async SQLAlchemy 2.0 + PostgreSQL (SQLite fallback)
20-
- ORM models: Project + ProjectFile
21-
- REST API: /api/v2/projects CRUD + file upload/download/delete
22-
- Frontend: IProjectStorage interface + ServerProjectStorage + LocalProjectStorage
23-
- .bvp bestandsformaat voor lokale projecten (File System Access API)
24-
- ProjectList component in Backstage + i18n (NL + EN)
25-
- AppShell integratie met handleOpenProject
26-
- Hybrid Nextcloud I/O migratie:
27-
- server/tenant_config.py: multi-tenant config loader (tenants.json)
28-
- server/volume_reader.py: directe filesystem reads van NC volume mount
29-
- server/routers/cloud.py: refactored cloud router (was inline in main.py)
30-
- NextcloudClient: multi-tenant factory (from_tenant) + client registry
31-
- docker-compose.yml: NC data volume (ro), tenant config mount
32-
- config/tenants.json: 3BM tenant configuratie
33-
- Ghost mode pogingen (nog niet werkend):
34-
- Opacity 0.85→0.15: transparantie zelf werkt nu
35-
- Reset knop werkt
36-
- Geselecteerd element wordt nog NIET opaque getoond
37-
- Poging 1: mesh-level material restore → werkt niet (IFC batcht elementen in shared meshes)
38-
- Poging 2: fragment highlight overlay met opacity 1.0 → werkt ook niet
39-
- Moet dieper onderzocht worden hoe That Open Engine fragment highlights werken
40-
- Deployed naar Hetzner (commits a2d3b11, 5c8ba74, d12678f, 3674eb5)
41-
42-
### Gedaan in deze sessie (2026-03-29)
18+
### Gedaan in vorige sessie (2026-03-29)
4319
- **Ghost mode bug opgelost:**
44-
- Oorzaak: material-level opacity (`mat.opacity = 0.15`) beïnvloedt alle elementen in shared meshes door IFC batching
45-
- Fragment highlight overlay werd door transparante materials heen gerenderd (Three.js render order: opaque → transparent)
4620
- Fix: vervangen door `FragmentsModel.setOpacity()` / `resetOpacity()` / `setColor()` — fragment-level per-element controle
47-
- Verwijderd: `savedMaterials` map, `allGuidsCache`, `restoreMaterials()` methode
48-
- Geselecteerd element krijgt nu correct volle opacity + Verdigris kleur (#44B6A8)
21+
22+
### Gedaan in deze sessie (2026-03-30)
23+
- **Project container model migratie:**
24+
- nextcloud_client.py: nieuwe constanten (DIR_MODELS, DIR_VALIDATION, MANIFEST_FILENAME)
25+
- nextcloud_client.py: _tool_path schrijft nu naar validation/ i.p.v. 99_overige_documenten/bim-validator/
26+
- nextcloud_client.py: list_models() met fallback models/ → 70_BIM/
27+
- nextcloud_client.py: list_validation_files() met fallback validation/ → 99_overige_documenten/bim-validator/
28+
- nextcloud_client.py: download_file() met fallback new → legacy
29+
- nextcloud_client.py: upload_to_validation() — altijd naar validation/
30+
- nextcloud_client.py: manifest CRUD — read_manifest(), write_manifest(), upsert_manifest_object()
31+
- volume_reader.py: list_bim_files() met fallback models/ → 70_BIM/
32+
- volume_reader.py: list_output_files() met fallback validation/ → 99_overige_documenten/bim-validator/
33+
- volume_reader.py: get_file_path() met automatic legacy fallback
34+
- volume_reader.py: read_manifest() voor volume mount reads
35+
- routers/cloud.py: file listing gebruikt list_models/list_validation_files (met fallback)
36+
- routers/cloud.py: upload gaat naar validation/ directory
37+
- routers/cloud.py: save endpoint schrijft WefcValidation object naar manifest
38+
- routers/cloud.py: nieuw GET /api/cloud/projects/{project}/manifest endpoint
39+
- models/cloud.py: ManifestHeader + ManifestResponse Pydantic models
40+
- tests: 19 tests voor nextcloud_client (constanten, paths, fallback, manifest CRUD)
41+
- tests: 7 tests voor cloud endpoints (manifest, category routing, volume mount)
42+
- Alle 26 tests slagen
4943

5044
### Nog te doen
5145
- NC_SERVICE_PASS_3BM instellen in .env op server → cloud wordt actief
5246
- Cloud status testen na wachtwoord configuratie
5347
- OIDC tenant claim koppelen aan tenant selectie (nu hardcoded default "3bm")
48+
- Frontend: ProjectList component updaten voor manifest-aware weergave

TODO.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@
66
- [x] Fix: FragmentsModel.setOpacity() / resetOpacity() / setColor() per element (fragment-level)
77
- [x] Verwijderd: savedMaterials map, allGuidsCache, restoreMaterials(), material traversal
88

9+
## Project Container Model (Fase 7c)
10+
- [x] nextcloud_client.py: constanten DIR_MODELS, DIR_VALIDATION, MANIFEST_FILENAME
11+
- [x] nextcloud_client.py: paden migratie 99_overige_documenten → validation/, 70_BIM → models/
12+
- [x] nextcloud_client.py: fallback logica (new path first → legacy path)
13+
- [x] nextcloud_client.py: manifest CRUD (read, write, upsert)
14+
- [x] volume_reader.py: fallback logica voor list_bim_files, list_output_files, get_file_path
15+
- [x] volume_reader.py: read_manifest voor volume mount
16+
- [x] routers/cloud.py: endpoints updaten voor nieuwe paden
17+
- [x] routers/cloud.py: manifest endpoint (GET /api/cloud/projects/{project}/manifest)
18+
- [x] routers/cloud.py: validation save met WefcValidation manifest update
19+
- [x] models/cloud.py: ManifestHeader + ManifestResponse modellen
20+
- [x] Tests: 26 tests (19 nextcloud_client + 7 cloud endpoints)
21+
922
## Blocker: NC service account
1023
- [ ] NC_SERVICE_PASS_3BM instellen in `/opt/openaec/bim-validator/.env` op server
1124
- [ ] `sudo docker compose up -d` na .env aanmaken
@@ -18,11 +31,14 @@
1831
- [x] Auth omgebouwd naar Authentik proxy headers
1932
- [x] Project management systeem deployed (PostgreSQL + REST API)
2033
- [x] Hybrid Nextcloud I/O deployed (volume mount + WebDAV)
34+
- [ ] Project container model deployen (rebuild na merge)
2135

2236
## Testen
23-
- [ ] Cloud: project listing via volume mount (70_BIM bestanden)
24-
- [ ] Cloud: BCF save via WebDAV → zichtbaar in Nextcloud
37+
- [ ] Cloud: project listing via volume mount (models/ bestanden)
38+
- [ ] Cloud: validatie save via WebDAV → zichtbaar in Nextcloud validation/
39+
- [ ] Cloud: manifest read via GET /api/cloud/projects/{project}/manifest
2540
- [ ] Cloud: IFC download via volume mount (performance test)
41+
- [ ] Cloud: fallback naar legacy paden bij bestaande projecten
2642
- [ ] Proxy auth: login via Authentik → user zichtbaar in TitleBar
2743
- [ ] BCF ZIP downloaden → importeren in BIMcollab/Solibri/Revit
2844
- [ ] Push issues naar BCF Platform → verifieer op platform UI

server/models/cloud.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,31 @@ class CloudDeleteResponse(BaseModel):
6262
success: bool = Field(..., description="Whether the deletion succeeded")
6363
project: str = Field(..., description="Project name")
6464
filename: str = Field(..., description="Deleted file name")
65+
66+
67+
class ManifestHeader(BaseModel):
68+
"""Header section of a project.wefc manifest."""
69+
70+
schema_name: str = Field(
71+
"WeFC", alias="schema", description="Schema identifier"
72+
)
73+
schema_version: str = Field(
74+
"1.0.0", description="Schema version"
75+
)
76+
timestamp: str = Field("", description="Last update timestamp (ISO 8601)")
77+
application: str = Field("", description="Application that last wrote")
78+
79+
model_config = {"populate_by_name": True}
80+
81+
82+
class ManifestResponse(BaseModel):
83+
"""Response for GET /api/cloud/projects/{project}/manifest."""
84+
85+
header: ManifestHeader = Field(
86+
default_factory=ManifestHeader,
87+
description="Manifest header",
88+
)
89+
data: list[dict] = Field(
90+
default_factory=list,
91+
description="List of WeFC objects in the project",
92+
)

0 commit comments

Comments
 (0)