{"id":51447257,"url":"https://github.com/furyhawk/lta_datamall_api","last_synced_at":"2026-07-05T17:01:32.317Z","repository":{"id":361526053,"uuid":"1254775843","full_name":"furyhawk/lta_datamall_api","owner":"furyhawk","description":"FastAPI backend platform for LTA DataMall Bus Transport APIs, dockerized for production deployment.","archived":false,"fork":false,"pushed_at":"2026-05-31T03:26:11.000Z","size":1411,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-31T04:19:14.497Z","etag":null,"topics":["api","bus","container","fastapi","python","singapore","singapore-bus-data"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/furyhawk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-05-31T01:47:50.000Z","updated_at":"2026-05-31T03:26:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/furyhawk/lta_datamall_api","commit_stats":null,"previous_names":["furyhawk/lta_datamall_api"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/furyhawk/lta_datamall_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furyhawk%2Flta_datamall_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furyhawk%2Flta_datamall_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furyhawk%2Flta_datamall_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furyhawk%2Flta_datamall_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/furyhawk","download_url":"https://codeload.github.com/furyhawk/lta_datamall_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/furyhawk%2Flta_datamall_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35162071,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-05T02:00:06.290Z","response_time":100,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","bus","container","fastapi","python","singapore","singapore-bus-data"],"created_at":"2026-07-05T17:01:31.490Z","updated_at":"2026-07-05T17:01:32.297Z","avatar_url":"https://github.com/furyhawk.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LTA DataMall Bus Backend (FastAPI)\n\nFastAPI backend platform for LTA DataMall Bus Transport APIs, dockerized for production deployment.\n\n## Features\n\n- Async FastAPI service with shared `httpx` connection pool\n- Valkey caching layer with graceful fallback when cache is unavailable\n- Scalable runtime with Gunicorn + Uvicorn workers\n- API key loaded from `.env` (`DATAMALL_API_KEY`)\n- Backend port configurable via `.env` (`APP_PORT`)\n- Bus Transport endpoints exposed under `/api/v1`\n- Container health endpoints: `/healthz`, `/readyz`\n\n## API Endpoints\n\n- `GET /api/v1/bus-arrival`\n- `GET /api/v1/bus-services`\n- `GET /api/v1/bus-routes`\n- `GET /api/v1/bus-stops`\n- `GET /api/v1/passenger-volume/bus`\n- `GET /api/v1/passenger-volume/od-bus`\n- `GET /api/v1/planned-bus-routes`\n\n## Local Run (without Docker)\n\n1. Install uv (if not already installed).\n2. Create `.env` from `.env.example` and set `DATAMALL_API_KEY`.\n3. Sync dependencies:\n\n```bash\nuv sync\n```\n\n4. Start the app:\n\n```bash\nuv run uvicorn app.main:app --host 0.0.0.0 --port ${APP_PORT:-8000} --reload\n```\n\n## Docker Run\n\n1. Create `.env` from `.env.example` and set `DATAMALL_API_KEY`.\n2. Build and run:\n\n```bash\ndocker compose up --build -d\n```\n\n3. Check health:\n\n```bash\ncurl http://localhost:${APP_PORT:-8000}/healthz\n```\n\nThe compose stack includes a Valkey service for caching.\n\n## Cache Configuration\n\nSet in `.env`:\n\n- `VALKEY_ENABLED=true`\n- `VALKEY_URL=redis://valkey:6379/0`\n- `VALKEY_CONNECT_TIMEOUT_SECONDS=1`\n- `VALKEY_DEFAULT_TTL_SECONDS=120`\n- `APP_PORT=8000`\n\nCurrent cache behavior:\n\n- Bus Arrival: 15s\n- Bus Services and Bus Routes: 300s\n- Bus Stops: 1800s\n- Planned Bus Routes: 900s\n- Passenger Volume endpoints: 21600s\n\n## Makefile Tasks\n\nUse `make help` to see all targets. The Makefile auto-detects Podman first, then Docker.\n\nCommon commands:\n\n```bash\nmake sync\nmake run\nmake compile\nmake compose-up\nmake compose-down\nmake valkey-up\nmake valkey-down\n```\n\n## Horizontal Scaling\n\n- Increase container replicas:\n\n```bash\ndocker compose up --build --scale api=3 -d\n```\n\n- Put a load balancer or gateway in front of the replicas in production.\n\n## Notes\n\n- This project proxies requests to `https://datamall2.mytransport.sg/ltaodataservice`.\n- Static/list APIs support `$skip` forwarding for pagination.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuryhawk%2Flta_datamall_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffuryhawk%2Flta_datamall_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffuryhawk%2Flta_datamall_api/lists"}