Skip to main content

Projects Module

The projects module manages the core project lifecycle — from creation to simulation results.

Data Model

Project
├── name, tags[], location, coverImage
├── surveyMapId → SurveyMap
├── organizationId → Organization
├── sharedWith[] → ProjectShare[]
└── variants[] → ProjectVariant[]
├── name, productMix (JSON)
├── currentStage (DRAFT → IN_PROGRESS → COMPLETED)
└── solutions[] → ProjectVariantSolution[]
├── solutionEngineId
├── solutionData (JSON)
└── overallScore

Project Endpoints

MethodPathDescription
GET/projectsList user's projects (owned + shared)
POST/projectsCreate a new project
GET/projects/:idGet project details
PATCH/projects/:idUpdate project
DELETE/projects/:idDelete project
POST/projects/:id/cover-imageUpload cover image
POST/projects/:id/shareShare project with a user

Variant Endpoints

MethodPathDescription
POST/project-variantsCreate a new variant
GET/project-variants/:idGet variant details
PATCH/project-variants/:idUpdate variant (product mix, metadata)
DELETE/project-variants/:idDelete variant

Solution Storage

Solutions from the simulation engine are stored as JSON blobs in ProjectVariantSolution:

{
"solutionEngineId": "sol_abc123",
"overallScore": 87.5,
"solutionData": {
"towers": [...],
"metrics": {
"totalBUA": 15000,
"far": 2.8,
"unitCount": 120
}
}
}

Project Sharing

Projects can be shared with specific users via ProjectShare:

  • Access Levels: VIEWER (read-only) or EDITOR (can modify)
  • Constraints: One share entry per user-project pair (enforced by @@unique([projectId, userId]))
  • Projects list includes both owned projects and shared projects

Variant Stages

StageDescription
DRAFTInitial creation, product mix being configured
IN_PROGRESSSimulation is running or solutions are being explored
COMPLETEDFinal solution selected and project is complete