๐ Real-time Groundwater Monitoring System for India
AquaWatch is a comprehensive web application that provides real-time monitoring and analysis of India's groundwater crisis across all states and union territories using Digital Water Level Recorder (DWLR) data from CGWB (Central Ground Water Board).
The platform offers critical insights into groundwater depletion, water availability, and population impact through an intuitive dashboard powered by 5,260+ DWLR sensor stations across India.
๐จ India's groundwater is depleting at an alarming rate. AquaWatch empowers citizens, policymakers, and researchers with real-time data to combat this crisis.
AquaWatch operates through 4 integrated phases:
PHASE 1: DATA ACQUISITION โ 5,260+ DWLR Sensors (CGWB Data)
PHASE 2: REAL-TIME PROCESSING โ FastAPI + Pandas (6-hour updates)
PHASE 3: PLATFORM & APP โ React Dashboard + Firebase Sync
PHASE 4: USER IMPACT โ Citizens, Policymakers, Researchers
For detailed architecture diagrams and flow charts, see the attached architecture images above.
- ๐ National Water Crisis Overview: Real-time monitoring of states in crisis with DWLR statistics
- ๐บ๏ธ State-wise DWLR Analysis: Detailed breakdown of water conditions across all 28 states + 8 UTs using DWLR measurements
- ๐ Interactive State Cards: Clickable cards with historical water level charts powered by DWLR sensors
- ๐ Trend Analysis: Up/down/stable water level trends from DWLR data (meters below ground level - m bgl)
- ๐ฅ User Management: Admin panel for managing users and monitoring engagement
- ๐ Real-time DWLR Sync: Automatic updates from 5,260+ DWLR stations every 6 hours
- ๐ Personal Groundwater Monitoring: Real-time tracking for user's selected state using DWLR sensor data
- ๐ Real-time Graphs: Interactive charts with DWLR historical trends and water level forecasts
- ๐ฆ Status Overview: Visual indicators (Critical/Warning/Normal/Good) based on DWLR water level percentages
- โก Quick Actions: Easy access to emergency contacts and water conservation solutions
- ๐ Historical Analysis: Multi-month trend data from DWLR measurements
- ๐งโ๐ผ Role-based Access: Admin vs User dashboards with state-specific permissions
- ๐ Firebase Authentication: Secure email-based login
- ๐ User Registration: Signup with state selection for personalized DWLR monitoring
- ๐ Session Management: Persistent secure sessions
- ๐ Crisis Alerts Panel: Real-time notifications for critical DWLR water levels
- ๐ Emergency Response Modal: Quick response procedures for groundwater crises
- โ๏ธ Emergency Contacts: State-wise emergency helplines
- ๐ฑ Alert System: Critical level notifications
- ๐ฑ Water Management Solutions: Evidence-based conservation strategies
- ๐ Data Methodology: Transparent DWLR data sources and processing pipeline
- ๐๏ธ Government Resources: CGWB guidelines and official policies
- ๐ฌ Research Data: Historical analysis from DWLR archives
- ๐ Dark/Light Theme: Automatic mode toggle
- ๐ฑ Responsive Design: Mobile-first for field monitoring
- โณ Loading Animations: Smooth experience with custom spinners
- โฟ Accessible Interface: WCAG compliant
- ๐งญ Mobile Navigation: Collapsible menu
AquaWatch_1.0/
โโโ ๐ฅ๏ธ frontend/ # React + TypeScript Web Application
โ โโโ src/
โ โ โโโ ๐ App.tsx # Main application component
โ โ โโโ ๐ main.tsx # Entry point
โ โ โโโ ๐จ index.css # Global styles
โ โ โโโ ๐พ components/ # Reusable UI Components
โ โ โ โโโ AdminDashboard.tsx # ๐ Admin panel with state analytics
โ โ โ โโโ AdminLogin.tsx # ๐ Admin authentication
โ โ โ โโโ AdminLoadingSpinner.tsx # โณ Loading animation
โ โ โ โโโ UserDashboard.tsx # ๐ค User's groundwater dashboard
โ โ โ โโโ UserLogin.tsx # ๐ User login page
โ โ โ โโโ UserSignup.tsx # โ๏ธ User registration
โ โ โ โโโ UserDatabase.tsx # ๐ User data management
โ โ โ โโโ AlertsPanel.tsx # ๐จ Alert notifications system
โ โ โ โโโ EmergencyModal.tsx # ๐ Emergency response modal
โ โ โ โโโ RealTimeGraph.tsx # ๐ DWLR data visualization
โ โ โ โโโ StateDetailsPopup.tsx # ๐บ๏ธ State-specific water info
โ โ โ โโโ Solutions.tsx # ๐ก Water management solutions
โ โ โ โโโ DataMethodologyModal.tsx # ๐ Data transparency info
โ โ โ โโโ Authentication.tsx # ๐ Auth context component
โ โ โ โโโ RoleSelection.tsx # ๐ฅ User role selector
โ โ โ โโโ Header.tsx # ๐ฏ Navigation header
โ โ โ โโโ Footer.tsx # ๐ Footer section
โ โ โ โโโ LoadingScreen.tsx # โณ Initial loading screen
โ โ โ โโโ LoadingSpinner.tsx # ๐ Custom spinner
โ โ โ โโโ ThemeToggle.tsx # ๐ Dark/Light mode
โ โ โโโ ๐ contexts/ # Global State Management
โ โ โ โโโ AuthContext.tsx # ๐ Authentication state
โ โ โ โโโ ThemeContext.tsx # ๐จ Theme configuration
โ โ โ โโโ WaterDataContext.tsx # ๐ง DWLR data state
โ โ โโโ ๐ฅ firebase/ # Firebase Configuration
โ โ โ โโโ config.ts # Firebase initialization
โ โ โโโ ๐ pages/ # Page-level Components
โ โ โ โโโ LandingPage.tsx # ๐ Home/landing page
โ โ โ โโโ AlertsPage.tsx # ๐จ Alerts dashboard
โ โ โ โโโ SolutionsPage.tsx # ๐ก Solutions page
โ โ โโโ ๐ ๏ธ utils/ # Utility Functions
โ โ โโโ dataUtils.ts # DWLR data parsing & conversion
โ โโโ ๐ฆ public/ # Static assets
โ โโโ ๐ package.json # Node dependencies
โ โโโ โ๏ธ vite.config.ts # Vite build configuration
โ โโโ ๐ฆ tsconfig.json # TypeScript configuration
โ โโโ ๐งน eslint.config.js # ESLint rules
โ
โโโ ๐ backend/ # Python FastAPI Server
โ โโโ ๐ main.py # FastAPI application with DWLR data sync
โ โ # - File watcher for CSV changes
โ โ # - Batch upload to Firebase (โค500 writes)
โ โ # - Real-time DWLR state synchronization
โ โโโ ๐ data/
โ โ โโโ dwlr_india.csv # ๐ด CGWB DWLR Dataset
โ โ # - 5,260+ monitoring stations
โ โ # - All 28 states + 8 UTs
โ โ # - Water levels in meters below ground (m bgl)
โ โ # - Updated every 6 hours
โ โโโ ๐ requirements.txt # Python dependencies (future)
โ โโโ ๐ .gitignore # Ignore data & credentials
โ
โโโ ๐ README.md # Project documentation
โโโ ๐ .env # Environment variables
| Component | Technology | Version |
|---|---|---|
| Framework | โ๏ธ React | 19.2.1 |
| Language | ๐ฆ TypeScript | 5.5.3 |
| Build Tool | โก Vite | 7.1.5 |
| Styling | ๐จ Tailwind CSS | 3.4.1 |
| UI Components | ๐ Styled-Components | 6.1.19 |
| State Management | ๐ React Context API | Native |
| Charting | ๐ Recharts | 3.2.0 |
| Icons | ๐ฏ Lucide React | 0.344.0 |
| Animations | ๐ฌ Framer Motion | 12.23.12 |
| Routing | ๐บ๏ธ React Router v7 | 7.8.2 |
| Firebase | ๐ฅ Firebase SDK | 12.2.1 |
| Linting | โ ESLint | 9.9.1 |
| Component | Technology | Version |
|---|---|---|
| Framework | ๐ FastAPI | 0.110 |
| Server | ๐ Uvicorn | Latest |
| Language | ๐ Python | 3.13.7 |
| Data Processing | ๐ Pandas | Latest |
| Database | ๐ฅ Firebase Firestore | Cloud |
| File Monitoring | ๐ Watchdog | Latest |
| Environment | โ๏ธ Python-dotenv | Latest |
| Service | Purpose |
|---|---|
| ๐ฅ Firebase | Real-time Firestore database + Authentication |
| ๐ Cloud Firestore | DWLR_state collection for state-wise data |
| ๐ Firebase Auth | Email/password authentication |
Before you begin, ensure you have:
- ๐ฆ Node.js v18 or higher (Download)
- ๐ Python 3.8+ (for backend API - optional)
- ๐ ๏ธ npm or yarn package manager
- ๐ฅ Firebase Account (for backend connectivity - optional)
- ๐ Git for cloning the repository
-
Clone the repository
git clone https://github.com/KGFCH2/AquaWatch_1.0.git cd AquaWatch_1.0 -
Install frontend dependencies
cd frontend npm installโ ๏ธ Note: If you encounterstyled-componentsimport errors, run:npm install styled-components @types/styled-components
-
Configure Firebase (Optional - for backend API)
Place your Firebase service account JSON key file in
backend/. Do not commit the key file or paste its contents into this README. Use a descriptive filename (for example,serviceAccountKey.json) and set its path via the backend.envvariableFIREBASE_CREDENTIALS_PATH. Ensure the key file is listed in.gitignore.
-
Start the frontend development server
cd frontend npm install npm run devThe application will be available at
http://localhost:5173๐Terminal Output Example:
VITE v7.1.5 ready in 450 ms โ Local: http://localhost:5173/ โ Press h to show help -
Build for production
npm run build
Generates optimized build in
frontend/dist/folder -
Preview production build locally
npm run preview
-
Run linting to check code quality
npm run lint
The backend processes DWLR CSV data and syncs with Firebase. It's optional for frontend-only development.
-
Install Python dependencies
cd backend pip install fastapi uvicorn pandas firebase-admin watchdog python-dotenv -
Prepare DWLR CSV data
- Place
dwlr_india.csvinbackend/data/directory - File should contain:
State, Date, Time, Water_Level_m_bglcolumns
- Place
-
Start the FastAPI server
python main.py
The API will be available at
http://localhost:8000Features:
- ๐ก File Watcher: Automatically detects CSV changes
- ๐ค Batch Upload: Uploads new rows to Firebase (โค500 per batch)
- ๐ Incremental Sync: Tracks last uploaded row index
- โป๏ธ Rollback Support: Handles data deletion/rollback scenarios
Digital Water Level Recorder (DWLR) - Automated groundwater monitoring network
| Metric | Details |
|---|---|
| ๐ Total Stations | 5,260+ DWLR monitoring stations across India |
| ๐บ๏ธ Coverage | All 28 states + 8 union territories |
| ๐ Measurement Unit | Meters Below Ground Level (m bgl) |
| โฑ๏ธ Update Frequency | Every 6 hours (automated sync from CGWB) |
| ๐ฌ Data Source | Central Ground Water Board (CGWB), Ministry of Jal Shakti |
| ๐ฏ Accuracy | ยฑ0.1 meters per CGWB specifications |
| ๐ File Format | CSV with State, Date, Time, Water_Level_m_bgl |
State,Date,Time,Water_Level_m_bgl
Andhra Pradesh,9/4/2025,0:00:00,6.56
Maharashtra,9/4/2025,6:00:00,15.89
Punjab,9/4/2025,12:00:00,8.21
Rajasthan,9/4/2025,18:00:00,42.15Fields Explained:
- State: Indian state/UT name
- Date: Measurement date (MM/DD/YYYY)
- Time: Measurement time (HH:MM:SS)
- Water_Level_m_bgl: Water depth below ground surface in meters
DWLR CSV File (CGWB)
โ [Backend/Python]
Parse & Validate (Pandas)
โ
Filter Incomplete Rows
โ
Organize by State
โ [Firebase Admin SDK]
Batch Upload to Firestore
โ [DWLR_state Collection]
State โ Subcollection (data)
โ [Real-time Sync]
Firebase Listeners
โ [Frontend/React]
Update Dashboard Components
โ
User Display (Charts, Maps, Alerts)
DWLR measurements are converted to percentage availability (0-100%):
| Water Level (% Availability) | Status | Color | Indicator | Action Required |
|---|---|---|---|---|
| 0-30% | ๐ด CRITICAL | Red | Severe drought | ๐จ Immediate intervention |
| 31-50% | ๐ HIGH STRESS | Orange | Significant stress | |
| 51-70% | ๐ก MODERATE | Yellow | Monitoring needed | ๐ Close monitoring |
| 71-100% | ๐ข GOOD | Green | Adequate supply | โ Normal conditions |
The backend performs multiple quality checks:
- โ Completeness: Ensures all required fields are present
- โ Format: Validates date/time and numeric values
- โ Range Check: Confirms water levels are within realistic bounds (0-50m bgl)
- โ Deduplication: Prevents duplicate entries in Firebase
- โ Incremental Updates: Only syncs new/modified rows
| Metric | Range | Status | Impact |
|---|---|---|---|
| Water Level (% availability) | 0-30% | ๐ด Critical | Severe drought conditions |
| Water Level (% availability) | 31-50% | ๐ High Stress | Water rationing needed |
| Water Level (% availability) | 51-70% | ๐ก Moderate | Monitoring required |
| Water Level (% availability) | 71-100% | ๐ข Good | Adequate water supply |
- ๐ Water Level Trends: Historical data analysis
- ๐ด Crisis Index: Real-time crisis status per state
- ๐ฅ User Engagement: Active users per state
- ๐ Regional Analysis: State-wise comparisons
- โฐ Temporal Patterns: Seasonal water variations
Firebase is used for:
- ๐ User authentication (Admin & User roles)
- ๐พ Real-time database (Firestore)
- ๐ฑ Data synchronization
- Go to Firebase Console
- Click "Create a new project"
- Name it "aquawatch" (or your preferred name)
- Enable Google Analytics (optional)
- Navigate to Firestore Database in left sidebar
- Click "Create Database"
- Choose "Production mode" โ "Next"
- Select region: "asia-south1 (Delhi)" โ "Enable"
- In Firestore, create collection:
DWLR_state - Set document ID as state name (e.g.,
Maharashtra)
- Go to Project Settings (gear icon) โ "General" tab
- Copy your Firebase config details
- Update
frontend/.envwith your credentials
# Firebase Configuration
VITE_FIREBASE_API_KEY=YOUR_API_KEY
VITE_FIREBASE_AUTH_DOMAIN=YOUR_PROJECT.firebaseapp.com
VITE_FIREBASE_PROJECT_ID=your-project-id
VITE_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
VITE_FIREBASE_MESSAGING_SENDER_ID=123456789
VITE_FIREBASE_APP_ID=1:123456789:web:xxxxx
VITE_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX# CSV Configuration
CSV_FILE=data/dwlr_india.csv
# Firebase Credentials
# Set this to the relative path of your service account JSON file (do NOT commit this file):
FIREBASE_CREDENTIALS_PATH=path/to/serviceAccountKey.json
# Firestore
COLLECTION_NAME=DWLR_state
# API Security
API_KEY=your-secure-api-keyDo not store actual API keys, service account JSON, or other secrets in README.md. Keep secrets in environment files (listed in .gitignore) or a secure secrets manager, and document only the variable names and how to set them.
Recommended Firestore security rules (in Firebase Console):
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
// Allow authenticated users to read DWLR_state data
match /DWLR_state/{state=**} {
allow read: if request.auth != null;
allow write: if request.auth.token.admin == true;
}
// Allow users to read/write their own user data
match /users/{userId} {
allow read, write: if request.auth.uid == userId;
}
}
}If you encounter any issues or bugs, please:
- ๐ Check the Issues page to see if it's already reported
- ๐ If not, create a new issue with:
- ๐ฅ๏ธ Your OS and environment details
โ ๏ธ Error messages/logs- ๐ท Screenshots (if applicable)
- ๐ Steps to reproduce
For general questions or suggestions, feel free to open a discussion thread.
| Issue | Solution |
|---|---|
โ styled-components not found |
npm install styled-components @types/styled-components |
| โ Port 5173 already in use | npm run dev -- --port 3000 |
| โ Firebase connection fails | Check .env credentials, verify Firestore is enabled |
| โ DWLR data not syncing | Ensure CSV exists, check Firebase credentials |
| โ TypeScript errors | rm -rf node_modules package-lock.json && npm install |
| Method | Endpoint | Description |
|---|---|---|
GET |
/today-data |
Today's DWLR data for all states |
GET |
/state-data |
DWLR data for specific state |
POST |
/sync |
Manually trigger CSVโFirebase sync |
Example Requests:
# Get today's data
curl "http://localhost:8000/today-data?api_key=YOUR_API_KEY"
# Get state data
curl "http://localhost:8000/state-data?state=Maharashtra&api_key=YOUR_API_KEY"
# Trigger sync
curl -X POST "http://localhost:8000/sync?api_key=YOUR_API_KEY"To empower India with real-time groundwater intelligence and enable data-driven solutions to the nation's water crisis.
- ๐ข Raise Awareness: About India's critical groundwater crisis using verified DWLR data from CGWB
- ๐จ Enable Fast Response: Quick emergency response procedures for water crises
- ๐ Data-Driven Policy: Support government agencies with actionable insights
- ๐ฑ Promote Conservation: Provide community-level solutions and water saving tips
- ๐ค Community Connect: Link citizens with resources, NGOs, and emergency support
| User Group | Benefits |
|---|---|
| ๐ฅ Citizens & Farmers | Real-time water availability, conservation tips, emergency alerts |
| ๐๏ธ Government Agencies | DWLR analytics, policy support, crisis prediction |
| ๐ฌ Researchers | Historical trends, groundwater evaluation data |
| ๐ NGOs & CSOs | Community awareness tools, disaster management support |
| ๐ฐ Media & Journalists | Data transparency, story angles on water crisis |
AquaWatch contributes to multiple UN SDGs:
- ๐ฏ SDG 6: Clean Water and Sanitation
- ๐ฏ SDG 13: Climate Action
- ๐ฏ SDG 15: Life on Land
We welcome contributions from developers, data scientists, designers, and water experts!
- ๐ด Fork the repository
- ๐ฟ Create a feature branch:
git checkout -b feature/YourFeature - ๐ป Make your changes with clear, documented code
- โ Test your changes locally
- ๐ Commit with meaningful messages:
git commit -m 'Add YourFeature' - ๐ค Push to branch:
git push origin feature/YourFeature - ๐ Create a Pull Request
- โ๏ธ Follow TypeScript strict mode
- โ๏ธ Add unit tests for new features
- โ๏ธ Update documentation in README
- โ๏ธ Maintain code consistency with ESLint
- โ๏ธ Write meaningful commit messages
- โ๏ธ Ensure Firebase security rules are updated
- ๐จ UI/UX Design: Improve dashboard aesthetics
- ๐ฑ Mobile Optimization: Better mobile responsiveness
- ๐ Internationalization: Support regional languages
- ๐ Data Visualization: Enhanced charts and maps
- ๐งช Testing: Unit & integration tests
- ๐ Documentation: API docs, user guides
- ๐ Backend Features: Advanced analytics, ML predictions
| Resource | Link |
|---|---|
| ๐ GitHub Repository | KGFCH2/AquaWatch_1.0 |
| ๐จ๐ผโ๐ป Creator | Babin Bid |
| ๐ง๐ปโ๐คโ๐ง๐ผ Contributors | Atanu Saha & Rohit Kumar Adak |
| ๐ Project Website | AquaWatch |
| ๐ CGWB Portal | cgwb.gov.in |
| ๐ Ministry of Jal Shakti | jalsakhti.gov.in |
The AquaWatch project is licensed under the MIT License, a permissive open-source license that allows for broad use, modification, and distribution of the software. The full text of the MIT License is available in the LICENSE file at the root of this repository.
- Copyright (c) 2025 AquaWatch: All rights are reserved by the copyright holder.
- Permission Granted: Free use, copying, modification, merging, publishing, distribution, sublicensing, and selling of the software is permitted without restriction.
- Condition: The copyright notice and permission notice must be included in all copies or substantial portions of the Software.
- Disclaimer: The software is provided "AS IS" without warranty of any kind.
- ๐ Open-Source Nature: AquaWatch is committed to open-source principles, promoting transparency, collaboration, and community-driven development.
- ๐ Permissive Licensing: The MIT License allows commercial use, private modifications, and redistribution, making it suitable for integration into various applications and services.
- ๐ค Community Contributions: Contributors must agree to license their contributions under the same MIT License.
- ๐ Attribution: Proper attribution to the original authors and the AquaWatch project is essential for maintaining credit and legal compliance.
- ๐ Use Freely: Utilize the software in personal, academic, or commercial projects without seeking permission.
- ๐ง Modify and Distribute: Make changes to the code and share your modifications with others.
- ๐ก Contribute: Submit pull requests, bug reports, and feature requests to improve the project.
- ๐ Include Copyright Notice: Always include the MIT License text and copyright notice when distributing copies of the software.
- ๐ Combine with Other Software: Integrate AquaWatch components into larger systems or applications.
- ๐ฌ Provide Feedback: Report issues, suggest improvements, and participate in discussions.
- ๐ซ Remove Copyright Notice: Do not delete or alter the copyright notice or license text from any distributed copies.
- ๐ซ Claim Ownership: Do not claim exclusive rights or ownership over the software or its derivatives.
- ๐ซ Misrepresent Origin: Avoid presenting modified versions as the original AquaWatch software without clear indication of changes.
- ๐ซ Violate Laws: Do not use the software for illegal purposes or in ways that infringe on other copyrights or trademarks.
- ๐ซ Expect Warranty: Do not rely on implied warranties; the software is provided without guarantees.
- ๐ซ Ignore Community Guidelines: Refrain from submitting contributions that violate the project's code of conduct or contribution guidelines.
- For commercial use, while the MIT License allows it, consider contributing back improvements or acknowledging the project in your products.
- If you have questions about licensing or contributions, please open an issue in the repository or contact the maintainers.
- This licensing information applies to all components of the AquaWatch project, including frontend, backend, and associated data files.
For the complete legal text, refer to the LICENSE file.
- ๐๏ธ Central Ground Water Board (CGWB) - For DWLR dataset and resources
- ๐ฎ๐ณ Ministry of Jal Shakti - Policy and guidance
- ๐ป Open Source Community - React, Firebase, Tailwind, FastAPI ecosystem
- ๐ฅ Contributors & Users - Your feedback and improvements
๐ง Monitoring Groundwater. Managing Crisis. Empowering Communities. ๐ง
Every drop counts. Every state matters. Every action helps.
Made with โค๏ธ for India's sustainable water future
๐ Last Updated: December 6, 2025 | ๐ Version: 1.0.0 | ๐ Status: Active Development

