• JavaScript 92%
  • HTML 5.7%
  • Shell 1.1%
  • CSS 1%
  • Nix 0.1%
  • Other 0.1%
Find a file
Arthur Sommer dcd3394763
All checks were successful
ci / build (push) Successful in 50s
ci / deploy (push) Successful in 23s
Reduce scroll paint cost
2026-06-24 20:04:27 -04:00
.forgejo Show deployed commit in footer 2026-06-20 11:46:34 -04:00
.dockerignore Add weather dashboard with AFD and HWO insights 2026-06-06 00:25:07 -04:00
.gitignore Add weather dashboard with AFD and HWO insights 2026-06-06 00:25:07 -04:00
compose.yaml Add weather dashboard with AFD and HWO insights 2026-06-06 00:25:07 -04:00
Dockerfile Show deployed commit in footer 2026-06-20 11:46:34 -04:00
index.html Reduce scroll paint cost 2026-06-24 20:04:27 -04:00
README.md Run deploy after CI in one workflow 2026-06-07 22:08:39 -04:00
server.js Reduce scroll paint cost 2026-06-24 20:04:27 -04:00
shell.nix Add weather dashboard with AFD and HWO insights 2026-06-06 00:25:07 -04:00
styles.css Reduce scroll paint cost 2026-06-24 20:04:27 -04:00
theme-config.js Add weather dashboard with AFD and HWO insights 2026-06-06 00:25:07 -04:00
theme.js Refine weather discussion cards 2026-06-06 10:46:39 -04:00

NWS Weather Desk

Tailwind and htmx dashboard for weather.gov data.

Features

  • Point-based forecast lookup from api.weather.gov
  • Place search by city, ZIP, or place name
  • Hourly trend chart
  • Seven-day forecast cards with discussion overlays
  • Active alerts panel
  • Area Forecast Discussion rendering
  • Optional local Ollama summary for the AFD digest
  • Light and dark modes
  • Tailwind-powered shell with htmx swapping the dashboard fragment

Local development

Use the provided Nix shell:

nix-shell

Run the app directly:

node server.js

Then open http://127.0.0.1:8080.

Optional local LLM summary

If OPENAI_API_KEY is set, the AFD summary uses OpenAI first with gpt-4.1-nano by default. That is the small-model path.

If you want to force the local model instead, start Ollama and set:

export AFD_SUMMARY_PROVIDER=ollama
export AFD_SUMMARY_MODEL=llama3.2:1b

The app will try OLLAMA_HOST if you set it, otherwise it uses http://127.0.0.1:11434. If neither OpenAI nor Ollama is available, it falls back to the built-in text extractor.

Forecast results are cached per location for 5 minutes by default so refreshes do not re-hit weather.gov unless the cache expires. Set WEATHER_CACHE_TTL_MS if you want a different window.

If you want to preview just the shell as a static file, one simple option is:

python3 -m http.server 8080

Docker

Build and run locally:

docker compose up --build

Then open http://127.0.0.1:8080.

Forgejo CI and deploy

The workflow in .forgejo/workflows/ci.yml does three things:

  1. Builds and smoke-tests the image on push.
  2. On main, publishes the image to the Forgejo container registry as a package tagged with the commit SHA and latest.
  3. On main, saves the image, copies it to your target host over SSH, loads it into Docker, and restarts the container.

Required secrets for deploy:

  • DEPLOY_HOST
  • DEPLOY_USER
  • DEPLOY_SSH_KEY
  • DEPLOY_PORT if you do not want the default SSH port 22
  • APP_PORT if you do not want the default app port 8080
  • USERNAME_FORGEJO
  • TOKEN_FORGEJO

The Forgejo registry image path is ${forgejo-host}/${owner}/${repository}:${sha}.

The target host needs Docker and SSH access. The deploy job now pulls the exact image from the Forgejo registry on main before restarting the container.