Skip to content

leneffets/can-i-wash-tomorrow

Repository files navigation

Can I Wash Tomorrow SPA

A mobile-friendly React + Vite single-page app for Berlin's weather and solar forecast, ready for GitHub Pages deployment.

Features

  • PWA support - install as app on mobile/tablet (iOS, Android, desktop)
  • Fetches weather forecast for Berlin from Open-Meteo API
  • Displays temperature, weather code (with icons/tooltips), sunshine hours, sunrise/sunset
  • Highlights current date row
  • Two toggles: show/hide estimated solar power, show/hide sunrise/sunset (states saved in localStorage)
  • Smart solar power prediction using shortwave radiation and sunshine hours:
    • Daily and hourly production estimates based on historical patterns
    • Uses shortwave radiation (preferred) or sunshine hours with monthly adjustment
    • Click any day to see detailed hourly weather and power estimates
  • Interactive features:
    • Expandable rows show hourly weather and estimated production
    • Current hour highlighted in hourly view
    • Automatic scrolling to current hour for today's expanded view
  • Chart.js graphs for estimated power and historical production
  • Mixed hourly Chart.js graph on day click with temperature, sunhours, and expected production
  • Responsive, plain CSS (no Tailwind)

Project Structure

  • src/App.jsx: Main app logic
  • src/components/Card.jsx, CardContent.jsx: Card UI components
  • src/index.css: Styles for cards, tables, toggles, etc.
  • .devcontainer/devcontainer.json: Node dev container
  • .github/workflows/deploy.yml: GitHub Pages auto-deploy
  • vite.config.js, index.html, package.json: Vite/React setup
  • enrich_solar_data.js: Enriches your CSV production data with sunshine hours and shortwave radiation, computing kWh-per-hour and kWh-per-radiation factors (writes output.json, output.csv, and monthly averages)

Local Development

npm install
npm run dev

Install as App

On mobile/tablet, open in Chrome or Safari, then:

  • Chrome/Android: Menu → "Install app" or "Add to Home screen"
  • Safari/iOS: Share → "Add to Home Screen"
  • Desktop: Address bar install icon (Edge/Chrome)

Build & Deploy

npm run build

Push to main branch to auto-deploy via GitHub Actions.

Alexa Skill

A private Alexa-hosted skill for the balcony solar forecast lives in alexa/. It reuses the same Open-Meteo forecast inputs and monthly production factors, and can be invoked as Balkonkraftwerk after importing the interaction model and hosted Lambda package.

Data Enrichment

node enrich_solar_data.js input.csv
# Produces output.json (with radiation data), output.csv, and output_monthly.json (conversion factors)

API & Libraries

License

MIT (see LICENSE)

About

A mobile-friendly weather and solar forecast app for Berlin that helps you decide the best day to wash clothes. Shows temperature, weather conditions, sunshine hours, sunrise/sunset, and estimates solar power production. Built with React + Vite.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors