meatcar / transit-dashboard

Accessible transit dashboard using transitapp's API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🚇 Transit Dashboard

Disclaimer: This is an unofficial hobby project developed by me using the Transit API. It is in no way affiliated with the Transit App/team.

Features

  • Pick some nearby stations
  • Display next three departures at a station in a tabular format
  • Cache and debounce API queries to stay within API quota
  • Bookmark the final URL for easy access

Development

  1. Install Nix

  2. Obtain access to the Transit App API.

  3. Obtain a Google Maps API key

  4. Copy .env.example to .env and edit it. Fill in your API keys.

  5. Start the project:

    nix develop
    deno task start
    

    This will watch the project directory and restart as necessary.

Deployment

A Docker image can be built that bundles the application with a Tailscale client. A Traefik proxy is configured to proxy all Tailscale-authenticated traffic through a tunnel to the application.

sequenceDiagram
    participant User
    participant Tailscale
    box Docker Container
        participant Tailscale Client
        participant Traefik Proxy
        participant Transit Dashboard
    end
    Traefik Proxy->>Tailscale Client: Listen on HTTPS
    User--xTailscale Client: Request Failed, DNS Error
    User->>Tailscale: Log In
    Tailscale-->>User: Authenticated
    User->>+Transit Dashboard: Request
    Transit Dashboard-->>-User: Response

You can build and deploy the image yourself with:

nix build .#nix2containerImage.copyToDockerDaemon && ./result/bin/copy-to-docker-daemon
docker run \
    --rm \
    --env-file .env \
    -v /dev/net/tun:/dev/net/tun \
    -v ./tailscale:/var/lib/tailscale \
    -v ./cache:/app/cache \
    --cap-add NET_ADMIN \
    --cap-add SYS_MODULE \
    --hostname transit-dashboard \
    --name transit-dashboard \
    transit-dashboard:latest

About

Accessible transit dashboard using transitapp's API

License:MIT License


Languages

Language:TypeScript 91.3%Language:Nix 6.6%Language:CSS 2.1%