# anthony2210/polypbase architecture

> Architecture diagram of the GitHub repository anthony2210/polypbase, 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/anthony2210/polypbase
- Repository: https://github.com/anthony2210/polypbase

## Overview

Polypbase is a web application for managing jellyfish polyp cultures. Aquarium staff use its React interface to review culture and measurement data, manage boxes and their lineage, and record operational changes; requests pass through the Django API to domain services and persisted records. The product also covers accounts and organization sharing, taxonomy, alerts and action history, QR identification, and filtered measurement exports. The graph reflects README-documented capabilities and indexed source references; unsampled implementation details and some runtime wiring are not shown.

Main entry points: [`backend/config/api_urls.py`](https://github.com/anthony2210/polypbase/blob/main/backend/config/api_urls.py) (API routes), [`backend/apps/cultures/api_views.py`](https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/api_views.py) (Culture API), [`backend/apps/audit/models.py`](https://github.com/anthony2210/polypbase/blob/main/backend/apps/audit/models.py) (Alerts and history), [`backend/apps/cultures/services.py`](https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/services.py) (Culture services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interface"]
  node_react["React application<br/>[App.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
end

subgraph group_routing["API routing"]
  node_api_routes["API routes<br/>[api_urls.py]"]
end

subgraph group_culture["Culture operations"]
  node_culture_api["Culture API<br/>[api_views.py]"]
  node_culture_service["Culture services<br/>[services.py]"]
  node_culture_records[("Boxes and lineage<br/>[models.py]")]
  node_measurement_records[("Measurements and probes<br/>[models.py]")]
  node_measurement_rules["Measurement rules<br/>[services.py]"]
end

subgraph group_reference["Reference data"]
  node_taxonomy_api["Taxonomy API<br/>[api_views.py]"]
  node_taxonomy_records[("Taxonomy records<br/>[models.py]")]
  node_taxonomy_service["Taxonomy operations<br/>[services.py]"]
end

subgraph group_operations["Accounts and reporting"]
  node_account_api["Account API<br/>[api_views.py]"]
  node_account_records[("Accounts and roles<br/>[models.py]")]
  node_organization_api["Organization API<br/>[api_views.py]"]
  node_organization_records[("Organizations<br/>[models.py]")]
  node_audit_service["Audit services<br/>[services.py]"]
  node_audit_records[("Alerts and history<br/>[models.py]")]
  node_export_views["Export endpoints<br/>[views.py]"]
  node_export_service["Export generation<br/>[services.py]"]
  node_export_records[("Export records<br/>[models.py]")]
end

node_staff(("Aquarium staff"))

node_staff -->|"uses"| node_react
node_react -->|"requests through"| node_api_client
node_api_client -->|"calls API"| node_api_routes
node_api_routes -->|"routes requests"| node_culture_api
node_api_routes -->|"routes requests"| node_account_api
node_api_routes -->|"routes requests"| node_organization_api
node_api_routes -->|"routes requests"| node_taxonomy_api
node_api_routes -->|"routes requests"| node_export_views
node_culture_api -->|"uses"| node_culture_service
node_culture_api -->|"reads and writes"| node_culture_records
node_culture_service -->|"updates"| node_culture_records
node_culture_api -->|"checks editability"| node_measurement_rules
node_culture_api -->|"uses measurements"| node_measurement_records
node_culture_service -->|"records actions"| node_audit_records
node_taxonomy_api -->|"uses"| node_taxonomy_service
node_taxonomy_api -->|"reads and writes"| node_taxonomy_records
node_taxonomy_service -->|"creates identities"| node_taxonomy_records
node_account_api -->|"reads and writes"| node_account_records
node_account_api -->|"records actions"| node_audit_records
node_organization_api -->|"reads and writes"| node_organization_records
node_organization_api -->|"records actions"| node_audit_records
node_audit_service -->|"queries history"| node_audit_records
node_audit_service -->|"resolves measurement links"| node_measurement_records
node_export_views -->|"builds exports"| node_export_service
node_export_views -->|"uses export records"| node_export_records
node_export_service -->|"selects boxes"| node_culture_records
node_export_service -->|"reads measurements"| node_measurement_records

click node_react "https://github.com/anthony2210/polypbase/blob/main/frontend/src/App.tsx"
click node_api_client "https://github.com/anthony2210/polypbase/blob/main/frontend/src/api/client.ts"
click node_api_routes "https://github.com/anthony2210/polypbase/blob/main/backend/config/api_urls.py"
click node_culture_api "https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/api_views.py"
click node_culture_service "https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/services.py"
click node_culture_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/models.py"
click node_measurement_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/measurements/models.py"
click node_measurement_rules "https://github.com/anthony2210/polypbase/blob/main/backend/apps/measurements/services.py"
click node_taxonomy_api "https://github.com/anthony2210/polypbase/blob/main/backend/apps/taxonomy/api_views.py"
click node_taxonomy_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/taxonomy/models.py"
click node_taxonomy_service "https://github.com/anthony2210/polypbase/blob/main/backend/apps/taxonomy/services.py"
click node_account_api "https://github.com/anthony2210/polypbase/blob/main/backend/apps/accounts/api_views.py"
click node_account_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/accounts/models.py"
click node_organization_api "https://github.com/anthony2210/polypbase/blob/main/backend/apps/organizations/api_views.py"
click node_organization_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/organizations/models.py"
click node_audit_service "https://github.com/anthony2210/polypbase/blob/main/backend/apps/audit/services.py"
click node_audit_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/audit/models.py"
click node_export_views "https://github.com/anthony2210/polypbase/blob/main/backend/apps/exports/views.py"
click node_export_service "https://github.com/anthony2210/polypbase/blob/main/backend/apps/exports/services.py"
click node_export_records "https://github.com/anthony2210/polypbase/blob/main/backend/apps/exports/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_react,node_api_client toneBlue
class node_api_routes toneAmber
class node_culture_api,node_culture_service,node_culture_records,node_measurement_records,node_measurement_rules toneMint
class node_taxonomy_api,node_taxonomy_records,node_taxonomy_service toneRose
class node_account_api,node_account_records,node_organization_api,node_organization_records,node_audit_service,node_audit_records,node_export_views,node_export_service,node_export_records,node_staff toneIndigo
```

## Components

### User interface

- [React application](https://github.com/anthony2210/polypbase/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [API client](https://github.com/anthony2210/polypbase/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`

### API routing

- [API routes](https://github.com/anthony2210/polypbase/blob/main/backend/config/api_urls.py): `backend/config/api_urls.py`

### Culture operations

- [Culture API](https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/api_views.py): `backend/apps/cultures/api_views.py`
- [Culture services](https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/services.py): `backend/apps/cultures/services.py`
- [Boxes and lineage](https://github.com/anthony2210/polypbase/blob/main/backend/apps/cultures/models.py): `backend/apps/cultures/models.py`
- [Measurements and probes](https://github.com/anthony2210/polypbase/blob/main/backend/apps/measurements/models.py): `backend/apps/measurements/models.py`
- [Measurement rules](https://github.com/anthony2210/polypbase/blob/main/backend/apps/measurements/services.py): `backend/apps/measurements/services.py`

### Reference data

- [Taxonomy API](https://github.com/anthony2210/polypbase/blob/main/backend/apps/taxonomy/api_views.py): `backend/apps/taxonomy/api_views.py`
- [Taxonomy records](https://github.com/anthony2210/polypbase/blob/main/backend/apps/taxonomy/models.py): `backend/apps/taxonomy/models.py`
- [Taxonomy operations](https://github.com/anthony2210/polypbase/blob/main/backend/apps/taxonomy/services.py): `backend/apps/taxonomy/services.py`

### Accounts and reporting

- [Account API](https://github.com/anthony2210/polypbase/blob/main/backend/apps/accounts/api_views.py): `backend/apps/accounts/api_views.py`
- [Accounts and roles](https://github.com/anthony2210/polypbase/blob/main/backend/apps/accounts/models.py): `backend/apps/accounts/models.py`
- [Organization API](https://github.com/anthony2210/polypbase/blob/main/backend/apps/organizations/api_views.py): `backend/apps/organizations/api_views.py`
- [Organizations](https://github.com/anthony2210/polypbase/blob/main/backend/apps/organizations/models.py): `backend/apps/organizations/models.py`
- [Audit services](https://github.com/anthony2210/polypbase/blob/main/backend/apps/audit/services.py): `backend/apps/audit/services.py`
- [Alerts and history](https://github.com/anthony2210/polypbase/blob/main/backend/apps/audit/models.py): `backend/apps/audit/models.py`
- [Export endpoints](https://github.com/anthony2210/polypbase/blob/main/backend/apps/exports/views.py): `backend/apps/exports/views.py`
- [Export generation](https://github.com/anthony2210/polypbase/blob/main/backend/apps/exports/services.py): `backend/apps/exports/services.py`
- [Export records](https://github.com/anthony2210/polypbase/blob/main/backend/apps/exports/models.py): `backend/apps/exports/models.py`

### Other components

- **Aquarium staff**

## Connections

- Aquarium staff → React application: uses (evidence: `README.md`)
- React application → API client: requests through (evidence: `frontend/src/App.tsx`)
- API client → API routes: calls API (evidence: `README.md`)
- API routes → Culture API: routes requests (evidence: `backend/config/api_urls.py`)
- API routes → Account API: routes requests (evidence: `backend/config/api_urls.py`)
- API routes → Organization API: routes requests (evidence: `backend/config/api_urls.py`)
- API routes → Taxonomy API: routes requests (evidence: `backend/config/api_urls.py`)
- API routes → Export endpoints: routes requests (evidence: `backend/config/api_urls.py`)
- Culture API → Culture services: uses (evidence: `backend/apps/cultures/api_views.py`)
- Culture API → Boxes and lineage: reads and writes (evidence: `backend/apps/cultures/api_views.py`)
- Culture services → Boxes and lineage: updates (evidence: `backend/apps/cultures/services.py`)
- Culture API → Measurement rules: checks editability (evidence: `backend/apps/cultures/api_views.py`)
- Culture API → Measurements and probes: uses measurements (evidence: `backend/apps/cultures/api_views.py`)
- Culture services → Alerts and history: records actions (evidence: `backend/apps/cultures/services.py`)
- Taxonomy API → Taxonomy operations: uses (evidence: `backend/apps/taxonomy/api_views.py`)
- Taxonomy API → Taxonomy records: reads and writes (evidence: `backend/apps/taxonomy/api_views.py`)
- Taxonomy operations → Taxonomy records: creates identities (evidence: `backend/apps/taxonomy/services.py`)
- Account API → Accounts and roles: reads and writes (evidence: `backend/apps/accounts/api_views.py`)
- Account API → Alerts and history: records actions (evidence: `backend/apps/accounts/api_views.py`)
- Organization API → Organizations: reads and writes (evidence: `backend/apps/organizations/api_views.py`)
- Organization API → Alerts and history: records actions (evidence: `backend/apps/organizations/api_views.py`)
- Audit services → Alerts and history: queries history (evidence: `backend/apps/audit/services.py`)
- Audit services → Measurements and probes: resolves measurement links (evidence: `backend/apps/audit/services.py`)
- Export endpoints → Export generation: builds exports (evidence: `backend/apps/exports/views.py`)
- Export endpoints → Export records: uses export records (evidence: `backend/apps/exports/views.py`)
- Export generation → Boxes and lineage: selects boxes (evidence: `backend/apps/exports/services.py`)
- Export generation → Measurements and probes: reads measurements (evidence: `backend/apps/exports/services.py`)
