Skip to content

leoaltemari/weather-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌦️ Buienradar GraphQL Proxy API

A modern GraphQL proxy for Dutch weather data

Node.js GraphQL Apollo Server


📖 Overview

A lightweight GraphQL API that acts as a proxy to Buienradar's public weather data feed. Provides typed GraphQL schema, CORS support, error handling, and timeout protection for consuming applications.

✨ Features

  • 🔄 Proxy Layer — Abstracts upstream API complexities
  • 🛡️ Type Safety — Fully typed GraphQL schema
  • Timeout Protection — Configurable request timeouts
  • 🌐 CORS Ready — Pre-configured for web clients
  • 📊 Apollo Explorer — Built-in GraphQL playground
  • 🪵 Structured Logging — Timestamped error & info logs

Upstream Source: https://data.buienradar.nl/2.0/feed/json


🚀 Quick Start

Prerequisites

Node.js 20+ recommended

Installation

npm install

Configuration

Environment variables (all optional):

Variable Default Description
PORT 4000 Server port
BUIENRADAR_URL https://data.buienradar.nl/2.0/feed/json Upstream API URL
REQUEST_TIMEOUT_MS 8000 Request timeout in milliseconds

Run

npm start

🎉 Server ready at http://localhost:4000/ 🔍 Open the URL to access Apollo Explorer


🌐 CORS Policy

Configured origins:

  • http://localhost:4200 — Local development
  • https://leoaltemari.github.io — GitHub Pages deployment

📝 Usage

Root Query

weatherData: WeatherData

Example Query

query GetWeather {
  weatherData {
    buienradar {
      copyright
      terms
    }
    actual {
      sunrise
      sunset
      stationmeasurements {
        stationid
        stationname
        temperature
        windspeed
        weatherdescription
      }
    }
    forecast {
      weatherreport {
        title
        summary
      }
      fivedayforecast {
        day
        mintemperature
        maxtemperature
        rainChance
        weatherdescription
      }
    }
  }
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published