Skip to content

themannnphil/coastal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

24 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌊 Smart Coastal Flood Monitoring System – Team TideWatch

Project Title: TideWatch – Real-Time Coastal Flood Monitoring & Early Warning System Competition: Gaiathon Africa 2025 Team: Team TideWatch Team Lead: [Prince Philips Adorboe] Members: [Nkansah Tabi], [Thelma Akuffo], [Luqman]


🧠 Overview

TideWatch is a low-cost, solar-powered, smart buoy system designed to monitor critical coastal environmental conditions and provide real-time alerts for potential flooding. It is engineered to serve vulnerable coastal communities in Africa with limited access to high-tech flood detection infrastructure.

The system collects data via sensors on a buoy, transmits it via LoRa or GSM, processes it through a FastAPI backend, stores it in Firebase, and visualizes it through a modern, mobile-responsive dashboard built in Next.js.


πŸ’‘ Problem Statement

Coastal communities in Ghana and across Africa face increasing threats from rising sea levels, storm surges, and unpredictable flooding. Most regions lack localized, real-time monitoring tools to issue early warnings and prevent loss of life and property.


πŸš€ Features

  • Real-time environmental monitoring via smart buoy sensors
  • Data metrics: Wave height, water level, wind speed & direction, temperature, humidity, air pressure, rainfall
  • Secure data transmission over LoRa or GSM
  • Backend API with JWT authentication
  • Data storage using Firebase Realtime Database
  • Interactive web dashboard with charts, status indicators, and logs
  • Timeframe toggle (24h, 7d, 30d) with % change analytics
  • Mobile responsive and dark mode ready

πŸ› οΈ Tech Stack

  • Frontend: Next.js, TypeScript, TailwindCSS, Recharts, Zustand, React Query
  • Backend: FastAPI, Python, Firebase Admin SDK
  • Data Flow: MQTT, LoRa/GSM modules, JSON APIs
  • Auth: JWT-based secured API routes(currently not employed)
  • Database: PostgreSQL DB
  • Hardware: ESP32, waterproof pressure transducer, DHT11, LoRa module, solar panel and a Raspberry Pi Microprocessor.

πŸ“‚ Folder Structure

β”œβ”€β”€ frontend/                  # Next.js client app
β”‚   β”œβ”€β”€ pages/
β”‚   β”œβ”€β”€ components/
β”‚   β”œβ”€β”€ hooks/
β”‚   β”œβ”€β”€ store/
β”‚   └── public/
β”œβ”€β”€ backend/                  # FastAPI backend
β”‚   β”œβ”€β”€ main.py
β”‚   β”œβ”€β”€ auth.py
β”‚   └──  routes/


βš™οΈ How to Run Locally

πŸ”Ή Prerequisites

  • Node.js v18+
  • Python 3.9+
  • PostgreSql account & credentials

πŸ”Ή Setup Frontend

cd frontend
npm install
npm run dev

πŸ”Ή Setup Backend

cd backend
```activate virtual environment ```
uvicorn main:app --reload

Create .env files in both frontend/ and backend/ using the .env.example templates.


πŸ“ˆ Example API Endpoints

POST /api/ingest         # Store sensor data
GET  /api/metrics?timeframe=24h   # Get metric history
GET  /api/logs           # Recent threshold breach logs

πŸ“Š Sample Metrics Schema

{
  "name": "Wave Height",
  "unit": "cm",
  "value": 142,
  "status": "warning",
  "change": 9.8,
  "history": [
    { "timestamp": "2024-05-28T12:00:00Z", "value": 130 },
    { "timestamp": "2024-05-28T13:00:00Z", "value": 140 },
    { "timestamp": "2024-05-28T14:00:00Z", "value": 142 }
  ]
}

πŸ” Environment Variables

# frontend/.env.local
NEXT_PUBLIC_API_KEY=your_public_token

# backend/.env

PostgreSql Database= coastal_db
PostgreSql password= ******

🌍 Impact

  • Provides real-time flood warnings for vulnerable coastal populations
  • Can be locally assembled using low-cost materials
  • Adaptable for disaster response, climate research, education

🎯 Future Plans

  • Add real-time MQTT β†’ WebSocket pipeline
  • Integrate machine learning for flood prediction (future implementation)
  • Scale deployments to additional West African countries
  • Offline-first Web app for remote field authorised access.

🀝 Acknowledgements

  • University Of Ghana, Legon
  • School of Engineering Sciences, UG
  • Computer Engineering Department @SES, UG
  • Gaiathon Africa Competitions
  • Open source libraries and community contributors & pROJECT sUPERVISORS
  • Ghana’s coastal communities for inspiring this project

πŸ“Έ Screenshot of the Web App

web dashboard

πŸ“ΈπŸ”§ Picture of the IoT System

Coming soon*

Team Lead: [Prince Phil] – [princephil403@gmail.com] GitHub Repo: (https://github.com/themannnphil/coastal)

β€œWe’re building the low-cost, real-time early warning system Africa needs to stay ahead of the tide.” 🌊

About

Dashboard for a Coastal monitoring and early warning alarm system for GAITHON AFRICA Competition

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors