This repository contains a clean reference implementation of a dual-language backend that resolves a location and returns the average temperature for the current day using public APIs.
- JavaScript service with a REST API
- Python service with the same API contract
- Geocoding lookup for any location in the world
- Weather retrieval from Open-Meteo
- Health checks for monitoring
- GitHub Actions CI and Dependabot configuration
Request:
curl http://localhost:3000/api/healthResponse:
{
"status": "ok",
"service": "javascript"
}Request:
curl "http://localhost:3000/api/weather?location=Berlin"Response:
{
"location": {
"name": "Berlin",
"country": "DE",
"latitude": 52.52,
"longitude": 13.405
},
"weather": {
"average_temperature_c": 21.3,
"source": "Open-Meteo"
}
}cd js-service
npm install
npm startcd python-service
python app.pycd js-service
npm testcd python-service
python -m pytest -q testsjs-service/
server.js
tests/
python-service/
app.py
tests/
.github/
workflows/ci.yml
dependabot.yml
The API contract is documented in openapi.yaml.
You can view it locally with any OpenAPI-compatible tool such as Swagger UI or Redoc.
- GitHub Actions runs the JavaScript and Python test suites on every push and pull request.
- Dependabot checks the Node and Python dependencies weekly.