# ecdysisfoundation/bugbox_open architecture

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

- Interactive diagram: https://gitdiagram.com/ecdysisfoundation/bugbox_open
- Repository: https://github.com/ecdysisfoundation/bugbox_open

## Overview

Bugbox3 is a Django application for ecological sample management and grower-facing farm programs. Growers submit applications and field measurements; administrators review them and can ingest survey files, generate labels, and manage results. Separate taxonomy and microbiome features support specimen classification and ecological data workflows. The README documents organization-scoped access, hybrid cloud/local deployment, an inference service, and a panorama stitcher. Several branches are represented by their exact directories because their implementation was not excerpted; links are limited to shown references or README documentation.

Main entry points: [`bugbox3/grower_portal/views/grower`](https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/grower_portal/views/grower) (Grower workflow), [`bugbox3/grower_portal/views/admin`](https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/grower_portal/views/admin) (Admin workflows), [`bugbox3/grower_portal/views/admin/data_ingestion.py`](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/views/admin/data_ingestion.py) (Ingestion hub), [`bugbox3/grower_portal/services/data_ingestion.py`](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/services/data_ingestion.py) (Import processing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_grower["Grower Portal"]
  node_grower["Grower workflow"]
  node_grower_forms["Application forms<br/>[forms.py]"]
  node_measurements["Measurement capture"]
  node_applications[("Applications and farms<br/>[application.py]")]
  node_farm_models[("Farm records<br/>[farm.py]")]
  node_grower_admin["Admin workflows"]
end

subgraph group_ingestion["Data Operations"]
  node_ingestion_ui["Ingestion hub<br/>[data_ingestion.py]"]
  node_ingestion_form["Upload validation"]
  node_ingestion_service["Import processing<br/>[data_ingestion.py]"]
  node_import_records[("Import records<br/>[csv_import.py]")]
  node_sample_codes[("Sample codes<br/>[sample_codes.py]")]
  node_labels["Label generation<br/>[label_generator.py]"]
end

subgraph group_ecology["Ecological Data"]
  node_taxonomy["Taxonomy"]
  node_classification["AI classification task<br/>[tasks.py]"]
  node_specimens[("Specimen records<br/>[models.py]")]
  node_microbiome["Microbiome workflows"]
  node_stitcher["Panorama stitching<br/>[stitcher_api.py]"]
  node_stitcher_service{{"Stitcher service"}}
  node_inference_service{{"Inference service"}}
end

subgraph group_platform["Platform Services"]
  node_permissions["Access control<br/>[permissions.py]"]
  node_storage["Media storage<br/>[customstorage.py]"]
  node_users[("Users and organizations<br/>[models.py]")]
  node_celery["Background tasks<br/>[celery_app.py]"]
end

node_grower_actor(("Grower"))
node_admin_actor(("Administrator"))

node_grower_actor -->|"submits application"| node_grower
node_grower -->|"uses forms"| node_grower_forms
node_grower -->|"creates and reads"| node_applications
node_grower -->|"assigns measurements"| node_measurements
node_grower -->|"creates field"| node_farm_models
node_grower -->|"checks access"| node_permissions
node_admin_actor -->|"manages applications"| node_grower_admin
node_grower_admin -->|"checks access"| node_permissions
node_grower_admin -->|"reads records"| node_applications
node_admin_actor -->|"uploads data"| node_ingestion_ui
node_ingestion_ui -->|"validates upload"| node_ingestion_form
node_ingestion_ui -->|"builds storage path"| node_ingestion_service
node_ingestion_ui -->|"creates import log"| node_import_records
node_ingestion_service -->|"writes import rows"| node_import_records
node_ingestion_service -->|"resolves sample codes"| node_sample_codes
node_grower_admin -.->|"manages labels"| node_labels
node_classification -->|"requests predictions"| node_inference_service
node_classification -->|"updates classification"| node_specimens
node_taxonomy -.->|"classifies specimens"| node_specimens
node_microbiome -->|"runs background tasks"| node_celery
node_stitcher -->|"requests panoramas"| node_stitcher_service
node_storage -.->|"stores media"| node_inference_service
node_users -.->|"organization-scoped access"| node_grower

click node_grower "https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/grower_portal/views/grower"
click node_grower_forms "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/forms/grower/forms.py"
click node_measurements "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/measurement_capture.py"
click node_applications "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/application.py"
click node_farm_models "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/farm.py"
click node_grower_admin "https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/grower_portal/views/admin"
click node_permissions "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/permissions.py"
click node_ingestion_ui "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/views/admin/data_ingestion.py"
click node_ingestion_form "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/forms/admin/data_ingestion_form.py"
click node_ingestion_service "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/services/data_ingestion.py"
click node_import_records "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/csv_import.py"
click node_sample_codes "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/sample_codes.py"
click node_labels "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/services/label_generator.py"
click node_taxonomy "https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/taxonomy"
click node_classification "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/taxonomy/tasks.py"
click node_specimens "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/models.py"
click node_microbiome "https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/microbiome"
click node_stitcher "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/stitcher_api.py"
click node_storage "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/customstorage.py"
click node_users "https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/users/models.py"
click node_celery "https://github.com/ecdysisfoundation/bugbox_open/blob/main/config/celery_app.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_grower,node_grower_forms,node_measurements,node_applications,node_farm_models,node_grower_admin toneBlue
class node_ingestion_ui,node_ingestion_form,node_ingestion_service,node_import_records,node_sample_codes,node_labels toneAmber
class node_taxonomy,node_classification,node_specimens,node_microbiome,node_stitcher,node_stitcher_service,node_inference_service toneMint
class node_permissions,node_storage,node_users,node_celery toneRose
class node_grower_actor,node_admin_actor toneIndigo
```

## Components

### Grower Portal

- [Grower workflow](https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/grower_portal/views/grower): `bugbox3/grower_portal/views/grower`
- [Application forms](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/forms/grower/forms.py): `bugbox3/grower_portal/forms/grower/forms.py`
- [Measurement capture](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/measurement_capture.py): `bugbox3/grower_portal/measurement_capture.py`
- [Applications and farms](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/application.py): `bugbox3/grower_portal/models/application.py`
- [Farm records](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/farm.py): `bugbox3/grower_portal/models/farm.py`
- [Admin workflows](https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/grower_portal/views/admin): `bugbox3/grower_portal/views/admin`

### Data Operations

- [Ingestion hub](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/views/admin/data_ingestion.py): `bugbox3/grower_portal/views/admin/data_ingestion.py`
- [Upload validation](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/forms/admin/data_ingestion_form.py): `bugbox3/grower_portal/forms/admin/data_ingestion_form.py`
- [Import processing](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/services/data_ingestion.py): `bugbox3/grower_portal/services/data_ingestion.py`
- [Import records](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/csv_import.py): `bugbox3/grower_portal/models/csv_import.py`
- [Sample codes](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/models/sample_codes.py): `bugbox3/grower_portal/models/sample_codes.py`
- [Label generation](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/grower_portal/services/label_generator.py): `bugbox3/grower_portal/services/label_generator.py`

### Ecological Data

- [Taxonomy](https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/taxonomy): `bugbox3/taxonomy`
- [AI classification task](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/taxonomy/tasks.py): `bugbox3/taxonomy/tasks.py`
- [Specimen records](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/models.py): `bugbox3/core/models.py`
- [Microbiome workflows](https://github.com/ecdysisfoundation/bugbox_open/tree/main/bugbox3/microbiome): `bugbox3/microbiome`
- [Panorama stitching](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/stitcher_api.py): `bugbox3/core/stitcher_api.py`
- **Stitcher service**
- **Inference service**

### Platform Services

- [Access control](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/permissions.py): `bugbox3/core/permissions.py`
- [Media storage](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/core/customstorage.py): `bugbox3/core/customstorage.py`
- [Users and organizations](https://github.com/ecdysisfoundation/bugbox_open/blob/main/bugbox3/users/models.py): `bugbox3/users/models.py`
- [Background tasks](https://github.com/ecdysisfoundation/bugbox_open/blob/main/config/celery_app.py): `config/celery_app.py`

### Other components

- **Grower**
- **Administrator**

## Connections

- Grower → Grower workflow: submits application (evidence: `bugbox3/grower_portal/views/grower/application.py`)
- Grower workflow → Application forms: uses forms (evidence: `bugbox3/grower_portal/views/grower/application.py`)
- Grower workflow → Applications and farms: creates and reads (evidence: `bugbox3/grower_portal/views/grower/application.py`)
- Grower workflow → Measurement capture: assigns measurements (evidence: `bugbox3/grower_portal/views/grower/application.py`)
- Grower workflow → Farm records: creates field (evidence: `bugbox3/grower_portal/views/grower/application.py`)
- Grower workflow → Access control: checks access (evidence: `bugbox3/grower_portal/views/grower/application.py`)
- Administrator → Admin workflows: manages applications (evidence: `bugbox3/grower_portal/views/admin/applications.py`)
- Admin workflows → Access control: checks access (evidence: `bugbox3/grower_portal/views/admin/applications.py`)
- Admin workflows → Applications and farms: reads records (evidence: `bugbox3/grower_portal/views/admin/applications.py`)
- Administrator → Ingestion hub: uploads data (evidence: `bugbox3/grower_portal/views/admin/data_ingestion.py`)
- Ingestion hub → Upload validation: validates upload (evidence: `bugbox3/grower_portal/views/admin/data_ingestion.py`)
- Ingestion hub → Import processing: builds storage path (evidence: `bugbox3/grower_portal/views/admin/data_ingestion.py`)
- Ingestion hub → Import records: creates import log (evidence: `bugbox3/grower_portal/views/admin/data_ingestion.py`)
- Import processing → Import records: writes import rows (evidence: `bugbox3/grower_portal/services/data_ingestion.py`)
- Import processing → Sample codes: resolves sample codes (evidence: `bugbox3/grower_portal/services/data_ingestion.py`)
- Admin workflows → Label generation: manages labels
- AI classification task → Inference service: requests predictions (evidence: `bugbox3/taxonomy/tasks.py`)
- AI classification task → Specimen records: updates classification (evidence: `bugbox3/taxonomy/tasks.py`)
- Taxonomy → Specimen records: classifies specimens (evidence: `bugbox3/taxonomy/tasks.py`)
- Microbiome workflows → Background tasks: runs background tasks (evidence: `bugbox3/microbiome/tasks.py`)
- Panorama stitching → Stitcher service: requests panoramas
- Media storage → Inference service: stores media
- Users and organizations → Grower workflow: organization-scoped access
