Skip to content

frasermolyneux/geo-location

Repository files navigation

GeoLocation Service

Build and Test Code Quality Copilot Setup Steps Dependabot Auto-Merge Deploy Dev Deploy Prd Destroy Development Destroy Environment PR Verify Release - Publish NuGet Release - Version and Tag

Documentation

Overview

GeoLocation is a .NET 9 workload that fronts MaxMind lookups with an Entra-protected API and caches results in Azure Table Storage to reduce latency and cost. The API exposes two versioned endpoint groups:

  • v1.0: Single/batch hostname/IP lookup, metadata deletion, and API info — cached permanently in the geolocations table
  • v1.1: City and Insights lookups with typed DTOs and MaxMind Anonymizer support — cached in the geolocationsv11 table (city: permanent, insights: configurable TTL)

Both versions enforce the LookupApiUser Entra role. An MVC web front end calls the API using API-key and Entra authentication, handles Cloudflare/X-Forwarded-For headers, and stores the user’s last lookup in session. The API serves its OpenAPI specs at runtime at /openapi/v1.0.json and /openapi/v1.1.json, and infrastructure is managed by Terraform under terraform/. Build versioning uses Nerdbank.GitVersioning.

NuGet Packages

Package Latest Description
MX.GeoLocation.Abstractions.V1 NuGet Interfaces and models for the GeoLocation API
MX.GeoLocation.Api.Client.V1 NuGet Typed HTTP client with DI registration via AddGeoLocationApiClient()
MX.GeoLocation.Api.Client.Testing NuGet In-memory fakes and DTO factory helpers for consumer test projects; see testing docs

Contributing

Please read the contributing guidance; this is a learning and development project.

Security

Please read the security guidance; I am always open to security feedback through email or opening an issue.

About

MaxMind-backed GeoLocation service with caching: ASP.NET API, web UI, and client library published behind API Management; deployed with Terraform and GitHub Actions.

Topics

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors