Skip to content

About

Track the Weather in your City (Python & JS)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

JS & Python Backend Reference Project

CI Python Node.js License

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.

Features

  • 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

API

Health

Request:

curl http://localhost:3000/api/health

Response:

{
  "status": "ok",
  "service": "javascript"
}

Weather

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"
  }
}

Run the JavaScript service

cd js-service
npm install
npm start

Run the Python service

cd python-service
python app.py

Test the services

cd js-service
npm test
cd python-service
python -m pytest -q tests

Project structure

js-service/
  server.js
  tests/
python-service/
  app.py
  tests/
.github/
  workflows/ci.yml
  dependabot.yml

API documentation

The API contract is documented in openapi.yaml.

You can view it locally with any OpenAPI-compatible tool such as Swagger UI or Redoc.

CI and automation

  • GitHub Actions runs the JavaScript and Python test suites on every push and pull request.
  • Dependabot checks the Node and Python dependencies weekly.

About

Track the Weather in your City (Python & JS)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages