DEV Community

Jai Singh Bisht
Jai Singh Bisht

Posted on

Building JalOS: Predictive Water Management with FastAPI, Flutter, React, and AWS

Tags: #webdev #machinelearning #flutter #aws

What if a residential society could estimate how long its water supply would last before the tanks ran low?

That question became the starting point for JalOS, an AI-powered predictive water management platform we developed during the Bharat Builds Tour: Environmental Hacks, organized by WeBuildDevs.

In this post, we'll walk through the problem, the architecture, the technology stack, and what we learned while building the prototype.

The Problem

Residential societies need to monitor water levels, estimate consumption, plan tanker deliveries, and respond to unexpected demand.

A current tank reading tells administrators how much water is available, but it doesn't necessarily tell them how long that supply will last.

We designed JalOS to connect current readings with demand estimates and operational information.

Architecture at a Glance

JalOS consists of three main components:

Backend: Python and FastAPI provide APIs and handle water-management logic.

Administrator portal: React and TypeScript provide a dashboard for inventory, tank levels, forecasts, tanker schedules, anomalies, maintenance, and complaints.

Resident application: Flutter provides a mobile interface for water information, usage guidance, alerts, and complaint submission.

The backend connects the web and mobile clients to the platform's shared functionality.

Core Features

  1. Water monitoring

The platform displays total water inventory and individual tank readings. Keeping these values consistent is important for reliable monitoring.

  1. Demand forecasting

We implemented a Ridge Regression model to estimate future water demand using structured time-series data.

  1. Water-runway estimation

The water-runway engine estimates how long the available supply may last before reaching a critical reserve or running out, based on expected consumption.

  1. Anomaly analysis

Unusual consumption patterns are highlighted for further investigation. These indicators can support early checks, but they don't independently confirm leaks or equipment failures.

  1. Community operations

Tanker planning, maintenance, alerts, and complaints connect water monitoring with the actions administrators may need to take.

Technology Stack

Layer

Technology

Backend API

Python, FastAPI

Forecasting

Ridge Regression

Web application

React, TypeScript

Mobile application

Flutter

Application packaging

Docker

Infrastructure as code

Terraform

CI/CD

GitHub Actions

Cloud services

Amazon Web Services

Our AWS setup includes EC2 for hosting, IAM for access control, Systems Manager Parameter Store for runtime configuration, S3 for deployment artifacts and model files, CloudWatch for application logs, and Systems Manager Run Command for deployment operations.

Deployment Workflow

Terraform helps define infrastructure as code, while GitHub Actions automates deployment.

The workflow uses OpenID Connect (OIDC) to obtain short-lived AWS credentials for authorized workflows rather than storing long-lived access keys in the workflow.

S3 supports artifact and model-file storage. CloudWatch collects application logs, and Systems Manager Run Command coordinates deployment operations on EC2 and supports application health verification.

This gave us an opportunity to consider deployment repeatability, access control, and monitoring alongside application development.

Team Contributions

Jai Singh Bisht — Backend and Infrastructure

I worked on FastAPI APIs, water-management logic, tank readings, inventory handling, water-runway calculations, and forecasting-model integration.

I also worked on EC2 deployment, Terraform infrastructure, IAM permissions, and runtime configuration through Systems Manager Parameter Store.

Tanishka Rawat — Frontend and DevOps

I worked on the Flutter resident application and the React and TypeScript administrator portal.

My deployment-related work included GitHub Actions automation, S3 artifact and model-file storage, CloudWatch log collection, OIDC-based AWS authentication, and Systems Manager Run Command for deployment coordination and health checks.

Engineering Challenges

One challenge was ensuring that total water inventory and individual tank readings remained consistent. We also had to account for environment-specific configuration when connecting the web and mobile clients to the backend.

Another important consideration was model validation.

Our current prototype uses synthetic water-demand data, and the forecasting model has been evaluated against a held-out synthetic test dataset. This is useful for testing the pipeline, but it does not establish real-world accuracy.

Validation against real residential water-meter readings and sensor data remains necessary.

What's Next?

Our next steps include:

Integrating real tank-level sensors and water meters.

Evaluating forecasts against actual consumption.

Improving anomaly detection and alerts.

Refining replenishment planning.

Testing usability and reliability in real residential environments.

Strengthening production security and deployment practices.

Conclusion

JalOS brought together backend engineering, frontend development, machine learning, and cloud infrastructure to explore a more proactive approach to residential water management.

The prototype is a starting point, not a claim that the problem is solved. Real-world data and further validation will be essential to understanding how effectively it can support actual housing societies.

Project: JalOS
GitHub: https://github.com/Jai-This-Side/JalOS-environmental-hackathon
Team: Jai Singh Bisht and Tanishka Rawat
Event: Bharat Builds Tour: Environmental Hacks, organized by WeBuildDevs
Cloud: Amazon Web Services

Top comments (0)