# ecotrust/landmapper architecture

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

- Interactive diagram: https://gitdiagram.com/ecotrust/landmapper
- Repository: https://github.com/ecotrust/landmapper

## Overview

##### Main Components

a. Frontend Layer:
- Static assets (/landmapper/app/static/)
- Templates (/landmapper/app/templates/)
- Client-side JavaScript (map.js, report.js)
- CSS styling files
- CKEditor integration for rich text editing

b. Backend Layer:
- Django application core
- Authentication system (account management)
- Processing services
- PDF generation service
- Data processing scripts
- Survey management

c. Data Layer:
- Database (implied by Django models)
- GIS data storage
- File storage for PDFs and reports
- Backup system (/backups)

**[Client Layer]**
- ↑↓
**[Application Layer]**
- ↑↓
**[Data Layer]**

##### Component Relationships

- User authentication flow
- Data processing pipeline
- Report generation workflow
- Survey data collection
- PDF generation process

##### Key Integration Points

Highlight:
- OpenLayers map integration
- CKEditor integration
- PDF processing service
- GIS data services
- Email notification system

##### Specific Implementation Details

Specialized components:
- Layer processing (/app/map_layers/)
- Property management system
- Report generation pipeline
- Survey management system
- Backup system

##### Infrastructure Components

Deployment-related elements:
- NGINX configuration
- uWSGI service
- Cron jobs
- Static file serving

Key Workflows to Highlight:
##### Survey data collection and processing

Use standardized symbols:
- Rectangles: Services/Components
- Clouds: External services

This architecture should emphasize the application's focus on mapping and property analysis while showing how different components work together to provide woodland discovery services to landowners.

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        UI[User Interface]:::frontend
        MAP[Map Viewer]:::frontend
        EDIT[CKEditor]:::frontend
    end

    subgraph Application
        AUTH[Authentication System]:::backend
        MAP_PROC[Map Processing Service]:::backend
        PDF_GEN[PDF Generation]:::backend
        SURVEY[Survey Management]:::backend
        REPORT[Report Generation]:::backend
        DATA_PROC[Data Processing Scripts]:::backend
    end

    subgraph Data
        DB[(Database)]:::data
        GIS[(GIS Storage)]:::data
        FILES[(File Storage)]:::data
        BACKUP[(Backup System)]:::data
    end

    subgraph Infrastructure
        NGINX[NGINX Server]:::infra
        UWSGI[uWSGI Service]:::infra
        CRON[Cron Jobs]:::infra
    end

    UI --> AUTH
    UI --> MAP
    UI --> EDIT
    MAP --> MAP_PROC
    MAP_PROC --> GIS
    AUTH --> DB
    SURVEY --> DB
    REPORT --> PDF_GEN
    PDF_GEN --> FILES
    DATA_PROC --> DB
    DATA_PROC --> GIS
    DB --> BACKUP
    GIS --> BACKUP
    FILES --> BACKUP

    %% Component Mappings
    click UI "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/templates/"
    click MAP "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/static/landmapper/js/"
    click EDIT "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/static/ckeditor/"
    click AUTH "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/templates/account/"
    click MAP_PROC "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/map_layers/"
    click PDF_GEN "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/pdf_templates/"
    click SURVEY "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/templates/surveys/"
    click REPORT "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/templates/landmapper/report/"
    click DATA_PROC "https://github.com/Ecotrust/landmapper/tree/main/landmapper/app/scripts/"
    click DB "https://github.com/Ecotrust/landmapper/blob/main/landmapper/app/models.py"
    click BACKUP "https://github.com/Ecotrust/landmapper/tree/main/backups/"
    click NGINX "https://github.com/Ecotrust/landmapper/tree/main/deploy/nginx_config"
    click UWSGI "https://github.com/Ecotrust/landmapper/blob/main/deploy/uwsgi.service"
    click CRON "https://github.com/Ecotrust/landmapper/blob/main/deploy/cron_jobs.txt"

    classDef frontend fill:#3498db,stroke:#2980b9,color:white
    classDef backend fill:#2ecc71,stroke:#27ae60,color:white
    classDef data fill:#f1c40f,stroke:#f39c12,color:black
    classDef infra fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        F[Frontend]:::frontend
        B[Backend]:::backend
        D[Data Storage]:::data
        I[Infrastructure]:::infra
    end
```
