Electrix
Tomorrow's electricity prices, readable at a glance.
Electricity prices for Estonia, Latvia, Lithuania and Finland, published a day ahead and drawn on one chart, so the cheap hours are obvious. It is a progressive web app (PWA): it installs on a phone or a computer and opens in its own window, like an app rather than a website. I check it every day.
Live
01
How it's built
- TypeScript
- SvelteKit 2
- Svelte 5
- PWA
- Convex
- convex-svelte
- xml2js
- Chart.js
- Luxon
- Zod
- Tailwind
- Bits UI
- Lucide
SvelteKit 2 and Svelte 5 in front, Convex behind it, as three packages: client, server and shared.
- Back end: Convex holds the database, the server functions and the scheduled jobs in one place, with a typed schema. Functions are split into public ones the app may call and internal ones only the server runs. A Convex cron job downloads the prices, and xml2js parses the XML they arrive in.
- Front end: SvelteKit 2 and Svelte 5, talking to Convex through convex-svelte. Tailwind, Bits UI, Lucide icons, toast notifications and a dark mode.
- Charts and time: Chart.js with its data-labels plugin. Luxon handles the time zones, because the market publishes its hours in UTC and four countries read them in their own time.
- Shared: one package of Zod schemas and domain models, used by both the client and the server.
- Accounts: email and password sign-in, with sessions and a separate admin area.
02
What was hard
Finding the data. The obvious source for these prices is Nord Pool, the power exchange where they are traded, and it asked €5,000 for access to its API. The same day-ahead prices are published by ENTSO-E, the European grid operators' transparency platform, free to anyone who registers. Electrix reads them from there, as XML.
03
The trade-off
The market sets a price for every 15 minutes. The chart shows hourly averages instead, and groups them further as the range grows: by the day up to a month, by the week beyond that. That keeps it readable, and it means a short spike inside an hour is smoothed out.