Sign inSign up

darktrees/take-me

By darktrees

•Updated about 2 hours ago

Self-hosted NSW navigation: turn-by-turn, live traffic, partial-toll routes and EV charge planning

Image
0

2.0K

darktrees/take-me repository overview

⁠Take Me

A self-hosted navigation app for New South Wales, with turn-by-turn guidance, live traffic and NSW hazards.

Four things set it apart from other mapping tools:

  • Partial toll routes. Options are built one toll road at a time, so a trip can pay for the motorway that saves real time and skip the one that saves a minute.
  • A toll option chosen by default. Every option is priced and judged against your own rule, and the one it recommends is the one it guides.
  • EV monitoring. The charge a drive will use, and a live estimate during guidance that you can correct from the car's display.
  • EV charge planning. Charging stops from a merged list of NSW fast chargers, re-checked as you drive.

Type a place name, pick a result, and read a traffic verdict for the route, with live travel times, hazards and closures along the way, and the tolls priced. Then tap Start: a map that turns with the road, the next turn in a banner, and a voice. A drive with the screen off can still be handed to OsmAnd⁠ or your default maps app.

It's a PWA, one container and one SQLite file. There are no accounts, and the server keeps nothing about where you go.

⁠What it does

  • Search by name. TomTom search, ranked by where you are without being limited to it.
  • A traffic verdict. Travel time now compared with free-flowing traffic, and every Live Traffic NSW hazard on the route.
  • Closures avoided. If a closure sits on the route, Take Me asks for a way round and shows it next to the route it replaced, so you choose.
  • Tolls weighed, one road at a time. Each toll road is priced from Transport for NSW's table, and the options include dropping one motorway and keeping another. Each is judged against your own rule (cents per minute saved, a cap per trip, and a minimum saving), and the option it recommends is the one it guides.
  • In-app guidance. Spoken turn-by-turn on the option you chose. It re-plans when you leave the route, checks hazards every minute and the traffic every five, and offers a faster way only when it's worth it. Add a stop from the map without leaving guidance: coffee, groceries and the like are looked for along the road ahead and ranked by the minutes each adds. Guidance keeps the screen on; for a drive with the screen off, use the OsmAnd handoff under Start.
  • OsmAnd handoffs, for the screen off. A geo: point, or a GPX of the exact route (detour and toll choice included).
  • EVs (optional). The charge a drive will use and leave for your car, worked out from its spec sheet, the elevation, the stops, the load and the forecast temperature. When the charge runs short, it plans charging stops from a merged list of NSW fast chargers. During guidance a charge bar shows the estimate now and at the next stop; correct it from the car's display and the charging plan is re-checked only when it has to be.

⁠Privacy

  • Your position is never stored or tracked. It reaches the server only inside a request your phone makes: rounded to about a kilometre for a search, and as the GPS gave it for a route, so the route starts on the right side of the road. The server keeps none of it.
  • Searches aren't kept as text. The server logs only a salted hash of a search that found nothing. Your recent places and favourites live in your browser's storage and are never sent anywhere.
  • API keys stay on the server. Map tiles are proxied, so your TomTom key never appears in the page.
  • Diagnostics stay on the phone. The diagnostics log records what the app did, never where, and leaves the phone only when you copy or share it.

⁠Running it

You need two free API keys:

services:
  take-me:
    image: darktrees/take-me:latest
    env_file: .env
    environment:
      - TZ=Australia/Sydney
    volumes:
      - ./data:/data
    ports:
      - "8000:8000"
    restart: unless-stopped

The container runs as uid 1000, and SQLite creates its file in /data, so create the folder and hand it over before the first start:

mkdir -p data && sudo chown 1000:1000 data

The PWA needs HTTPS for its service worker, so put it behind a reverse proxy with a trusted certificate.

⁠Keep it private

No endpoint has authentication. The tile and search endpoints spend your TomTom quota, so anything that can reach them can use it up. Keep Take Me on a private network such as Tailscale or WireGuard, and don't expose it to the internet. Check from outside after you deploy that the hostname doesn't answer.

⁠Configuration

Put these in .env beside the compose file. Never put them in the compose file itself.

VariableRequiredWhat it's for
TFNSW_API_KEYyesLive Traffic NSW hazards, and toll prices
TOMTOM_API_KEYyesSearch, routing and map tiles
HOME_LAT / HOME_LONyesThe "home" origin for a route
MISS_SALTrecommendedSalt for hashed search misses: openssl rand -hex 32
OCM_API_KEYnoOpen Charge Map, one more source for the charger list

Everything else has a working default.

/api/health reports what is configured and what the last outbound calls did. It makes no outbound calls of its own.

⁠Optional data
  • Elevation for the EV energy model is a one-off download for NSW (about 400 MB, 20 to 30 minutes): docker exec take-me python -m app.ev.dem fetch
  • NSW Road Crash Data needs a login on the Open Data Hub, so it's loaded by hand from a downloaded file: docker exec take-me python -m app.crashload load /data/<file>.xlsx

⁠Data and attribution

Take Me's licence covers its own code. The data comes from other providers, each under its own terms. Whoever runs Take Me supplies their own keys and agrees to each provider's terms themselves. The app shows the attribution each provider requires.

SourceUsed forTerms
Transport for NSW⁠Hazards, toll prices, crash data; the fixed and red-light speed cameras and the school zones, fetched at runtime for the whole stateCC BY 4.0 (crash data CC BY 3.0 AU)
NSW Department of Education⁠School term dates, development days included, for when a school zone is in force; a small table ships in the imagePublic dates; © State of New South Wales
TomTom⁠Search, routing, maps, chargersYour own TomTom account's terms
OpenStreetMap⁠ via OverpassTraffic signals, chargers, the cafés and car parks on the guidance map, and the named shops and businesses search falls back on; fetched at runtime for the region, and searched on the server so no query is sent anywhereODbL
Open Charge Map⁠Chargers (optional)CC BY 4.0
supercharge.info⁠Which Superchargers are open to all carsNo licence stated
ev-wiki⁠The car listFree for personal use; fetched at runtime and never shipped in the image
Open EV Data⁠The car list, for models ev-wiki lacksMIT, with attribution; a snapshot ships in the image
Open-Meteo⁠The temperature forecast for the energy model, fetched for a grid over the regionCC BY 4.0, free for non-commercial use; fetched at runtime and never shipped in the image
Terrain Tiles⁠Elevation© Commonwealth of Australia (Geoscience Australia) 2017; SRTM courtesy of the U.S. Geological Survey

The image also includes Leaflet⁠ (BSD-2-Clause) and MapLibre GL JS⁠ (BSD-3-Clause), each with its own licence file.

⁠Licence

Take Me is source-available under the PolyForm Noncommercial License 1.0.0⁠. Personal, hobby, research, educational and charity use are all welcome. Commercial use is not permitted without a separate licence. That also keeps you inside the terms of the car list, which is for personal use only. The full terms are at /app/LICENSE in the image.

⁠Source

The code lives on a private forge. It's available on request for non-commercial use; get in touch through the contact link on the darktrees Docker Hub profile⁠. To ask about commercial use, use the same link.

Tag summary

Content type

Image

Digest

sha256:df2323e69…

Size

56.4 MB

Last updated

about 2 hours ago

docker pull darktrees/take-me