- JavaScript 92%
- HTML 5.7%
- Shell 1.1%
- CSS 1%
- Nix 0.1%
- Other 0.1%
| .forgejo | ||
| .dockerignore | ||
| .gitignore | ||
| compose.yaml | ||
| Dockerfile | ||
| index.html | ||
| README.md | ||
| server.js | ||
| shell.nix | ||
| styles.css | ||
| theme-config.js | ||
| theme.js | ||
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:
- Builds and smoke-tests the image on push.
- On
main, publishes the image to the Forgejo container registry as a package tagged with the commit SHA andlatest. - 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_HOSTDEPLOY_USERDEPLOY_SSH_KEYDEPLOY_PORTif you do not want the default SSH port 22APP_PORTif you do not want the default app port 8080USERNAME_FORGEJOTOKEN_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.