# exertion-solutions/estudios-de-impacto-ambiental architecture

> Architecture diagram of the GitHub repository exertion-solutions/estudios-de-impacto-ambiental, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/exertion-solutions/estudios-de-impacto-ambiental
- Repository: https://github.com/exertion-solutions/estudios-de-impacto-ambiental

## Overview

eia-app is an internal environmental-reporting system. Consultants authenticate, manage clients and projects, enter project scope and field data (including offline surveys, layers and GPS), run quality control, complete report content, and generate reports; an administrator approves the final version and package. The web app uses Supabase, while a separate worker polls and processes queued layer, GPS, figure and document jobs. The README documents the full product workflow; sampled source confirms worker dispatch and several processing dependencies, but not every web-to-data interaction.

Main entry points: [`apps/worker/app/jobs/poller.py`](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/poller.py) (Job poller), [`apps/worker/app/jobs/docs.py`](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/docs.py) (Document build), [`apps/worker/app/jobs/layers.py`](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/layers.py) (Layer processing), [`apps/web/src/app/(auth)`](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/tree/main/apps/web/src/app/(auth)) (Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_auth["Authentication"]
  node_client_mgmt["Client management<br/>[page.tsx]"]
  node_project_mgmt["Project management<br/>[page.tsx]"]
  node_offline_cache[("Auth offline cache<br/>[offline-cache.ts]")]
  node_offline_db[("Offline database<br/>[db.ts]")]
end

subgraph group_field["Project workflow"]
  node_scope["Project scope<br/>[alcance.tsx]"]
  node_survey["Field survey<br/>[relevamiento.tsx]"]
  node_offline[("Offline data<br/>[repo.ts]")]
  node_geo_inputs["Layers and GPS<br/>[layers.ts]"]
  node_quality["Quality control<br/>[control.tsx]"]
  node_content["Report content<br/>[impactos.tsx]"]
  node_report_ui["Report review<br/>[informe.tsx]"]
  node_impact_matrix["Impact matrix<br/>[matriz.py]"]
end

subgraph group_worker["Worker processing"]
  node_worker_api["Worker service<br/>[main.py]"]
  node_poller["Job poller<br/>[poller.py]"]
  node_layer_job["Layer processing<br/>[layers.py]"]
  node_crs["CRS utilities<br/>[crs.py]"]
  node_gps_job["GPS processing<br/>[gps.py]"]
  node_figure_job["Map figures<br/>[figures.py]"]
end

subgraph group_report["Report generation"]
  node_doc_job["Document build<br/>[docs.py]"]
  node_sections["Report sections<br/>[report_sections.py]"]
  node_text_templates["Text templates<br/>[text_template.py]"]
  node_geo_format["Coordinate formatting<br/>[geo.py]"]
end

node_consultant(("Consultant"))
node_admin(("Administrator"))
node_supabase[("Supabase")]

node_consultant -->|"signs in"| node_auth
node_admin -->|"signs in"| node_auth
node_consultant -.->|"manages clients"| node_client_mgmt
node_consultant -.->|"manages projects"| node_project_mgmt
node_consultant -->|"defines scope"| node_scope
node_consultant -->|"records field data"| node_survey
node_survey -.->|"stores offline"| node_offline
node_consultant -->|"imports layers and GPS"| node_geo_inputs
node_consultant -->|"checks quality"| node_quality
node_consultant -->|"completes content"| node_content
node_consultant -->|"requests report"| node_report_ui
node_admin -->|"approves version"| node_report_ui
node_auth -->|"uses cache"| node_offline_cache
node_offline_cache -.->|"uses storage"| node_offline_db
node_worker_api -->|"starts polling"| node_poller
node_poller -->|"claims jobs"| node_supabase
node_poller -->|"dispatches layers"| node_layer_job
node_poller -->|"dispatches GPS"| node_gps_job
node_poller -->|"dispatches figures"| node_figure_job
node_poller -->|"dispatches builds"| node_doc_job
node_layer_job -->|"uses reprojection"| node_crs
node_layer_job -->|"reads and writes"| node_supabase
node_gps_job -.->|"reads and writes"| node_supabase
node_figure_job -->|"updates job"| node_supabase
node_doc_job -->|"builds sections"| node_sections
node_doc_job -->|"renders text"| node_text_templates
node_doc_job -->|"formats coordinates"| node_geo_format
node_doc_job -.->|"loads report data"| node_supabase
node_impact_matrix -.->|"seeds catalogs"| node_supabase
node_report_ui -.->|"requests generation"| node_supabase

click node_auth "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/tree/main/apps/web/src/app/(auth)"
click node_client_mgmt "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/app/(app)/clientes/page.tsx"
click node_project_mgmt "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/app/(app)/proyectos/page.tsx"
click node_scope "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/alcance.tsx"
click node_survey "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/relevamiento.tsx"
click node_offline "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/offline/repo.ts"
click node_geo_inputs "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/data/layers.ts"
click node_quality "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/control.tsx"
click node_content "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/impactos.tsx"
click node_report_ui "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/informe.tsx"
click node_worker_api "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/main.py"
click node_poller "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/poller.py"
click node_layer_job "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/layers.py"
click node_crs "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/crs.py"
click node_gps_job "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/gps.py"
click node_figure_job "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/figures.py"
click node_doc_job "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/docs.py"
click node_sections "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/report_sections.py"
click node_text_templates "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/text_template.py"
click node_geo_format "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/geo.py"
click node_impact_matrix "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/matriz.py"
click node_offline_cache "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/auth/offline-cache.ts"
click node_offline_db "https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/offline/db.ts"

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_auth,node_client_mgmt,node_project_mgmt,node_offline_cache,node_offline_db toneBlue
class node_scope,node_survey,node_offline,node_geo_inputs,node_quality,node_content,node_report_ui,node_impact_matrix,node_supabase toneAmber
class node_worker_api,node_poller,node_layer_job,node_crs,node_gps_job,node_figure_job toneMint
class node_doc_job,node_sections,node_text_templates,node_geo_format toneRose
class node_consultant,node_admin toneIndigo
```

## Components

### Web application

- [Authentication](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/tree/main/apps/web/src/app/(auth)): `apps/web/src/app/(auth)`
- [Client management](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/app/(app)/clientes/page.tsx): `apps/web/src/app/(app)/clientes/page.tsx`
- [Project management](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/app/(app)/proyectos/page.tsx): `apps/web/src/app/(app)/proyectos/page.tsx`
- [Auth offline cache](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/auth/offline-cache.ts): `apps/web/src/lib/auth/offline-cache.ts`
- [Offline database](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/offline/db.ts): `apps/web/src/lib/offline/db.ts`

### Project workflow

- [Project scope](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/alcance.tsx): `apps/web/src/components/project/alcance.tsx`
- [Field survey](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/relevamiento.tsx): `apps/web/src/components/project/relevamiento.tsx`
- [Offline data](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/offline/repo.ts): `apps/web/src/lib/offline/repo.ts`
- [Layers and GPS](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/lib/data/layers.ts): `apps/web/src/lib/data/layers.ts`
- [Quality control](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/control.tsx): `apps/web/src/components/project/control.tsx`
- [Report content](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/impactos.tsx): `apps/web/src/components/project/impactos.tsx`
- [Report review](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/web/src/components/project/informe.tsx): `apps/web/src/components/project/informe.tsx`
- [Impact matrix](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/matriz.py): `apps/worker/app/core/matriz.py`

### Worker processing

- [Worker service](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/main.py): `apps/worker/app/main.py`
- [Job poller](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/poller.py): `apps/worker/app/jobs/poller.py`
- [Layer processing](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/layers.py): `apps/worker/app/jobs/layers.py`
- [CRS utilities](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/crs.py): `apps/worker/app/core/crs.py`
- [GPS processing](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/gps.py): `apps/worker/app/jobs/gps.py`
- [Map figures](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/figures.py): `apps/worker/app/jobs/figures.py`

### Report generation

- [Document build](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/jobs/docs.py): `apps/worker/app/jobs/docs.py`
- [Report sections](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/report_sections.py): `apps/worker/app/core/report_sections.py`
- [Text templates](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/text_template.py): `apps/worker/app/core/text_template.py`
- [Coordinate formatting](https://github.com/exertion-solutions/estudios-de-impacto-ambiental/blob/main/apps/worker/app/core/geo.py): `apps/worker/app/core/geo.py`

### Other components

- **Consultant**
- **Administrator**
- **Supabase**

## Connections

- Consultant → Authentication: signs in
- Administrator → Authentication: signs in
- Consultant → Client management: manages clients
- Consultant → Project management: manages projects
- Consultant → Project scope: defines scope
- Consultant → Field survey: records field data
- Field survey → Offline data: stores offline
- Consultant → Layers and GPS: imports layers and GPS
- Consultant → Quality control: checks quality
- Consultant → Report content: completes content
- Consultant → Report review: requests report
- Administrator → Report review: approves version
- Authentication → Auth offline cache: uses cache
- Auth offline cache → Offline database: uses storage
- Worker service → Job poller: starts polling (evidence: `apps/worker/app/main.py`)
- Job poller → Supabase: claims jobs (evidence: `apps/worker/app/jobs/poller.py`)
- Job poller → Layer processing: dispatches layers (evidence: `apps/worker/app/jobs/poller.py`)
- Job poller → GPS processing: dispatches GPS (evidence: `apps/worker/app/jobs/poller.py`)
- Job poller → Map figures: dispatches figures (evidence: `apps/worker/app/jobs/poller.py`)
- Job poller → Document build: dispatches builds (evidence: `apps/worker/app/jobs/poller.py`)
- Layer processing → CRS utilities: uses reprojection (evidence: `apps/worker/app/jobs/layers.py`)
- Layer processing → Supabase: reads and writes
- GPS processing → Supabase: reads and writes
- Map figures → Supabase: updates job (evidence: `apps/worker/app/jobs/figures.py`)
- Document build → Report sections: builds sections (evidence: `apps/worker/app/jobs/docs.py`)
- Document build → Text templates: renders text (evidence: `apps/worker/app/jobs/docs.py`)
- Document build → Coordinate formatting: formats coordinates (evidence: `apps/worker/app/jobs/docs.py`)
- Document build → Supabase: loads report data
- Impact matrix → Supabase: seeds catalogs
- Report review → Supabase: requests generation
