Skip to content

Fabian-Kleine/home-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

43 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Home Dashboard

A wall-mounted / kiosk-style home dashboard showing local weather, live solar production & battery data from a Sungrow inverter (via the iSolarCloud API), an AI-generated daily outlook, and a regional news feed.

React TypeScript Vite Tailwind CSS TanStack Express Node.js Turborepo pnpm License

Features

Dashboard & UI

  • πŸ–₯️ Kiosk-ready home dashboard with a glassmorphism look β€” mesh-gradient background and frosted glass cards.
  • 🧭 Multi-page layout with a collapsible sidebar: Home, Weather, News, and Solar (Live + Statistics).
  • 🏠 Home overview combining a time-of-day greeting, weather hero, live production status, current conditions, news, animated power flow, and the AI outlook β€” all on one screen.
  • πŸŒ— Themes: light, dark, system, and auto (switches between light/day and dark/night by time of day).
  • 🌍 Multi-language UI: English, German, and Dutch, persisted across sessions (cookie + localStorage).
  • β›Ά Fullscreen / kiosk mode toggle for wall-mounted displays.
  • πŸ”„ Unified 5-minute auto-refresh plus a manual refresh control, keeping weather and solar data in sync so they never drift apart.
  • πŸ“± Responsive down to mobile, with a slide-in drawer sidebar and graceful loading / empty / error / "outdated data" states throughout.

Weather (Open-Meteo)

  • 🌑️ Current conditions: temperature, feels-like, humidity, precipitation, wind speed, and cloud cover.
  • πŸ“… Daily forecast with min/max temperature, daylight & sunshine duration, and cloud cover.
  • 🌀️ Day/night-aware icons mapped from Open-Meteo weather codes using the location's sunrise/sunset.
  • πŸ›‘οΈ Backend proxy with automatic retry on transient network errors.

Solar / Sungrow (iSolarCloud)

  • ⚑ Live production readings: solar output, grid import/export, battery power & charge level, household load, and daily yield.
  • 🏘️ Per-roof (per-string) PV power (e.g. East / West roof), supporting both plain grid-tied and hybrid/ESS (battery) inverters.
  • πŸŒ€ Animated power-flow visualization of energy moving between panels, battery, home, and grid.
  • πŸ“Š Statistics page with a monthly-production chart and a per-roof intraday power chart (Recharts).
  • πŸ” Cookie-based session (httpOnly) with a login/logout dialog and live connection status.
  • πŸ§ͺ Graceful fallback to demo/mock data before you connect, so the UI is fully usable without live credentials.

AI outlook (Ollama)

  • πŸ€– Natural-language daily summary of the weather, how solar is tracking, and anything notable about battery/grid usage.
  • πŸ—£οΈ Language-aware β€” the summary is written in the currently selected UI language.
  • πŸ’Ύ Smart caching: volatile readings are bucketed into the cache key so the 5-minute refresh mostly hits the cache, only re-prompting the model when conditions change meaningfully (1-hour TTL).

News (Tagesschau)

  • πŸ“° Merged regional feed (ausland + inland), deduplicated and sorted newest-first.
  • πŸ–ΌοΈ Normalized articles with a 16:9 teaser image, kicker/region, breaking-news flag, and a link to the full story.
  • πŸ—žοΈ Shown both as a card on the home screen and on a dedicated news page.
  • ⏱️ 15-minute server-side cache to stay within the upstream feed's rate limits.

Architecture & DX

  • 🧱 pnpm + Turborepo monorepo with a shared TypeScript contract package (@repo/shared) as the single source of truth for API routes and payload shapes.
  • 🧩 Type-safe file-based routing (TanStack Router) and data fetching (TanStack Query).
  • πŸš€ Deploy scripts (bin/) for provisioning and shipping to a Debian/nginx host.

Tech stack

  • Monorepo: pnpm workspaces + Turborepo
  • Backend (apps/backend): Express 5, TypeScript (ESM), tsx for dev, node-cache for caching, openmeteo + ollama clients
  • Frontend (apps/web): Vite, React 19, TanStack Router + TanStack Query, Tailwind CSS v4, shadcn/radix-ui, Recharts
  • Shared (packages/shared): TypeScript types and constants shared between backend and frontend, built with tsup

Project structure

apps/
  backend/   Express API β€” weather (Open-Meteo), iSolarCloud/Sungrow, AI overview (Ollama), news (Tagesschau)
  web/       React SPA β€” dashboard UI
packages/
  shared/    Shared types, constants, and API route definitions (@repo/shared)
  tsconfig/  Shared base tsconfig presets
bin/
  install-deps.sh   Provisions a fresh Debian host (nginx, node via nvm, pnpm, firewall)
  deploy.sh         Pulls latest main, builds apps/web, copies dist/ to the target host

Getting started

Prerequisites: Node.js (LTS) and pnpm.

pnpm install

Configure the backend by copying the example env file and filling in your credentials:

cp apps/backend/.env.example apps/backend/.env
Variable Description
FRONTEND_ORIGIN Comma-separated list of origins allowed by CORS (default http://localhost:5173)
PORT Backend port (default 4000)
OPENMETEO_URL Open-Meteo forecast API base URL
TAGESSCHAU_NEWS_URL Tagesschau news feed base URL (region/ressort params are appended automatically)
ISOLAR_CLOUD_URL iSolarCloud OpenAPI gateway base URL
ISOLAR_CLOUD_APPKEY iSolarCloud app key
ISOLAR_SECRET_KEY iSolarCloud access key
OLLAMA_URL Ollama host for the AI overview (default https://ollama.com)
OLLAMA_MODEL Model used to generate the outlook blurb
OLLAMA_API_KEY Bearer token for the Ollama host (optional for local hosts)

Run both apps in dev mode:

pnpm dev

Common commands

Run from the repo root (Turborepo fans these out to each workspace):

pnpm dev         # run backend + web in watch mode
pnpm build       # build all workspaces
pnpm lint        # lint all workspaces
pnpm typecheck   # typecheck all workspaces

API

The backend exposes the following endpoints (route paths are defined in @repo/shared's API_ROUTES):

Route Description
GET /health Service health check
GET /weather Current conditions + daily forecast (Open-Meteo)
POST /isolar/login Β· POST /isolar/logout Β· GET /isolar/status iSolarCloud session management
GET /isolar/solar-data Live production / battery / grid / per-roof readings
GET /isolar/statistics Monthly production + per-roof intraday power
POST /ai/overview AI-generated daily outlook (Ollama)
GET /news Normalized regional news feed (Tagesschau)

Deployment

bin/deploy.sh builds apps/web and copies the static output to a target directory on a server (default /var/www/html, i.e. nginx's default document root β€” the app is served at /), intended to run behind nginx, while the backend runs as a long-lived Node process. See bin/install-deps.sh for initial host provisioning. Run bin/deploy.sh --help for available flags.

License

Released under the MIT License.

About

No description or website provided.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Contributors