Skip to content

KBREX684/Guardian

Repository files navigation

Guardian

Your Personal Weather Safety Companion

Guardian is a WeatherWise Hack 2026 project that turns weather data into personal, actionable safety guidance. It does not only answer "What is the weather?" It answers "What does this weather mean for me, and what should I do next?"

Hackathon Alignment

Guardian aligns with three WeatherWise Hack tracks:

  • Weather Intelligence: real-time weather risk assessment using Open-Meteo data.
  • Disaster Response & Preparedness: personalized action plans and emergency safety cards.
  • Offline & Rural Accessibility: PWA shell, service worker caching, and IndexedDB persistence for low-connectivity use.

Problem

The same typhoon warning can mean very different things to different people. A 72-year-old living alone on the ground floor, a parent with an infant, and a chronic patient who depends on daily medication do not need the same advice.

Most weather apps give generic alerts. Guardian adds a personal vulnerability profile, calculates individual risk, and lets users practice disaster decisions before a real emergency happens.

Core Features

  • Conversational profile builder: 8 questions generate a multi-factor vulnerability score.
  • Personal risk dashboard: combines live weather conditions with the user's profile.
  • Three-person contrast view: shows how the same weather creates different risks for different people.
  • Practice Mode: interactive decision-tree simulations for typhoon, flood, and heatwave scenarios.
  • Offline safety card: printable and shareable card with top actions and emergency contacts.
  • PWA support: app shell and weather API responses are cached through a custom service worker.

Demo Flow

Use this path for judging or video recording:

  1. Open the landing page.
  2. Choose Typhoon Scenario - Taipei in Demo Quick Start.
  3. Complete the 8-question profile builder.
  4. Review the personalized dashboard.
  5. Open Show Comparison to see three-person risk differences.
  6. Run Practice Mode with the typhoon scenario.
  7. Open and print/share the Safety Card.

Tech Stack

Area Technology
Framework Next.js 15 App Router
Language TypeScript
UI React 19, Tailwind CSS
State Zustand
Persistence IndexedDB
Weather API Open-Meteo
Motion Framer Motion
Icons Lucide React
Testing Vitest
Offline Custom Service Worker + Cache API

Architecture

src/
  app/                 Next.js routes
  components/          UI components for dashboard, practice, safety, chat
  engine/
    profile/           Vulnerability profile scoring
    risk/              Weather + profile risk calculation
    practice/          Disaster decision trees
    scenario/          Personalized scenario generation
  hooks/               React hooks around stores and browser state
  lib/                 Weather API, IndexedDB, utility helpers
  store/               Zustand stores
  types/               TypeScript contracts
public/
  sw.js                Custom service worker
  manifest.json        PWA manifest

Risk Engine

Guardian scores eight vulnerability factors:

  • flood risk
  • elderly care
  • medication dependency
  • child care
  • mobility constraints
  • medical access
  • preparedness
  • temperature vulnerability

The final profile score is normalized to 0-100. Personal weather risk is calculated as:

PersonalRisk = WeatherRisk * (1 + VulnerabilityModifier)
VulnerabilityModifier = (VulnerabilityScore - 50) / 100

The action engine then generates recommendations based on disaster type, risk score, and profile-specific factors.

Getting Started

npm install
npm run dev

Open:

http://localhost:3000

Scripts

npm run dev      # Start local development server
npm run build    # Create production build
npm start        # Start production server
npm run lint     # Run Next.js lint checks
npm test         # Run Vitest tests

Quality Checks

Before submission, run:

npm test
npx tsc --noEmit
npm run lint
npm audit --audit-level=moderate
npm run build

Current regression coverage includes:

  • vulnerability score normalization
  • personal risk amplification for vulnerable users
  • personalized scenario generation
  • location-scoped weather cache

Deployment

Recommended deployment target: Vercel.

  1. Push this repository to GitHub.
  2. Import the repository at https://vercel.com/new.
  3. Use the default Next.js settings.
  4. No environment variables are required.
  5. Use the production URL as the Devpost demo link.

Devpost Summary

Short pitch: Guardian tells people what the weather means for them personally, then lets them practice disaster decisions before real danger arrives.

Built with: Next.js, TypeScript, React, Zustand, IndexedDB, Open-Meteo, Vitest, PWA APIs.

Impact: Helps vulnerable people and families prepare for floods, typhoons, and heatwaves with personal guidance instead of generic alerts.

Limitations

Guardian is a preparedness and awareness tool, not an official emergency service. Users should always follow local authorities and official emergency alerts during real disasters.

Future Work

  • SMS or WhatsApp alert delivery.
  • Community vulnerability maps.
  • More disaster scenarios, including wildfire and earthquake.
  • Voice-first profile building for low-literacy users.
  • Integration with official emergency alert systems.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors