# joaooliveira10/gis-app architecture

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

- Interactive diagram: https://gitdiagram.com/joaooliveira10/gis-app
- Repository: https://github.com/joaooliveira10/gis-app

## Overview

##### Project type and purpose
- The README describes it as a microservices architecture combining a React/TypeScript frontend, a GeoServer map server, a PostGIS-enabled PostgreSQL database, and a PgAdmin management UI, all orchestrated via Docker Compose.

##### File structure
- Top-level directories:
- data/ – raw CSV, XLSX, and GeoJSON source files
- db/postgres/init/ – SQL script to initialize the PostGIS database
- frontend/ – React application code, dependencies, and Dockerfile
- docs/ – images and documentation (e.g., screenshots)
- docker-compose.yml – orchestration of all containers
- desafio_tecnico_wcogeo.pdf – problem statement
- Notice there is no custom backend service directory: GeoServer will function as the “backend” map server.
- Configuration files: .gitignore, README.md, Dockerfile (frontend), docker-compose.yml, ESLint and TypeScript configs.

##### README for additional insights
- The architecture section defines four main components and their data flow.
- Technologies spelled out: React 19 + Vite + OpenLayers, GeoServer 2.27.0, PostgreSQL 16 + PostGIS 3.4, PgAdmin 4.

##### Elements
- Clear labels on every component (e.g., “React App”, “GeoServer 2.27”, “PostgreSQL 16 + PostGIS”)
- Rectangles for application services (React, GeoServer, PgAdmin)
- Clouds or hexagons for external protocols/services (WMS)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Docker Compose Orchestration
    DockerCompose["docker-compose.yml"]:::infra

    subgraph "Docker Compose Network"
        direction TB
        %% User Interface Layer
        subgraph "User Interface Layer"
            direction TB
            User["End User Browser"]:::external
            React["React App (HTTP 3000)"]:::frontend
        end

        %% Map Service Layer
        subgraph "Map Service Layer"
            direction TB
            Geo["GeoServer 2.27.0 (HTTP 8085)"]:::mapserver
        end

        %% Data Persistence Layer
        subgraph "Data Persistence Layer"
            direction TB
            Postgres["PostgreSQL 16 + PostGIS (TCP 5432)"]:::database
            PgAdmin["PgAdmin 4 (HTTP 5050)"]:::admin
        end

        %% Data Initialization
        subgraph "Data Initialization"
            direction TB
            DataFolder["Raw Data Sources"]:::data
            InitSql["init-db.sql"]:::script
        end
    end

    %% Connections
    DockerCompose --> React
    DockerCompose --> Geo
    DockerCompose --> Postgres
    DockerCompose --> PgAdmin

    User -->|"HTTP 3000"| React
    React -->|"WMS/WFS"| Geo
    Geo -->|"SQL (5432)"| Postgres
    PgAdmin -->|"TCP 5432"| Postgres
    DataFolder --> InitSql
    InitSql --> Postgres

    %% Click Events
    click React "https://github.com/joaooliveira10/gis-app/tree/main/frontend/"
    click DockerCompose "https://github.com/joaooliveira10/gis-app/blob/main/docker-compose.yml"
    click Geo "https://github.com/joaooliveira10/gis-app/blob/main/docker-compose.yml"
    click Postgres "https://github.com/joaooliveira10/gis-app/tree/main/db/postgres/"
    click PgAdmin "https://github.com/joaooliveira10/gis-app/blob/main/docker-compose.yml"
    click InitSql "https://github.com/joaooliveira10/gis-app/blob/main/db/postgres/init/init-db.sql"
    click DataFolder "https://github.com/joaooliveira10/gis-app/tree/main/data/"

    %% Styles
    classDef frontend fill:#D0E6FF,stroke:#1E81B0,color:#1E81B0,stroke-width:2px;
    classDef mapserver fill:#FFE8D6,stroke:#FF6500,color:#FF6500,stroke-width:2px;
    classDef database fill:#E2F0CB,stroke:#78B000,color:#78B000,stroke-width:2px;
    classDef admin fill:#F3D1F4,stroke:#C6008D,color:#C6008D,stroke-width:2px;
    classDef external fill:#F0F0F0,stroke:#828282,color:#828282,stroke-width:2px;
    classDef infra fill:#E8F1F2,stroke:#4A7C59,color:#4A7C59,stroke-width:2px,stroke-dasharray: 5 5;
    classDef data fill:#FFF4C1,stroke:#D4A417,color:#D4A417,stroke-width:2px;
    classDef script fill:#DFE7FD,stroke:#3B5BDB,color:#3B5BDB,stroke-width:2px;
```
