Portfolio Case Study
A production-grade REST API delivering high-precision sky events — sunrise & sunset, moon phases, solstices, planetary visibility, and ocean tides — for any coordinate on Earth.
What it does
Precise sunrise, sunset, civil/nautical/astronomical twilight times for any lat/lng, accounting for atmospheric refraction and elevation.
Moon rise/set times, current phase, illumination percentage, and upcoming phase cycle — new moon through full moon and back.
Rise, transit, and set times for all major planets. Visibility windows, elongation from the Sun, and angular diameter for any date.
Tidal height predictions using the EOT20 ocean tide model (DOI:10.17882/79489) with 2 GB of harmonic constituent data processed via xarray and Dask.
Searchable database of cities, countries, timezones, and regions via GeoNames, backed by PostGIS for spatial queries and H3 hexagonal indexing.
Per-endpoint throttling by membership tier, Stripe-powered checkout, API key issuance/revocation, and a manager-controlled docs portal — all reusable.
Under the hood
How it's built
Astronomical computation engine. Wraps Skyfield for sky events, planetary positions, sunrise/sunset, and tide predictions. One file per class, clean architecture throughout.
Geographic reference data service. Cities, countries, timezones, and regions sourced from GeoNames, stored in PostGIS, indexed with H3 hexagons.
Per-endpoint throttling and quota management. Membership tiers (Free / Basic / Pro) with configurable request limits and usage tracking.
User authentication, API key issuance and revocation, session management, and secure Bearer-token enforcement.
Stripe-powered checkout, subscription tier assignment on payment, and customer portal integration.
Manager-controlled API documentation portal. Auto-discovers registered endpoints and renders structured docs with visibility controls.
~2 GB of harmonic tidal constituents (17 components) distributed as NetCDF4 files from DOI:10.17882/79489 under CC-BY 4.0.
Lazily loaded and chunked via xarray with Dask back-end. Coordinate interpolation extracts per-point amplitude and phase at request time.
pyTMD reconstructs the tidal height time-series from constituents for any lat/lng, returning a full 24-hour tide prediction curve.
The API is live and free-tier accessible. Try a real astronomical query right now.