Skip to content

About

🤖 The GraphQL API for nearby Japanese train stations and bus stops, powered by Rust and Cloudflare Workers.

Topics

Resources

Contributing

Stars

14 stars

Watchers

1 watching

Forks

Repository files navigation

StationAPI

Billboard

All Contributors

A GraphQL API that provides nearby Japanese train stations and bus stops, running on Cloudflare Workers.

Documentation

Data Contribution

This project includes a comprehensive dataset of Japanese railway information in the data/ directory. The data is maintained in CSV format and contributions are primarily targeted at Japanese speakers. For detailed information about data structure and contribution guidelines, please refer to data/README.md.

Data Sources

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Kanta Demizu
Kanta Demizu

🔣 🚇 💻
SAIGUSA Tomotada
SAIGUSA Tomotada

🤔 🔣
mittan12
mittan12

🔣
CodeRabbit
CodeRabbit

👀
tahodev
tahodev

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Join our community(Japanese only)

Do you like this project? Join our Discord community! https://discord.gg/tsemdME9Nz

Development

The build packs rail data and search indexes into Wasm. Bus lines whose services all stay on one line use versioned Static Assets for stop sequences and service types. Lines with a service that spans multiple lines keep all their services in Wasm.

rustup target add wasm32-unknown-unknown
cargo install worker-build --locked

make data     # build generated/*.csv from data/, the GTFS feeds, and the MLIT railway data
make build    # build the Worker (wasm)
make dev      # run it locally on http://127.0.0.1:8787

make help lists every target.

Testing

make test     # unit tests for every native crate
make check    # type-check, including the wasm32 target
make clippy   # lint, including the wasm32 target
make fmt      # formatting check

Tests need no external services. stationapi (domain / use case) and preprocessor (data pipeline) are covered by unit tests; the published GraphQL schema is verified in CI by diffing the Worker's SDL against schema/public.graphql.

Deploying

make deploy             # staging   -> stationapi-stg
make deploy-production  # production -> stationapi

A data update rebuilds and deploys the Wasm and bus assets together.

Bus data credits

久米島町営バスのデータは、久米島町が提供し、OTTOP が配布するGTFSを使用しています。StationAPI は原本を停留所・系統・運行パターンの検索用に加工しています。ライセンスは CC BY 4.0 です。

About

🤖 The GraphQL API for nearby Japanese train stations and bus stops, powered by Rust and Cloudflare Workers.

Topics

Resources

Contributing

Stars

14 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages