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
| Method | Path | Description |
|---|---|---|
GET | /projects | List user's projects (owned + shared) |
POST | /projects | Create a new project |
GET | /projects/:id | Get project details |
PATCH | /projects/:id | Update project |
DELETE | /projects/:id | Delete project |
POST | /projects/:id/cover-image | Upload cover image |
POST | /projects/:id/share | Share project with a user |
Variant Endpoints
| Method | Path | Description |
|---|---|---|
POST | /project-variants | Create a new variant |
GET | /project-variants/:id | Get variant details |
PATCH | /project-variants/:id | Update variant (product mix, metadata) |
DELETE | /project-variants/:id | Delete 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) orEDITOR(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
| Stage | Description |
|---|---|
DRAFT | Initial creation, product mix being configured |
IN_PROGRESS | Simulation is running or solutions are being explored |
COMPLETED | Final solution selected and project is complete |