# opendronemap/webodm architecture

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

- Interactive diagram: https://gitdiagram.com/opendronemap/webodm
- Repository: https://github.com/opendronemap/webodm

## Overview

##### Project Type and Purpose
- WebODM is a full-stack application for drone image processing. It acts as a high-level user interface on top of a set of processing engines (like ODM and NodeODM), handling tasks such as georeferencing images, building point clouds, generating 3D models, and managing projects.
- The README confirms that it is “user-friendly, commercial grade software” that orchestrates processing nodes via its API and web interface. It also supports additional processing engines (e.g., MicMac) and integrates with plugins.

##### File Structure
- Notice top-level directories such as “app”, “nodeodm”, “coreplugins”, “db”, “docker-compose” files, and “worker”. These indicate multiple main components:
- “app” contains the Django application code, API endpoints (in app/api), static assets (React/JS components in app/static/app/js), templates, and models.
- “nodeodm” includes code for the processing node that communicates with the Django backend.
- “worker” holds code for background tasks and Celery workers.
- “coreplugins” shows that the system is extensible via plugins that add extra functionality.
- Dockerfiles, docker-compose.yml files, and service scripts indicate containerized deployment and orchestration.
- Configuration and management files (e.g., Dockerfile, docker-compose.*.yml, nginx configuration) reveal that the project is designed to be deployed in a containerized environment, with separate containers for the Django app, database, Celery worker, and processing nodes.

a. Main Components:
- Web Client/UI – The front-end user interface (likely built using React, HTML/SCSS templates, and served via Django) that the end user interacts with.
- Web Server/Backend – The Django application handling requests, routing (app/urls.py), API endpoints (app/api/*), user authentication, and session management.
- Database – Postgres (with PostGIS extensions) used for storing projects, settings, and user data.
- Celery Worker – Background task workers (located in the “worker” directory) that handle asynchronous processing tasks (image resizing, data processing).
- Processing Nodes – External processing units (e.g., NodeODM, NodeMICMAC) that actually run the heavy lifting for image processing. They interact with the WebODM backend via a REST API.
- Plugin Framework – The “coreplugins” directory holds various plugins which extend the core functionality (for example, adding custom APIs or UI modules).
- External Services – Optional integration with containerized services (like Redis for task queues, nginx as reverse proxy, and potentially external cloud-based processing nodes).

b. Relationships and Data Flow:
- A user’s browser sends requests to the WebODM web server (Django) via HTTP/HTTPS.
- The backend communicates with the database for persistent data.
- When a processing job is initiated via the UI, the Django app creates a background task which is executed by a Celery worker.
- The Celery worker coordinates with external processing nodes (e.g., NodeODM) through dedicated REST API calls to process the drone image datasets.
- Processed outputs (georeferenced images, 3D models, etc.) are stored in volumes and synchronized with the application.
- Optional plugins may intercept requests or extend functionality, and are represented as modular components within the overall architecture.
- Docker and container orchestration are used to deploy each component in isolation (e.g., separate containers for web, database, worker).

##### Important Architectural Patterns and Technologies
- Microservices and Containerization: Use of Docker and multiple services (NodeODM processing nodes, Celery workers, database container) should be emphasized.
- Asynchronous Processing: Celery is used to offload resource-intensive tasks, so include queues and the messaging system (with Redis, if applicable).
- Extensibility via Plugins: Highlight the “coreplugins” module as a dynamic add-on system.

- Clear labels for each component (e.g., “Django Backend”, “Celery Worker”, “NodeODM Processing Node”, “Postgres Database”, “Web Client / UI”, “Plugin Module”).
– Frontend (browser/user interface)
– Backend (Django app, API)
– Data store (Postgres/PostGIS)
– Asynchronous processing (Celery and queues)
– External processing nodes (e.g., NodeODM, MicMac)
– Extensibility layers (plugins)
- Optionally, overlay the containerization aspect to illustrate how multiple Docker containers collaborate.

##### Additional Advice
- For each container, note any configuration or orchestration mechanism (like Docker Compose) that determines how services are networked.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["User Browser"]:::external
    B["Reverse Proxy (nginx)"]:::external
    C["Django Backend"]:::backend
    D["Postgres Database"]:::database
    E["Celery Worker"]:::async
    F["Processing Node (NodeODM)"]:::async
    G["Plugin Framework"]:::backend
    subgraph "Web Client / UI"
        I["Static Assets"]:::frontend
        J["HTML Templates"]:::frontend
    end
    K["Containerization & Orchestration"]:::container

    A -->|"HTTP_Request"| B
    B -->|"Forward_Request"| C
    C -->|"Serves_UI"| I
    C -->|"Serves_UI"| J
    I -->|"Rendered_to"| A
    J -->|"Rendered_to"| A
    C -->|"Queries"| D
    C -->|"Triggers"| E
    C -->|"Extends"| G
    E -->|"Sends_Task"| F

    K -->|"Deploys"| B
    K -->|"Deploys"| C
    K -->|"Deploys"| D
    K -->|"Deploys"| E
    K -->|"Deploys"| F
    K -->|"Deploys"| G

    click I "https://github.com/opendronemap/webodm/tree/master/app/static/app"
    click J "https://github.com/opendronemap/webodm/tree/master/app/templates/app"
    click C "https://github.com/opendronemap/webodm/tree/master/app/"
    click D "https://github.com/opendronemap/webodm/tree/master/db/"
    click E "https://github.com/opendronemap/webodm/tree/master/worker/"
    click F "https://github.com/opendronemap/webodm/tree/master/nodeodm/"
    click G "https://github.com/opendronemap/webodm/tree/master/coreplugins/"
    click B "https://github.com/opendronemap/webodm/tree/master/nginx/"
    click K "https://github.com/opendronemap/webodm/blob/master/docker-compose.yml"

    classDef external fill:#f3e5f5,stroke:#ce93d8,stroke-width:2px;
    classDef backend fill:#f1f8e9,stroke:#aed581,stroke-width:2px;
    classDef database fill:#fff3e0,stroke:#ffb74d,stroke-width:2px;
    classDef async fill:#fce4ec,stroke:#f06292,stroke-width:2px;
    classDef frontend fill:#e3f2fd,stroke:#90caf9,stroke-width:2px;
    classDef container fill:#e0f7fa,stroke:#4dd0e1,stroke-width:2px;
```
