Skip to main content

AquaGen API Documentation

AquaGen API is a Flask-based water management IoT platform that collects sensor data from field devices, processes it into actionable reports and alerts, and exposes a REST API for web and mobile clients. It is designed to run cloud-native on Microsoft Azure.

Key Features​

  • Multi-format reports — generate reports as HTML, PDF, XLSX, or CSV from a single request
  • Real-time IoT monitoring — ingests readings from flow, level, quality, energy, and borewell sensors via Storm
  • Multi-channel alerts — delivers threshold and anomaly alerts over Email, SMS, Firebase Cloud Messaging, and Google Chat
  • Water balance analysis — models inflow/outflow graphs and computes the Water Neutrality Index (WNI)
  • Multi-tenancy — manage multiple industries and facilities from a single platform
  • Azure cloud-native — built around Azure Cosmos DB, Azure Key Vault, Azure Blob Storage, and Azure Application Insights
  • Enterprise security — JWT authentication with Azure AD integration, input validation, and Key Vault secret management
  • Executive summary — cross-industry dashboard that aggregates and compares water consumption data across multiple facilities for management reporting
  • SCADA diagram editor — configurable visual process-flow diagrams with nodes, edges, and real-time sensor data overlays
  • RO efficiency tracking — monitors reverse-osmosis plant performance and logs activity with trend-based insights
  • Lake Pulse — satellite and sensor-based lake health monitoring with water quality index, water availability trends, and CPCB-standard point trend analysis
  • GWI — groundwater level intelligence computed from borewell sensor readings
  • FWI — fresh water intelligence with step-based data collection
  • Virtual / manual node entry — allows manual data entry for water, quality, level, energy, and piezometer readings where physical sensors are absent
  • Rainfall data tracking — collects and reports rainwater measurements alongside surface water data
  • Automated scheduled reports — admin-triggered batch report delivery via email on a scheduled basis
  • Flexible authentication — supports Default, Microsoft SSO, Google SSO, OTP, and External login modes
  • Role-based access control — fine-grained permission system (Super User, Admin, User, and feature-level flags such as Water Balance, Efficiency, UWI, RWI, Water Neutrality)

Use Cases​

Water Management​

  • Monitor water consumption across multiple sources and facilities
  • Track water levels in tanks, reservoirs, and borewells
  • Generate compliance and operational reports

IoT Device Monitoring​

  • Real-time data from flow meters, level sensors, and quality analyzers
  • Device health monitoring and offline detection
  • Historical data analysis and trend visualization

Energy Monitoring​

  • Track power consumption for water pumps and treatment systems
  • Correlate energy usage with water production

Water Quality​

  • Monitor quality parameters (pH, TDS, COD, BOD, DO, etc.)
  • Generate quality compliance reports

Architecture Highlights​

info
  • Layered Architecture: Auth → Routes → Services → Formatters pattern for clean separation of concerns
  • 10 Report Types: Daily, Monthly, Hourly, Granular, Weekly, Custom, Summary, Daily Range, Monthly Range
  • Multi-format Output: HTML, PDF, XLSX, CSV generated via ReportLab, xhtml2pdf, and xlsxwriter

Technology Stack​

ComponentTechnology
Web FrameworkFlask 2.3.3 + Flask-RESTX
DatabaseAzure Cosmos DB (SQL API)
AuthenticationFlask-JWT-Extended + Azure AD
Secret ManagementAzure Key Vault
Report GenerationReportLab / xhtml2pdf / xlsxwriter
Data ProcessingPandas / NumPy / SciPy
MonitoringAzure Application Insights
IoT ConnectivityStorm

Documentation Sections​

SectionDescriptionLink
Getting StartedSetup, installation, and first stepsGetting Started
ArchitectureSystem design, components, and data flowArchitecture Overview
Core ConceptsAuthentication, services, formatters, reportsAuthentication
API ReferenceAll endpoints with request/response examplesUser API
GuidesStep-by-step tutorials for common tasksReport Generation
DeploymentAzure setup, configuration, and securityAzure Setup
Advanced TopicsWater balance, external integrations, performanceExternal Integrations
DevelopmentContributing, testing, and extending the APIProject Structure