Taranगिनी is a coastal disaster alert system that scrapes real-time alerts from INCOIS (Indian National Centre for Ocean Information Services) and displays them on an interactive web interface.
┌─────────────────┐
│ INCOIS Website │
│ (incois.gov.in) │
└────────┬────────┘
│
│ Scrapes alerts
▼
┌─────────────────────┐
│ incois_scraper.py │
│ (Python Script) │
└─────────┬───────────┘
│
│ Saves to
▼
┌─────────────────────┐
│ alerts.json │
│ (Data Storage) │
└─────────┬───────────┘
│
│ Loaded by
▼
┌─────────────────────┐
│ main.py │
│ (FastAPI Backend) │
│ - /alerts API │
│ - /refresh-alerts │
└─────────┬───────────┘
│
│ Serves data via API
▼
┌─────────────────────┐
│ index.html │
│ (Frontend UI) │
│ - Displays alerts │
│ - Refresh button │
└─────────────────────┘
python -m venv .venv
source .venv/bin/activate # On Windows: .\.venv\Scripts\activate
pip install -r requirements.txtpython incois_scraper.pyThis creates/updates alerts.json with the latest alerts from INCOIS.
python -m uvicorn main:app --reloadNavigate to: http://127.0.0.1:8000
GET /- Main web interface (frontend)GET /alerts- JSON API returning all alertsGET /refresh-alerts- Runs the scraper and refreshes alertsGET /reload- Reloads alerts from alerts.jsonGET /db-view- Database viewer interfaceGET /alerts-nearby?lat=X&lng=Y&radius_km=Z- Get alerts near a location
Click the "🔄 Refresh Alerts" button on the homepage. This will:
- Run the scraper in the background
- Fetch latest alerts from INCOIS
- Update the database
- Refresh the display automatically
python incois_scraper.pyThe backend automatically reloads alerts.json on each page load.
curl http://localhost:8000/refresh-alertstarangini-alerts/
├── main.py # FastAPI backend server
├── incois_scraper.py # INCOIS website scraper
├── alerts.json # Scraped alerts data (auto-generated)
├── requirements.txt # Python dependencies
├── templates/
│ ├── index.html # Main frontend UI
│ └── db_view.html # Database viewer
├── static/
│ └── logo.jpg # Application logo
└── README.md # This file
- Backend: FastAPI, SQLModel, SQLite
- Frontend: HTML, CSS, JavaScript (Vanilla)
- Scraper: BeautifulSoup4, Requests, Geopy, Feedparser
- Deployment: Uvicorn (ASGI server)
The Alert model stores:
id- Unique identifiersource- Alert source (e.g., "INCOIS")severity- emergency, warning, info, or cautiontitle- Alert headlinemessage- Detailed alert messagetime- Timestamp when alert was recordedlat,lng- Geographic coordinates (optional)
✅ Real-time alert scraping from INCOIS
✅ Interactive web interface with alert cards
✅ One-click refresh from UI
✅ Severity-based color coding
✅ Location-based filtering via API
✅ Responsive mobile-friendly design
✅ Automatic fallback to sample data when offline
- The scraper generates sample alerts when INCOIS website is unreachable
- Alerts are automatically loaded from
alerts.jsonon each page load - The database (SQLite) is used as an intermediate layer for querying and filtering
Feel free to open issues or submit pull requests to improve the system!
This project is for educational and demonstration purposes.