# akhil0033/upsc-mapping-assistant architecture

> Architecture diagram of the GitHub repository akhil0033/upsc-mapping-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akhil0033/upsc-mapping-assistant
- Repository: https://github.com/akhil0033/upsc-mapping-assistant

## Overview

This Spring Boot application provides a mapping assistant: a user can open its home page or search for multiple places through the locations API. The API delegates each place lookup to a geocoding service, which obtains coordinates from OpenCage, adds a best-effort Wikipedia summary, and returns location data. Named caching is enabled at application startup. The source excerpts show these core calls; the template and application configuration are present in the tree but were not sampled, so their internal behavior is not inferred.

Main entry points: [`src/main/java/com/project/map/GeocodingService.java`](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/GeocodingService.java) (Geocoding service), [`src/main/java/com/project/map/MapController.java`](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MapController.java) (Location API), [`src/main/java/com/project/map/ViewController.java`](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/ViewController.java) (Home route), [`src/main/java/com/project/map/PlaceNotFoundException.java`](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/PlaceNotFoundException.java) (Place-not-found error)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_map_api["Location API<br/>[MapController.java]"]
  node_home_route["Home route"]
  node_home_template["Home template<br/>[index.html]"]
end

subgraph group_enrichment["Location enrichment"]
  node_location_data["Location result<br/>[MapLocation.java]"]
  node_geocoding["Geocoding service"]
  node_opencage["OpenCage API"]
  node_wikipedia["Wikipedia API"]
  node_not_found["Place-not-found error"]
  node_geocoding_error["Geocoding error"]
end

subgraph group_runtime["Runtime support"]
  node_application["Application startup<br/>[MappingIt.java]"]
  node_cache_config["Cache configuration<br/>[CacheConfig.java]"]
end

node_user(("User"))

node_user -->|"searches places"| node_map_api
node_user -->|"opens home"| node_home_route
node_home_route -->|"returns view"| node_home_template
node_map_api -->|"looks up places"| node_geocoding
node_geocoding -->|"requests coordinates"| node_opencage
node_geocoding -->|"fetches summary"| node_wikipedia
node_geocoding -->|"builds result"| node_location_data
node_geocoding -->|"raises when absent"| node_not_found
node_geocoding -->|"wraps client failure"| node_geocoding_error
node_map_api -->|"skips missing place"| node_not_found
node_application -.->|"starts with caching"| node_cache_config

click node_map_api "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MapController.java"
click node_home_route "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/ViewController.java"
click node_home_template "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/resources/templates/index.html"
click node_location_data "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MapLocation.java"
click node_geocoding "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/GeocodingService.java"
click node_not_found "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/PlaceNotFoundException.java"
click node_geocoding_error "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/GeocodingException.java"
click node_application "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MappingIt.java"
click node_cache_config "https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/CacheConfig.java"

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_map_api,node_home_route,node_home_template,node_user toneBlue
class node_location_data,node_geocoding,node_opencage,node_wikipedia,node_not_found,node_geocoding_error toneAmber
class node_application,node_cache_config toneMint
```

## Components

### Web interface

- [Location API](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MapController.java): `src/main/java/com/project/map/MapController.java`
- [Home route](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/ViewController.java): `src/main/java/com/project/map/ViewController.java`
- [Home template](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/resources/templates/index.html): `src/main/resources/templates/index.html`

### Location enrichment

- [Location result](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MapLocation.java): `src/main/java/com/project/map/MapLocation.java`
- [Geocoding service](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/GeocodingService.java): `src/main/java/com/project/map/GeocodingService.java`
- **OpenCage API**
- **Wikipedia API**
- [Place-not-found error](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/PlaceNotFoundException.java): `src/main/java/com/project/map/PlaceNotFoundException.java`
- [Geocoding error](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/GeocodingException.java): `src/main/java/com/project/map/GeocodingException.java`

### Runtime support

- [Application startup](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/MappingIt.java): `src/main/java/com/project/map/MappingIt.java`
- [Cache configuration](https://github.com/akhil0033/upsc-mapping-assistant/blob/main/src/main/java/com/project/map/CacheConfig.java): `src/main/java/com/project/map/CacheConfig.java`

### Other components

- **User**

## Connections

- User → Location API: searches places (evidence: `src/main/java/com/project/map/MapController.java`)
- User → Home route: opens home (evidence: `src/main/java/com/project/map/ViewController.java`)
- Home route → Home template: returns view (evidence: `src/main/java/com/project/map/ViewController.java`)
- Location API → Geocoding service: looks up places (evidence: `src/main/java/com/project/map/MapController.java`)
- Geocoding service → OpenCage API: requests coordinates (evidence: `src/main/java/com/project/map/GeocodingService.java`)
- Geocoding service → Wikipedia API: fetches summary (evidence: `src/main/java/com/project/map/GeocodingService.java`)
- Geocoding service → Location result: builds result (evidence: `src/main/java/com/project/map/GeocodingService.java`)
- Geocoding service → Place-not-found error: raises when absent (evidence: `src/main/java/com/project/map/GeocodingService.java`)
- Geocoding service → Geocoding error: wraps client failure (evidence: `src/main/java/com/project/map/GeocodingService.java`)
- Location API → Place-not-found error: skips missing place (evidence: `src/main/java/com/project/map/MapController.java`)
- Application startup → Cache configuration: starts with caching
