# brodyacquilano/mapdex-2 architecture

> Architecture diagram of the GitHub repository brodyacquilano/mapdex-2, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/brodyacquilano/mapdex-2
- Repository: https://github.com/brodyacquilano/mapdex-2
- Video tour (about a minute): https://gitdiagram.com/brodyacquilano/mapdex-2/video

## Overview

Mapdex is a full-stack spatial data platform for configurable map projects. Users enter through the web app, access viewer or editor workflows, explore and filter project records on an interactive map, and manage spatial data and project-defined schemas; server APIs provide protected project and data operations. Distinct product areas include spatial tools, community extensions, and voice commands. The README documents the product workflow; source-index references and excerpts establish only selected frontend and server connections, so unverified links are omitted.

Main entry points: [`src/workspace/MainApp.jsx`](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workspace/MainApp.jsx) (Workspace shell), [`src/runtime/useSpatialToolsRuntime.js`](https://github.com/brodyacquilano/mapdex-2/blob/main/src/runtime/useSpatialToolsRuntime.js) (Spatial tools runtime), [`server/server.js`](https://github.com/brodyacquilano/mapdex-2/blob/main/server/server.js) (HTTP API server), [`src/App.jsx`](https://github.com/brodyacquilano/mapdex-2/blob/main/src/App.jsx) (Web application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["App entry"]
  node_app["Web application<br/>[App.jsx]"]
end

subgraph group_workspace["Project workspace"]
  node_workspace_app["Workspace shell<br/>[MainApp.jsx]"]
  node_viewer["Map viewer<br/>[Viewer.jsx]"]
  node_editor["Data editor<br/>[Editor.jsx]"]
  node_schema["Schema builder"]
end

subgraph group_spatial["Spatial workflows"]
  node_map["Interactive map<br/>[MapboxMapShell.jsx]"]
  node_filters["Record filters<br/>[useFilters.js]"]
  node_geometry["Geometry tools<br/>[draftGeometry.js]"]
  node_spatial_runtime["Spatial tools runtime"]
  node_layers["Map layers<br/>[Layers.jsx]"]
  node_aggregates["Data aggregates<br/>[Aggregates.jsx]"]
  node_boundaries["Boundary tools<br/>[Boundaries.jsx]"]
  node_neighbourhood_analysis["Neighbourhood analysis"]
end

subgraph group_community["Community features"]
  node_extensions["Project extensions<br/>[ChatPanel.jsx]"]
  node_gallery["Image gallery<br/>[GalleryModal.jsx]"]
  node_voice["Voice commands<br/>[VoicePipeline.js]"]
end

subgraph group_backend["Backend services"]
  node_api_server["HTTP API server<br/>[server.js]"]
  node_data_routes["Spatial data routes<br/>[places.js]"]
  node_project_routes["Project routes<br/>[projects.js]"]
  node_data_validation["Data validation<br/>[dataValidation.js]"]
  node_database[("MongoDB<br/>[db.js]")]
end

node_person(("Project user"))

node_person -->|"uses"| node_app
node_app -->|"routes to"| node_workspace_app
node_workspace_app -.->|"offers viewing"| node_viewer
node_workspace_app -.->|"offers editing"| node_editor
node_workspace_app -.->|"configures projects"| node_schema
node_viewer -.->|"shows records"| node_map
node_viewer -.->|"filters records"| node_filters
node_editor -->|"edits geometry"| node_geometry
node_workspace_app -.->|"hosts tools"| node_spatial_runtime
node_spatial_runtime -->|"supports"| node_layers
node_spatial_runtime -->|"supports"| node_aggregates
node_spatial_runtime -->|"supports"| node_boundaries
node_workspace_app -.->|"offers analysis"| node_neighbourhood_analysis
node_workspace_app -.->|"offers extensions"| node_extensions
node_workspace_app -.->|"offers gallery"| node_gallery
node_app -.->|"registers commands"| node_voice
node_api_server -->|"mounts routes"| node_data_routes
node_api_server -->|"mounts routes"| node_project_routes
node_editor -.->|"submits data"| node_api_server
node_data_routes -.->|"validates records"| node_data_validation
node_api_server -->|"connects on startup"| node_database

click node_app "https://github.com/brodyacquilano/mapdex-2/blob/main/src/App.jsx"
click node_workspace_app "https://github.com/brodyacquilano/mapdex-2/blob/main/src/workspace/MainApp.jsx"
click node_viewer "https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Viewer.jsx"
click node_editor "https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Editor.jsx"
click node_map "https://github.com/brodyacquilano/mapdex-2/blob/main/src/map/mapbox/MapboxMapShell.jsx"
click node_filters "https://github.com/brodyacquilano/mapdex-2/blob/main/src/filters/hooks/useFilters.js"
click node_geometry "https://github.com/brodyacquilano/mapdex-2/blob/main/src/map/utils/draftGeometry.js"
click node_spatial_runtime "https://github.com/brodyacquilano/mapdex-2/blob/main/src/runtime/useSpatialToolsRuntime.js"
click node_layers "https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Layers.jsx"
click node_aggregates "https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Aggregates.jsx"
click node_boundaries "https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Boundaries.jsx"
click node_neighbourhood_analysis "https://github.com/brodyacquilano/mapdex-2/blob/main/src/analysis/neighbourhood/NeighbourhoodAnalysisPanel.jsx"
click node_extensions "https://github.com/brodyacquilano/mapdex-2/blob/main/src/extensions/ChatPanel.jsx"
click node_gallery "https://github.com/brodyacquilano/mapdex-2/blob/main/src/extensions/GalleryModal.jsx"
click node_voice "https://github.com/brodyacquilano/mapdex-2/blob/main/src/system/voice/VoicePipeline.js"
click node_api_server "https://github.com/brodyacquilano/mapdex-2/blob/main/server/server.js"
click node_data_routes "https://github.com/brodyacquilano/mapdex-2/blob/main/server/routes/places.js"
click node_project_routes "https://github.com/brodyacquilano/mapdex-2/blob/main/server/routes/projects.js"
click node_data_validation "https://github.com/brodyacquilano/mapdex-2/blob/main/shared/validation/dataValidation.js"
click node_database "https://github.com/brodyacquilano/mapdex-2/blob/main/server/db.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_person toneBlue
class node_workspace_app,node_viewer,node_editor,node_schema toneAmber
class node_map,node_filters,node_geometry,node_spatial_runtime,node_layers,node_aggregates,node_boundaries,node_neighbourhood_analysis toneMint
class node_extensions,node_gallery,node_voice toneRose
class node_api_server,node_data_routes,node_project_routes,node_data_validation,node_database toneIndigo
```

## Components

### App entry

- [Web application](https://github.com/brodyacquilano/mapdex-2/blob/main/src/App.jsx): `src/App.jsx`

### Project workspace

- [Workspace shell](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workspace/MainApp.jsx): `src/workspace/MainApp.jsx`
- [Map viewer](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Viewer.jsx): `src/workflows/Viewer.jsx`
- [Data editor](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Editor.jsx): `src/workflows/Editor.jsx`
- **Schema builder**

### Spatial workflows

- [Interactive map](https://github.com/brodyacquilano/mapdex-2/blob/main/src/map/mapbox/MapboxMapShell.jsx): `src/map/mapbox/MapboxMapShell.jsx`
- [Record filters](https://github.com/brodyacquilano/mapdex-2/blob/main/src/filters/hooks/useFilters.js): `src/filters/hooks/useFilters.js`
- [Geometry tools](https://github.com/brodyacquilano/mapdex-2/blob/main/src/map/utils/draftGeometry.js): `src/map/utils/draftGeometry.js`
- [Spatial tools runtime](https://github.com/brodyacquilano/mapdex-2/blob/main/src/runtime/useSpatialToolsRuntime.js): `src/runtime/useSpatialToolsRuntime.js`
- [Map layers](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Layers.jsx): `src/workflows/Layers.jsx`
- [Data aggregates](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Aggregates.jsx): `src/workflows/Aggregates.jsx`
- [Boundary tools](https://github.com/brodyacquilano/mapdex-2/blob/main/src/workflows/Boundaries.jsx): `src/workflows/Boundaries.jsx`
- [Neighbourhood analysis](https://github.com/brodyacquilano/mapdex-2/blob/main/src/analysis/neighbourhood/NeighbourhoodAnalysisPanel.jsx): `src/analysis/neighbourhood/NeighbourhoodAnalysisPanel.jsx`

### Community features

- [Project extensions](https://github.com/brodyacquilano/mapdex-2/blob/main/src/extensions/ChatPanel.jsx): `src/extensions/ChatPanel.jsx`
- [Image gallery](https://github.com/brodyacquilano/mapdex-2/blob/main/src/extensions/GalleryModal.jsx): `src/extensions/GalleryModal.jsx`
- [Voice commands](https://github.com/brodyacquilano/mapdex-2/blob/main/src/system/voice/VoicePipeline.js): `src/system/voice/VoicePipeline.js`

### Backend services

- [HTTP API server](https://github.com/brodyacquilano/mapdex-2/blob/main/server/server.js): `server/server.js`
- [Spatial data routes](https://github.com/brodyacquilano/mapdex-2/blob/main/server/routes/places.js): `server/routes/places.js`
- [Project routes](https://github.com/brodyacquilano/mapdex-2/blob/main/server/routes/projects.js): `server/routes/projects.js`
- [Data validation](https://github.com/brodyacquilano/mapdex-2/blob/main/shared/validation/dataValidation.js): `shared/validation/dataValidation.js`
- [MongoDB](https://github.com/brodyacquilano/mapdex-2/blob/main/server/db.js): `server/db.js`

### Other components

- **Project user**

## Connections

- Project user → Web application: uses
- Web application → Workspace shell: routes to (evidence: `src/App.jsx`)
- Workspace shell → Map viewer: offers viewing
- Workspace shell → Data editor: offers editing
- Workspace shell → Schema builder: configures projects
- Map viewer → Interactive map: shows records
- Map viewer → Record filters: filters records
- Data editor → Geometry tools: edits geometry
- Workspace shell → Spatial tools runtime: hosts tools
- Spatial tools runtime → Map layers: supports (evidence: `src/runtime/useSpatialToolsRuntime.js`)
- Spatial tools runtime → Data aggregates: supports (evidence: `src/runtime/useSpatialToolsRuntime.js`)
- Spatial tools runtime → Boundary tools: supports (evidence: `src/runtime/useSpatialToolsRuntime.js`)
- Workspace shell → Neighbourhood analysis: offers analysis
- Workspace shell → Project extensions: offers extensions
- Workspace shell → Image gallery: offers gallery
- Web application → Voice commands: registers commands
- HTTP API server → Spatial data routes: mounts routes (evidence: `server/server.js`)
- HTTP API server → Project routes: mounts routes (evidence: `server/server.js`)
- Data editor → HTTP API server: submits data
- Spatial data routes → Data validation: validates records
- HTTP API server → MongoDB: connects on startup (evidence: `server/server.js`)
