A Go microservice for location-based branch resolution, supporting Indonesia and Malaysia. Syncs branch data from an external API at startup with local cache fallback, resolves the nearest branch from user coordinates, and serves queries without external dependency after the first sync.

  • Built the entire service from scratch in Go — HTTP API with branch resolution, paginated branch listing, health check, metrics, and manual sync endpoints, containerized with Docker and Traefik.
  • Implemented location-based branch resolution for Indonesia, sorting all active branches by distance from the user's coordinates and returning the nearest pickup-enabled branch.
  • Built a multi-country configuration system allowing different selection strategies per country via environment variables — no code change needed to onboard a new country.
  • Implemented scheduled data synchronization with configurable interval (cron, duration string, or predefined alias), local cache fallback for startup resilience, and hot-reload after each sync with no service restart required.
  • Added observability and security — health check with branch count per country, request metrics tracking success rate, error rate, average response time, and branch selection distribution, with API key authentication for protected endpoints.