# core-stack-org/core-stack-backend architecture

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

- Interactive diagram: https://gitdiagram.com/core-stack-org/core-stack-backend
- Repository: https://github.com/core-stack-org/core-stack-backend

## Overview

CoRE Stack is a Django backend for natural-resource planning and geospatial data products. A principal workflow is requesting or scheduling a layer computation, producing hydrology, land-cover, terrain, or related outputs, then registering or publishing those outputs for use. The repository also supports project planning and DPR reporting, community and welfare datasets, and water-rejuvenation work. The graph groups these product capabilities and the shared pipeline, task, and geospatial-service layers. Several feature implementations are unsampled, so their internal links are omitted rather than inferred.

Main entry points: [`computing/tasks.py`](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/tasks.py) (Layer task dispatch), [`computing/utils.py`](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/utils.py) (Layer utilities), [`computing/misc/antyodaya/pipeline.py`](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/antyodaya/pipeline.py) (Antyodaya pipeline), [`computing/misc/facilities/pipeline.py`](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/facilities/pipeline.py) (Facilities pipeline)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and planning"]
  node_compute_api["Compute API<br/>[views.py]"]
  node_plans["Plans and reports<br/>[reports.py]"]
  node_dpr["DPR reporting<br/>[gen_dpr.py]"]
  node_moderation["Submission moderation<br/>[views.py]"]
  node_projects[("Project records<br/>[models.py]")]
end

subgraph group_compute["Geospatial computing"]
  node_hydrology["Hydrology layers"]
  node_lulc["Land-cover layers<br/>[lulc_v3.py]"]
  node_terrain["Terrain layers<br/>[terrain_raster.py]"]
  node_climate["Climate layers<br/>[drought.py]"]
  node_tree_health["Tree health<br/>[overall_change.py]"]
  node_stac["STAC collections<br/>[stac_collection.py]"]
end

subgraph group_community["Community data"]
  node_antyodaya["Antyodaya pipeline<br/>[pipeline.py]"]
  node_facilities["Facilities pipeline<br/>[pipeline.py]"]
  node_livestock["Livestock pipeline<br/>[pipeline.py]"]
end

subgraph group_water["Water rejuvenation"]
  node_water_tasks["Water project tasks<br/>[tasks.py]"]
  node_water_compute["Water rejuvenation analysis"]
end

subgraph group_platform["Shared platform"]
  node_layer_tasks["Layer task dispatch<br/>[tasks.py]"]
  node_celery["Async task runtime<br/>[celery.py]"]
  node_compute_utils["Layer utilities<br/>[utils.py]"]
  node_gee["Earth Engine utilities<br/>[gee_utils.py]"]
  node_geoadmin[("Administrative geography<br/>[models.py]")]
  node_pipeline_admin["Pipeline admin selection<br/>[admin.py]"]
  node_pipeline_outputs["Pipeline outputs<br/>[outputs.py]"]
  node_pipeline_publish["Pipeline publishing<br/>[publish.py]"]
end

node_user(("API consumer"))

node_user -.->|"requests layers"| node_compute_api
node_compute_api -.->|"dispatches tasks"| node_layer_tasks
node_layer_tasks -->|"imports compute"| node_hydrology
node_layer_tasks -->|"runs pipelines"| node_lulc
node_layer_tasks -->|"imports STAC task"| node_stac
node_layer_tasks -->|"updates layer status"| node_compute_utils
node_layer_tasks -->|"uses task app"| node_celery
node_celery -->|"loads logging integration"| node_compute_utils
node_stac -->|"uses layer models"| node_compute_utils
node_compute_utils -->|"reads geography"| node_geoadmin
node_compute_utils -->|"uses Earth Engine tools"| node_gee
node_antyodaya -->|"selects boundaries"| node_pipeline_admin
node_antyodaya -->|"uses output helpers"| node_pipeline_outputs
node_antyodaya -->|"uses publishing helpers"| node_pipeline_publish
node_facilities -->|"uses admin helpers"| node_pipeline_admin
node_facilities -->|"uses output helpers"| node_pipeline_outputs
node_facilities -->|"uses publishing helpers"| node_pipeline_publish
node_livestock -->|"uses admin helpers"| node_pipeline_admin
node_livestock -->|"uses output helpers"| node_pipeline_outputs
node_livestock -->|"uses publishing helpers"| node_pipeline_publish
node_water_tasks -->|"imports land cover"| node_lulc
node_water_tasks -->|"imports analysis"| node_water_compute
node_water_tasks -->|"reads projects"| node_projects
node_dpr -->|"uses plan models"| node_plans
node_moderation -->|"task references views"| node_dpr

click node_compute_api "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/views.py"
click node_plans "https://github.com/core-stack-org/core-stack-backend/blob/main/plans/reports.py"
click node_dpr "https://github.com/core-stack-org/core-stack-backend/blob/main/dpr/gen_dpr.py"
click node_moderation "https://github.com/core-stack-org/core-stack-backend/blob/main/moderation/views.py"
click node_hydrology "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/mws/generate_hydrology_local.py"
click node_lulc "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/lulc/lulc_v3.py"
click node_terrain "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/terrain_descriptor/terrain_raster.py"
click node_climate "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/drought/drought.py"
click node_tree_health "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/tree_health/gee/overall_change.py"
click node_stac "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/STAC_specs/stac_collection.py"
click node_layer_tasks "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/tasks.py"
click node_celery "https://github.com/core-stack-org/core-stack-backend/blob/main/nrm_app/celery.py"
click node_compute_utils "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/utils.py"
click node_gee "https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/gee_utils.py"
click node_geoadmin "https://github.com/core-stack-org/core-stack-backend/blob/main/geoadmin/models.py"
click node_antyodaya "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/antyodaya/pipeline.py"
click node_facilities "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/facilities/pipeline.py"
click node_livestock "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/livestocks/pipeline.py"
click node_pipeline_admin "https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/pipelines/admin.py"
click node_pipeline_outputs "https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/pipelines/outputs.py"
click node_pipeline_publish "https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/pipelines/publish.py"
click node_water_tasks "https://github.com/core-stack-org/core-stack-backend/blob/main/waterrejuvenation/tasks.py"
click node_water_compute "https://github.com/core-stack-org/core-stack-backend/blob/main/computing/water_rejuvenation/water_rejuventation.py"
click node_projects "https://github.com/core-stack-org/core-stack-backend/blob/main/projects/models.py"

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_compute_api,node_plans,node_dpr,node_moderation,node_projects toneBlue
class node_hydrology,node_lulc,node_terrain,node_climate,node_tree_health,node_stac toneAmber
class node_antyodaya,node_facilities,node_livestock,node_user toneMint
class node_water_tasks,node_water_compute toneRose
class node_layer_tasks,node_celery,node_compute_utils,node_gee,node_geoadmin,node_pipeline_admin,node_pipeline_outputs,node_pipeline_publish toneIndigo
```

## Components

### API and planning

- [Compute API](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/views.py): `computing/views.py`
- [Plans and reports](https://github.com/core-stack-org/core-stack-backend/blob/main/plans/reports.py): `plans/reports.py`
- [DPR reporting](https://github.com/core-stack-org/core-stack-backend/blob/main/dpr/gen_dpr.py): `dpr/gen_dpr.py`
- [Submission moderation](https://github.com/core-stack-org/core-stack-backend/blob/main/moderation/views.py): `moderation/views.py`
- [Project records](https://github.com/core-stack-org/core-stack-backend/blob/main/projects/models.py): `projects/models.py`

### Geospatial computing

- [Hydrology layers](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/mws/generate_hydrology_local.py): `computing/mws/generate_hydrology_local.py`
- [Land-cover layers](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/lulc/lulc_v3.py): `computing/lulc/lulc_v3.py`
- [Terrain layers](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/terrain_descriptor/terrain_raster.py): `computing/terrain_descriptor/terrain_raster.py`
- [Climate layers](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/drought/drought.py): `computing/drought/drought.py`
- [Tree health](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/tree_health/gee/overall_change.py): `computing/tree_health/gee/overall_change.py`
- [STAC collections](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/STAC_specs/stac_collection.py): `computing/STAC_specs/stac_collection.py`

### Community data

- [Antyodaya pipeline](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/antyodaya/pipeline.py): `computing/misc/antyodaya/pipeline.py`
- [Facilities pipeline](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/facilities/pipeline.py): `computing/misc/facilities/pipeline.py`
- [Livestock pipeline](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/misc/livestocks/pipeline.py): `computing/misc/livestocks/pipeline.py`

### Water rejuvenation

- [Water project tasks](https://github.com/core-stack-org/core-stack-backend/blob/main/waterrejuvenation/tasks.py): `waterrejuvenation/tasks.py`
- [Water rejuvenation analysis](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/water_rejuvenation/water_rejuventation.py): `computing/water_rejuvenation/water_rejuventation.py`

### Shared platform

- [Layer task dispatch](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/tasks.py): `computing/tasks.py`
- [Async task runtime](https://github.com/core-stack-org/core-stack-backend/blob/main/nrm_app/celery.py): `nrm_app/celery.py`
- [Layer utilities](https://github.com/core-stack-org/core-stack-backend/blob/main/computing/utils.py): `computing/utils.py`
- [Earth Engine utilities](https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/gee_utils.py): `utilities/gee_utils.py`
- [Administrative geography](https://github.com/core-stack-org/core-stack-backend/blob/main/geoadmin/models.py): `geoadmin/models.py`
- [Pipeline admin selection](https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/pipelines/admin.py): `utilities/pipelines/admin.py`
- [Pipeline outputs](https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/pipelines/outputs.py): `utilities/pipelines/outputs.py`
- [Pipeline publishing](https://github.com/core-stack-org/core-stack-backend/blob/main/utilities/pipelines/publish.py): `utilities/pipelines/publish.py`

### Other components

- **API consumer**

## Connections

- API consumer → Compute API: requests layers
- Compute API → Layer task dispatch: dispatches tasks
- Layer task dispatch → Hydrology layers: imports compute (evidence: `computing/tasks.py`)
- Layer task dispatch → Land-cover layers: runs pipelines (evidence: `computing/tasks.py`)
- Layer task dispatch → STAC collections: imports STAC task (evidence: `computing/tasks.py`)
- Layer task dispatch → Layer utilities: updates layer status (evidence: `computing/tasks.py`)
- Layer task dispatch → Async task runtime: uses task app (evidence: `computing/tasks.py`)
- Async task runtime → Layer utilities: loads logging integration (evidence: `nrm_app/celery.py`)
- STAC collections → Layer utilities: uses layer models (evidence: `computing/STAC_specs/stac_collection.py`)
- Layer utilities → Administrative geography: reads geography (evidence: `computing/utils.py`)
- Layer utilities → Earth Engine utilities: uses Earth Engine tools (evidence: `computing/utils.py`)
- Antyodaya pipeline → Pipeline admin selection: selects boundaries (evidence: `computing/misc/antyodaya/pipeline.py`)
- Antyodaya pipeline → Pipeline outputs: uses output helpers (evidence: `computing/misc/antyodaya/pipeline.py`)
- Antyodaya pipeline → Pipeline publishing: uses publishing helpers (evidence: `computing/misc/antyodaya/pipeline.py`)
- Facilities pipeline → Pipeline admin selection: uses admin helpers (evidence: `computing/misc/facilities/pipeline.py`)
- Facilities pipeline → Pipeline outputs: uses output helpers (evidence: `computing/misc/facilities/pipeline.py`)
- Facilities pipeline → Pipeline publishing: uses publishing helpers (evidence: `computing/misc/facilities/pipeline.py`)
- Livestock pipeline → Pipeline admin selection: uses admin helpers (evidence: `computing/misc/livestocks/pipeline.py`)
- Livestock pipeline → Pipeline outputs: uses output helpers (evidence: `computing/misc/livestocks/pipeline.py`)
- Livestock pipeline → Pipeline publishing: uses publishing helpers (evidence: `computing/misc/livestocks/pipeline.py`)
- Water project tasks → Land-cover layers: imports land cover (evidence: `waterrejuvenation/tasks.py`)
- Water project tasks → Water rejuvenation analysis: imports analysis (evidence: `waterrejuvenation/tasks.py`)
- Water project tasks → Project records: reads projects (evidence: `waterrejuvenation/tasks.py`)
- DPR reporting → Plans and reports: uses plan models
- Submission moderation → DPR reporting: task references views (evidence: `dpr/tasks.py`)
