[go: up one dir, main page]

Skip to content

Tanachuns/dpas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Disaster Prediction and Alert System API

Scenario

You are tasked with building a Disaster Prediction and Alert System API for a government agency. This API will predict potential disaster risks (such as floods, earthquakes, and wildfires) for specified regions and send alerts to affected communities. The system integrates with external APIs to gather real-time environmental data and uses a simple scoring algorithm to assess risk levels.

Requirements

  • Build the API: Implement each endpoint with the specified functionality.
  • External API Integration: Set up integration with external environmental data sources for real-time data.
  • Caching with Redis: Use Redis to cache environmental data and risk calculations to minimize redundant external API calls.
  • Azure Deployment: Deploy the solution on Azure and provide a live demo.
  • Error Handling: Manage scenarios like:
    • Failed external API calls.
    • Missing data from external sources.
    • Regions with no available data.
  • Messaging API Integration: Implement alert-sending functionality via a messaging API to notify people in high-risk regions.
  • Logging: Track API usage and alerts for auditing purposes.

Stacks

Backend: .Net Core

Database: Postgres, Redis

Server: Azure

Logs: Serilog integrate with Azure

Others: Notion, Github

Submission

Start Date: 15/10/24

End Date: 21/10/24

Github Repository: https://github.com/Tanachuns/dpa-api

Presentation Video: https://www.youtube.com/watch?v=pajlCtBEIAc

API Url: https://dpa.tanabythepond.dev

Todos

  • Init project
  • Setup CI/CD
  • Setup Database
  • Setup Logs Integrated with Azure
  • Setup redis
  • [POST] /api/regions
  • [POST] /api/alert-settings
  • [GET] /api/disaster-risks
  • [POST] /api/alerts/send
  • [GET] /api/alerts

API Ref

Risk Calculation

Risk Criteria

  • Flood: Raining rates
  • EarthQuake: Magnitude
  • Wildfire: 100 - Humidity + Temp

Risk Level

  • Low = score < threshold / 3
  • Mid = score < threshold * (2 / 3)
  • High = score >= threshold

Knowledge Reference