Monorepo untuk tools dan API data cuaca BMKG (Badan Meteorologi, Klimatologi, dan Geofisika) Indonesia.
tools/
├── apps/
│ ├── api/ # REST API untuk data cuaca BMKG
│ └── web/ # Web frontend (React + Vite)
├── packages/
│ └── weather-client/ # Library untuk fetch data BMKG
├── .env # Environment variables (git ignored)
├── .env.example # Template environment variables
└── turbo.json # Turborepo configuration
bun install# Copy template
cp .env.example .env
# Edit .env dan isi credentials BMKG
nano .envFile .env:
BMKG_USERNAME=your_station_id
BMKG_PASSWORD=your_password# Run API server
bun run dev --filter=api
# Run Web app
bun run dev --filter=web
# Run semua apps
bun run dev- API: http://localhost:3000
- Web: http://localhost:5173
REST API untuk mengambil data cuaca real-time dari stasiun AWS/ARG BMKG.
Tech Stack:
- Bun 1.3.3
- Hono 4.10.7
- TypeScript
Endpoints:
| Endpoint | Description |
|---|---|
GET / |
API info & documentation links |
GET /aws |
AWS/ARG station weather data |
GET /public |
Public weather API info |
GET /public/nowcasting |
Nowcasting data (signature/XML) |
GET /public/weather |
Public weather forecast (GeoJSON) |
GET /docs |
API documentation (Scalar UI) |
GET /openapi.yaml |
OpenAPI 3.1.0 spec |
Features:
- ✅ Fetch by Province, City, Radius, Station IDs
- ✅ Filter by Type (AWS, AAWS, ARG, ASRS, Soil, Iklimmikro)
- ✅ GeoJSON output format
- ✅ Consistent REST response format (
successfield) - ✅ OpenAPI 3.1.0 documentation
Dokumentasi lengkap: apps/api/README.md
Dashboard untuk visualisasi data cuaca BMKG.
Tech Stack:
| Technology | Version | Purpose |
|---|---|---|
| React | 19 | UI Library |
| Vite | 7 | Build tool |
| TanStack Router | 1.x | File-based routing |
| TanStack Query | 5.x | Data fetching & caching |
| Tailwind CSS | 4 | Styling |
| TypeScript | 5.9 | Type safety |
Features:
- ✅ File-based routing dengan TanStack Router
- ✅ Data fetching & caching dengan TanStack Query
- ✅ Multiple layouts (Default, Dashboard)
- ✅ Feature-based architecture
- ✅ Type-safe navigation & API calls
Routes:
| URL | Layout | Description |
|---|---|---|
/ |
Default | Home page |
/about |
Default | About page |
/dashboard |
Dashboard | Dashboard overview |
/dashboard/aws |
Dashboard | AWS stations data |
/dashboard/public |
Dashboard | Public weather data |
/dashboard/settings |
Dashboard | Settings |
Project Structure:
apps/web/src/
├── routes/ # Route definitions (thin)
├── features/ # Feature modules (business logic)
├── components/ # Shared components
├── layouts/ # Page layouts
├── lib/ # Utilities
└── main.tsx # Entry point
Dokumentasi lengkap: apps/web/README.md
Shared library untuk fetch dan konversi data BMKG.
Modules:
| Module | Description |
|---|---|
aws |
AWS/ARG station data fetcher |
public |
Public weather data fetcher |
geojson |
GeoJSON converter & filters |
AWS Data Fetcher:
import { AWSDataFetcher, BMKGAuth } from "weather-client";
const auth = new BMKGAuth(username, password);
const fetcher = new AWSDataFetcher(auth);
await fetcher.fetchDataByProvince(["PR013"], "aws");
await fetcher.fetchDataByCity("banyumas", "aws");
await fetcher.fetchDataByRadius(-7.43, 109.24, 50, "aws");GeoJSON Converter:
import {
// Public weather (PWX)
publicToGeoJSON,
filterPublicGeoJSON,
filterPublicByBoundingBox,
// AWS stations
awsToGeoJSON,
awsToGeoJSONFeature,
} from "weather-client";
// Public weather
const geojson = publicToGeoJSON(pwxData);
const filtered = filterPublicGeoJSON(geojson, { province: "Jawa Tengah" });
// AWS stations
const awsGeoJSON = awsToGeoJSON(stations);Station Types:
| Type | Description |
|---|---|
aws |
Automatic Weather Station |
aaws |
Advanced AWS |
arg |
Automatic Rain Gauge |
asrs |
Automatic Solar Radiation Station |
soil |
Soil Moisture Station |
iklimmikro |
Microclimate Station (multi-level) |
- Bun 1.3.3 or higher
- Node.js 18+ (optional, Bun is primary runtime)
- BMKG Credentials (username & password)
- Monorepo: Turborepo 2.6.3
- Package Manager: Bun
- Runtime: Bun
- Language: TypeScript
- API Framework: Hono 4.10.7
# Development
bun run dev # Run all apps in dev mode
bun run dev --filter=api # Run only API
bun run dev --filter=web # Run only Web
# Build
bun run build # Build all apps
bun run build --filter=api # Build only API
# Type Check
bun run check-types # Check TypeScript in all packages
bun run check-types --filter=api
# Lint
bun run lint # Lint all packages-
Copy template:
cp .env.example .env
-
Edit
.envdengan credentials Anda:BMKG_USERNAME=your_station_id BMKG_PASSWORD=your_password
- ✅ File
.envsudah di.gitignore - ✅ Credentials tidak pernah di-commit ke repository
- ✅ Setiap developer setup credentials sendiri
- ✅
.env.examplehanya template tanpa nilai asli
Credentials BMKG didapat dengan menghubungi administrator BMKG atau melalui stasiun cuaca setempat.
| Command | Description |
|---|---|
bun install |
Install dependencies semua packages |
bun run dev |
Run all apps in development mode |
bun run build |
Build all apps for production |
bun run lint |
Lint all packages |
bun run check-types |
TypeScript type checking |
# Development
bun run dev --filter=api # API only
bun run dev --filter=web # Web only
bun run dev --filter=weather-client # Package only
# Build
bun run build --filter=api
# Type check specific package
bun run check-types --filter=weather-clientAPI (apps/api):
cd apps/api
bun run dev # Development server
bun run build # Build for production
bun run check-types # Type checkingWeather Client (packages/weather-client):
cd packages/weather-client
bun run build # Build library
bun run check-types # Type checking- API README:
apps/api/README.md - OpenAPI Spec:
apps/api/openapi.yaml - Interactive Docs:
http://localhost:3000/docs(Scalar UI)
- AWS Fetcher:
packages/weather-client/src/aws/README.md - GeoJSON Converter:
packages/weather-client/src/geojson/README.md - AWS to GeoJSON:
packages/weather-client/src/geojson/AWS.md
- Web README:
apps/web/README.md- Dokumentasi lengkap frontend
- Province Codes:
packages/weather-client/src/aws/province.json - Station Data:
packages/weather-client/src/aws/location.json
- Fork repository ini
- Buat branch untuk feature (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push ke branch (
git push origin feature/amazing-feature) - Buat Pull Request
Project ini dibuat untuk keperluan pembelajaran dan integrasi data BMKG Indonesia.
- BMKG - Sumber data cuaca
- Turborepo - Monorepo tooling
- Bun - JavaScript runtime & toolkit
- Hono - Web framework
Built with ❤️ using Bun + Turborepo + Hono