# LCAR.earth Weather Dashboard Live weather station dashboard for WeatherFlow Tempest data. ## Quick Start (Docker) 1. Configure environment: ```bash cp .env.example .env ``` Edit `.env` with your InfluxDB credentials: ``` INFLUX_HOST=your_influxdb_host INFLUX_PORT=8086 INFLUX_DATABASE=homeassistant INFLUX_USERNAME=your_username INFLUX_PASSWORD=your_password ``` 2. Build and run: ```bash docker-compose up -d ``` 3. Access at `http://localhost:3000` To view logs: ```bash docker-compose logs -f ``` To stop: ```bash docker-compose down ``` ## Manual Setup (Non-Docker) 1. Install dependencies: ```bash npm install ``` 2. Configure InfluxDB connection: ```bash cp .env.example .env ``` Edit `.env` with your InfluxDB credentials. 3. Run the server: ```bash npm start ``` Development mode with auto-reload: ```bash npm run dev ``` ## Production Deployment ### Docker with Nginx Add Nginx service to `docker-compose.yml` (see commented section), then: ```bash docker-compose up -d ``` Set up SSL with certbot on host machine, volumes are already mapped. ### With Nginx 1. Install PM2 to keep the app running: ```bash npm install -g pm2 pm2 start server.js --name weather pm2 save pm2 startup ``` 2. Configure Nginx as reverse proxy (`/etc/nginx/sites-available/lcar.earth`): ```nginx server { listen 80; server_name lcar.earth www.lcar.earth; location / { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } ``` 3. Enable the site: ```bash sudo ln -s /etc/nginx/sites-available/lcar.earth /etc/nginx/sites-enabled/ sudo nginx -t sudo systemctl reload nginx ``` 4. Set up SSL with Let's Encrypt: ```bash sudo apt install certbot python3-certbot-nginx sudo certbot --nginx -d lcar.earth -d www.lcar.earth ``` ### Systemd Service (alternative to PM2) Create `/etc/systemd/system/weather-dashboard.service`: ```ini [Unit] Description=LCAR.earth Weather Dashboard After=network.target [Service] Type=simple User=your_user WorkingDirectory=/home/dx/code/weather Environment=NODE_ENV=production ExecStart=/usr/bin/node server.js Restart=always [Install] WantedBy=multi-user.target ``` Enable and start: ```bash sudo systemctl enable weather-dashboard sudo systemctl start weather-dashboard ``` ## Data Requirements The application expects InfluxDB measurements with entity_id matching `/tempest/`: - `temperature` - `humidity` - `pressure` - `wind_speed` - `wind_direction` - `precipitation` - `uv_index` - `solar_radiation` If your Home Assistant entities use different names, update the queries in `server.js`.