# mahmudur26/geo-location-fetcher architecture

> Architecture diagram of the GitHub repository mahmudur26/geo-location-fetcher, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mahmudur26/geo-location-fetcher
- Repository: https://github.com/mahmudur26/geo-location-fetcher

## Overview

This is a Laravel geolocation capture and display app. A visitor’s browser obtains coordinates when permitted and posts them; the controller falls back to IP-based location when coordinates are missing, reverse-geocodes the result, and stores it. The landing page reads recent records and displays them in a table and map. The route definitions were not sampled, so route-to-controller wiring is omitted.

Main entry points: [`app/Http/Controllers/Controller.php`](https://github.com/mahmudur26/geo-location-fetcher/blob/main/app/Http/Controllers/Controller.php) (Request controller), [`app/Models/GeoData.php`](https://github.com/mahmudur26/geo-location-fetcher/blob/main/app/Models/GeoData.php) (Geo records), [`resources/views/landing_page.blade.php`](https://github.com/mahmudur26/geo-location-fetcher/blob/main/resources/views/landing_page.blade.php) (Landing page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_landing["Landing page"]
  node_geolocation["Browser geolocation"]
  node_osm["OpenStreetMap tiles"]
end

subgraph group_geo["Location processing"]
  node_controller["Request controller<br/>[Controller.php]"]
  node_ip_api["IP location API"]
  node_opencage["OpenCage geocoder"]
end

subgraph group_data["Persistence"]
  node_geo_records[("Geo records<br/>[GeoData.php]")]
  node_database[("SQL database")]
end

node_visitor(("Visitor"))
node_browser(("Browser"))

node_visitor -->|"opens page"| node_browser
node_browser -->|"requests position"| node_geolocation
node_geolocation -->|"returns coordinates"| node_browser
node_browser -->|"posts coordinates"| node_controller
node_controller -.->|"looks up IP"| node_ip_api
node_controller -->|"reverse geocodes"| node_opencage
node_controller -->|"creates record"| node_geo_records
node_geo_records -->|"writes and queries"| node_database
node_controller -->|"loads recent records"| node_geo_records
node_controller -->|"renders page"| node_landing
node_landing -->|"returns HTML"| node_browser
node_browser -.->|"loads map tiles"| node_osm

click node_controller "https://github.com/mahmudur26/geo-location-fetcher/blob/main/app/Http/Controllers/Controller.php"
click node_landing "https://github.com/mahmudur26/geo-location-fetcher/blob/main/resources/views/landing_page.blade.php"
click node_geo_records "https://github.com/mahmudur26/geo-location-fetcher/blob/main/app/Models/GeoData.php"

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_landing,node_geolocation,node_osm,node_browser toneBlue
class node_controller,node_ip_api,node_opencage toneAmber
class node_geo_records,node_database toneMint
class node_visitor toneIndigo
```

## Components

### Web experience

- [Landing page](https://github.com/mahmudur26/geo-location-fetcher/blob/main/resources/views/landing_page.blade.php): `resources/views/landing_page.blade.php`
- **Browser geolocation**
- **OpenStreetMap tiles**

### Location processing

- [Request controller](https://github.com/mahmudur26/geo-location-fetcher/blob/main/app/Http/Controllers/Controller.php): `app/Http/Controllers/Controller.php`
- **IP location API**
- **OpenCage geocoder**

### Persistence

- [Geo records](https://github.com/mahmudur26/geo-location-fetcher/blob/main/app/Models/GeoData.php): `app/Models/GeoData.php`
- **SQL database**

### Other components

- **Visitor**
- **Browser**

## Connections

- Visitor → Browser: opens page
- Browser → Browser geolocation: requests position
- Browser geolocation → Browser: returns coordinates
- Browser → Request controller: posts coordinates
- Request controller → IP location API: looks up IP
- Request controller → OpenCage geocoder: reverse geocodes
- Request controller → Geo records: creates record
- Geo records → SQL database: writes and queries
- Request controller → Geo records: loads recent records
- Request controller → Landing page: renders page
- Landing page → Browser: returns HTML
- Browser → OpenStreetMap tiles: loads map tiles
