Skip to content

This repository contains the code of a Java-based mobile application University project (03/2024) and its backend Firebase Cloud Functions for a very simple real-time Civil Protection Alert System. The system enables users to report incidents like Fires, Floods, and Earthquakes, calculate their threat level, and send proximity-based alerts to users

Notifications You must be signed in to change notification settings

Anastasis-M/Smart-Alert

Repository files navigation

🚨 Civil Protection Alert System

This repository contains the code of a Java-based mobile application University project (03/2024) and its backend Firebase Cloud Functions for a very simple real-time Civil Protection Alert System. The system enables users to report incidents like Fires, Floods, and Earthquakes, calculate their threat level, and send proximity-based alerts to users in the affected area.

📱 App Overview

SmartAlert enables:

  • Incident Submission: Registered users submit high‑risk events with type, comments, auto‑captured location, timestamp, and photo.
  • Danger Scoring: A Firebase Cloud Function computes a "danger score" grouping nearby incidents within a time window.
  • Automated Alerts: Once scored as alert, another Cloud Function notifies users within a configurable radius via FCM.
  • Multilingual UI: Supports Greek and English.
  • Statistics: Users can view how many incidents are on alert status.
  • Authentication: Firebase Authentication for login.

🎥 Screenshots & Demo

Register/Login Statistics Sumbit incident image

Watch two demo videos
submitincident.mov
admin.mp4

🔧 Usage

  1. Register/Login: Sign in with email & password.
  2. Submit Incident: Choose type (Fire, Flood, or Earthquake), add comments & upload photo. Your location is automatically captured.
  3. Await Processing:
    • Backend calculates danger score; incident status progresses from pendingscored
    • Admin users review scored incidents and can approve (change to alert) or reject them
  4. Receive Alerts: If you're within the configured radius of an approved incident (1500m for Fire, 1000m for Flood, 3000m for Earthquake), you'll receive a push notification.
  5. View Statistics: Open the "Statistics" screen to see counts of alerts by incident type.

⚙️ Firebase Cloud Functions

The functions/index.js contains two main triggers:

  • calculateDangerScore Runs when a new incident is added, groups incidents by proximity & time, computes danger_score.

  • sendAlerts Fires when an incident's status changes to alert, sends FCM notifications to nearby users based on their location data to warn them of potential danger in their vicinity.

👥 Contributors

About

This repository contains the code of a Java-based mobile application University project (03/2024) and its backend Firebase Cloud Functions for a very simple real-time Civil Protection Alert System. The system enables users to report incidents like Fires, Floods, and Earthquakes, calculate their threat level, and send proximity-based alerts to users

Topics

Resources

Stars

Watchers

Forks