# stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species architecture

> Architecture diagram of the GitHub repository stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species
- Repository: https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species

## Overview

This is a plant-conservation and biodiversity system with web and mobile clients, a Node API, and PostgreSQL. A central workflow is field users discovering plant records or submitting observations, followed by conservation staff reviewing submissions and maintaining records and species information. The README documents the clients’ dependence on the API and PostgreSQL; the server excerpt shows route modules being mounted, including IoT monitoring. The graph also preserves authentication, QR, and species-photo capabilities. Some subsystem paths are directory-level because their implementation files were not sampled; historical AI and hardware prototypes are excluded.

Main entry points: [`plant-conservation-backend/server.js`](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/server.js) (Plant API server), [`web/src`](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/tree/main/web/src) (Web application), [`mobileapp/screens`](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/tree/main/mobileapp/screens) (Mobile application), [`web/server/auth.mjs`](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/auth.mjs) (Web authentication server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_clients["User applications"]
  node_webapp["Web application"]
  node_mobileapp["Mobile application"]
  node_plant_api_client["Mobile API client<br/>[plantApi.js]"]
  node_web_auth_client["Web auth client<br/>[auth.ts]"]
end

subgraph group_api["Plant API"]
  node_plant_api["Plant API server<br/>[server.js]"]
  node_plant_domain["Plant domain logic<br/>[domain.cjs]"]
end

subgraph group_workflow["Conservation workflows"]
  node_catalog["Plant and species catalog<br/>[plant-detail.cjs]"]
  node_submissions["Plant submissions"]
  node_review["Observation review"]
  node_species_requests["Species requests"]
  node_record_changes["Record change history<br/>[record-changes.cjs]"]
  node_species_photos["Species photo management"]
  node_qr["QR plant access<br/>[qr-plant-mode.cjs]"]
  node_notifications["Staff notifications"]
  node_iot["IoT monitoring<br/>[iot.cjs]"]
end

subgraph group_identity["Identity and access"]
  node_web_auth["Web authentication server<br/>[auth.mjs]"]
  node_face_service["Face service<br/>[face-service.mjs]"]
  node_face_backend["Mobile face authentication<br/>[server.py]"]
end

subgraph group_state["Persistence and monitoring"]
  node_database[("Plant PostgreSQL<br/>[database.cjs]")]
  node_web_postgres[("Web PostgreSQL access<br/>[postgres.mjs]")]
end

node_people(("Field users and staff"))

node_people -->|"use"| node_webapp
node_people -->|"use"| node_mobileapp
node_webapp -.->|"request API"| node_plant_api
node_mobileapp -->|"submit requests"| node_plant_api_client
node_plant_api_client -.->|"call API"| node_plant_api
node_webapp -->|"check session"| node_web_auth_client
node_web_auth_client -.->|"authenticate"| node_web_auth
node_web_auth -->|"query accounts"| node_web_postgres
node_web_auth -->|"use face service"| node_face_service
node_mobileapp -.->|"face login"| node_face_backend
node_plant_api -->|"use domain"| node_plant_domain
node_plant_api -->|"mount routes"| node_catalog
node_plant_api -->|"mount routes"| node_submissions
node_plant_api -->|"mount routes"| node_review
node_plant_api -->|"mount routes"| node_species_requests
node_plant_api -->|"mount routes"| node_record_changes
node_plant_api -->|"mount routes"| node_species_photos
node_plant_api -->|"mount routes"| node_qr
node_plant_api -->|"mount routes"| node_notifications
node_plant_api -->|"mount routes"| node_iot
node_plant_api -->|"connect pool"| node_database
node_people -.->|"monitor environment"| node_iot
node_webapp -.->|"load public knowledge"| node_web_postgres
node_plant_api -->|"load auth config"| node_web_postgres
node_webapp -.->|"browse records"| node_catalog
node_people -.->|"submit observations"| node_submissions
node_people -.->|"review submissions"| node_review

click node_webapp "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/tree/main/web/src"
click node_mobileapp "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/tree/main/mobileapp/screens"
click node_web_auth "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/auth.mjs"
click node_face_service "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/face-service.mjs"
click node_plant_api "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/server.js"
click node_plant_domain "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/domain.cjs"
click node_plant_api_client "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/mobileapp/utils/plantApi.js"
click node_web_auth_client "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/src/services/auth.ts"
click node_catalog "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/plant-detail.cjs"
click node_submissions "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/plant-submissions.cjs"
click node_review "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/observation-queue.cjs"
click node_species_requests "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/species-requests.cjs"
click node_record_changes "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/record-changes.cjs"
click node_species_photos "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/species-photo-library.cjs"
click node_qr "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/qr-plant-mode.cjs"
click node_notifications "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/staff-notifications.cjs"
click node_iot "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/iot.cjs"
click node_database "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/database.cjs"
click node_web_postgres "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/postgres.mjs"
click node_face_backend "https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/mobileapp/face_backend/server.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_webapp,node_mobileapp,node_plant_api_client,node_web_auth_client,node_people toneBlue
class node_plant_api,node_plant_domain toneAmber
class node_catalog,node_submissions,node_review,node_species_requests,node_record_changes,node_species_photos,node_qr,node_notifications,node_iot toneMint
class node_web_auth,node_face_service,node_face_backend toneRose
class node_database,node_web_postgres toneIndigo
```

## Components

### User applications

- [Web application](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/tree/main/web/src): `web/src`
- [Mobile application](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/tree/main/mobileapp/screens): `mobileapp/screens`
- [Mobile API client](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/mobileapp/utils/plantApi.js): `mobileapp/utils/plantApi.js`
- [Web auth client](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/src/services/auth.ts): `web/src/services/auth.ts`

### Plant API

- [Plant API server](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/server.js): `plant-conservation-backend/server.js`
- [Plant domain logic](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/domain.cjs): `plant-conservation-backend/domain.cjs`

### Conservation workflows

- [Plant and species catalog](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/plant-detail.cjs): `plant-conservation-backend/plant-detail.cjs`
- [Plant submissions](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/plant-submissions.cjs): `plant-conservation-backend/plant-submissions.cjs`
- [Observation review](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/observation-queue.cjs): `plant-conservation-backend/observation-queue.cjs`
- [Species requests](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/species-requests.cjs): `plant-conservation-backend/species-requests.cjs`
- [Record change history](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/record-changes.cjs): `plant-conservation-backend/record-changes.cjs`
- [Species photo management](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/species-photo-library.cjs): `plant-conservation-backend/species-photo-library.cjs`
- [QR plant access](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/qr-plant-mode.cjs): `plant-conservation-backend/qr-plant-mode.cjs`
- [Staff notifications](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/staff-notifications.cjs): `plant-conservation-backend/staff-notifications.cjs`
- [IoT monitoring](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/iot.cjs): `plant-conservation-backend/iot.cjs`

### Identity and access

- [Web authentication server](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/auth.mjs): `web/server/auth.mjs`
- [Face service](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/face-service.mjs): `web/server/face-service.mjs`
- [Mobile face authentication](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/mobileapp/face_backend/server.py): `mobileapp/face_backend/server.py`

### Persistence and monitoring

- [Plant PostgreSQL](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/plant-conservation-backend/database.cjs): `plant-conservation-backend/database.cjs`
- [Web PostgreSQL access](https://github.com/stan0719/smart-ground-truthing-and-digital-biodiversity-system-for-plant-species/blob/main/web/server/postgres.mjs): `web/server/postgres.mjs`

### Other components

- **Field users and staff**

## Connections

- Field users and staff → Web application: use (evidence: `README.md`)
- Field users and staff → Mobile application: use (evidence: `README.md`)
- Web application → Plant API server: request API (evidence: `README.md`)
- Mobile application → Mobile API client: submit requests (evidence: `mobileapp/screens/RecordChangeReview.js`)
- Mobile API client → Plant API server: call API (evidence: `README.md`)
- Web application → Web auth client: check session (evidence: `web/src/App.vue`)
- Web auth client → Web authentication server: authenticate (evidence: `README.md`)
- Web authentication server → Web PostgreSQL access: query accounts (evidence: `web/server/auth.mjs`)
- Web authentication server → Face service: use face service (evidence: `web/server/face-service.mjs`)
- Mobile application → Mobile face authentication: face login
- Plant API server → Plant domain logic: use domain (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Plant and species catalog: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Plant submissions: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Observation review: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Species requests: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Record change history: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Species photo management: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → QR plant access: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Staff notifications: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → IoT monitoring: mount routes (evidence: `plant-conservation-backend/server.js`)
- Plant API server → Plant PostgreSQL: connect pool (evidence: `plant-conservation-backend/server.js`)
- Field users and staff → IoT monitoring: monitor environment
- Web application → Web PostgreSQL access: load public knowledge (evidence: `web/src/App.vue`)
- Plant API server → Web PostgreSQL access: load auth config (evidence: `plant-conservation-backend/server.js`)
- Web application → Plant and species catalog: browse records (evidence: `README.md`)
- Field users and staff → Plant submissions: submit observations (evidence: `README.md`)
- Field users and staff → Observation review: review submissions (evidence: `README.md`)
