A modern, fast web app for tracking real-time gas prices across Portuguese fuel stations — built as an improved alternative to precoscombustiveis.dgeg.gov.pt.
Live app: tomathy-dev.github.io/gas-prices
- Interactive dark map — CartoDB Dark Matter tiles with price-colored markers (green → amber → red by price quartile)
- Near Me — GPS-based filter with configurable radius: 5, 10, 25, 50, or 100 km
- Filter by brand — Galp, BP, Repsol, Prio, Intermarché, and more
- Filter by district & municipality
- Sort by price ascending/descending, distance, or name
- Station detail modal — all fuel types and prices, opening hours (weekdays/Saturday/Sunday/holidays), services, and payment methods
- 3 000+ stations loaded in a single request; all filtering done client-side — no lag on filter changes
- Mobile-first — filter drawer, map/list tab toggle, full-height map on mobile
| Layer | Technology |
|---|---|
| Framework | SvelteKit 2 · Svelte 5 (runes mode) |
| Styling | TailwindCSS v4 · Skeleton UI v3 |
| Map | Leaflet.js · CartoDB Dark Matter tiles |
| Language | TypeScript |
| Deployment | GitHub Pages via GitHub Actions |
| Data | DGEG Public API — free for non-commercial use |
npm install
npm run devOpen http://localhost:5173.
npm run checknpm run build
npm run previewThe app is automatically built and deployed to GitHub Pages on every push to main.
- Go to your repo → Settings → Pages
- Under Source, select GitHub Actions
- Push to
main— the workflow builds and deploys automatically
The live URL will be: https://<your-username>.github.io/gas-prices/
All gas price data is sourced from the DGEG (Direção-Geral de Energia e Geologia) public API. The API is free to use for non-commercial purposes. Prices are updated daily by the stations themselves and reflected in the API.
API base URL: https://precoscombustiveis.dgeg.gov.pt/api/PrecoComb/
Key endpoints used:
PesquisarPostos— station search with lat/lon and current prices (~3 000 stations per fuel type)GetDadosPosto— full station detail (all fuel types, hours, services, payment)GetTiposCombustiveis,GetMarcas,GetDistritos,GetMunicipios— reference data
MIT — see LICENSE