The Remote Soil Moisture Monitoring System is a smart solution designed to help farmers optimize irrigation using real-time weather data, soil conditions, and predictive analytics. By leveraging remote data sources and modern technology, the system eliminates the need for physical sensors, making it cost-effective and scalable.
- Weather & Soil Data Analysis: Collects data from APIs (e.g., OpenWeatherMap, Open Meteo AI) to estimate soil moisture based on your current location.
- Irrigation Recommendations: Generates optimized schedules based on soil moisture predictions, land size, soil type and crop type.
- Interactive Dashboards: Visualizes soil trends, weather data uch as humidity and temperature, and irrigation plans.
- Sustainability: Promotes water conservation and climate resilience.
- Frontend: HTML, CSS, Javascript, Nginx, PHP for user interface and dashboard.
- Database: PostgreSQL for structured data storage and query optimization.
- Backend: PHP for data processing and integration.
- Monitoring: Datadog & Managed Service with Prometheus.
- Containerization & Orchestration: Kubernetes from Google Kubenertes Engine for scaling, deployment, and high availability.
- Testing: PHPUnit for PHP scripts.
- Continuous Integration/Delivery: GitHub Actions for automated pipelines.
- Nginx to render frontend pages fast
- Docker hub/ Docker desktop for containers and docker image creation
- Images of our trello board, find attached a link to the trello page: https://trello.com/b/tGpWEe0J/sustainable-urban-mobility-progress
- Aside Trello we used feature branches
- We used visual studio code for continuous development
Our project implements a robust CI pipeline using GitHub Actions to ensure code quality and reliability. The pipeline automatically runs whenever code changes are pushed to the main branch or pull requests are created.
- Automated Testing: Runs PHPUnit tests to verify code functionality
- Code Quality Checks:
- PHP Code Sniffer (PSR-12 standard)
- PHP-CS-Fixer for automatic code style fixes
- Basic PHP syntax validation
- Dependency Management: Automated Composer package installation and updates
- Environment Setup: Configures PHP 8.3 with required extensions
Our CI pipeline is configured in .github/workflows/ci.yml
and includes:
- Code checkout
- PHP environment setup
- Dependency installation
- Code quality analysis
- Automated testing
- Build verification
For detailed configuration, see our CI workflow file.
We used PHPUnit for unit testing. Syntax checking is done by PHP Code Sniffer.
Our project utilizes a robust deployment architecture combining Google Kubernetes Engine (GKE), Docker, and Kustomize for configuration management.
-
Google Kubernetes Engine (GKE)
- Created a new GKE cluster in Google Cloud Platform
- Configured cluster in us-central1 zone for optimal performance
- Set up IAM roles and permissions for team collaboration
-
Container Registry Setup
- Established Docker Hub repository for container images
- Created service accounts and authentication tokens
- Configured secure access between GitHub Actions and cloud services
Our application runs on four main containers:
-
Frontend Container
- Nginx-based web server
- Serves static content and handles routing
- Resources: 128Mi-256Mi memory, 100m-200m CPU
-
Backend Container
- PHP 8.3 with Apache
- Handles API requests and business logic
- Resources: 128Mi-512Mi memory, 100m-200m CPU
-
PostgreSQL Container
- Database server (PostgreSQL 15)
- Persistent storage with 10Gi volume
- Resources: 1Gi-2Gi memory, 500m-1000m CPU
-
PgAdmin Container
- Database management interface
- Resources: 128Mi-256Mi memory, 100m-200m CPU
Kustomize serves as our configuration management tool, providing:
- Resource customization without template modification
- Consistent deployment across environments
- Label and selector management
Our Kustomize structure:
kubernetes/
├── base/ # Base configurations
│ ├── backend.yaml
│ ├── frontend.yaml
│ ├── postgres-statefulset.yaml
│ └── pgadmin-deployment.yaml
└── overlays/ # Environment-specific configs
├── development/
└── production/
Our deployment process is fully automated through GitHub Actions:
- Code changes trigger the CI/CD pipeline
- Docker images are built and pushed to Docker Hub
- Kustomize updates the deployment configurations
- GKE cluster receives the updated configurations
- Kubernetes handles the rolling deployment
For detailed configuration, see our CI/CD workflow file.
We leverage Datadog's integration with Google Cloud Platform (GCP) to monitor our application's performance, security, and overall health in real-time. This setup provides comprehensive visibility into our Kubernetes-based infrastructure and application metrics.
- Kubernetes Cluster Monitoring
- Pod health and status
- Node performance
- Container resource utilization
- Deployment status
Caption: Kubernetes cluster overview showing pod status, resource utilization, and node health across our GKE cluster
- Application Performance
- API endpoint response times
- Database query performance
- Error rates and types
- Resource consumption
Caption: Application Performance Monitoring dashboard showing API latency, error rates, and database performance metrics
Our monitoring setup tracks critical metrics including:
- System uptime and availability
- Resource utilization trends
- Error frequency and patterns
- API performance metrics
- User experience data
Caption: Datadog GCP integration page showing successful connection and data flow from our Google Cloud resources
In addition to Datadog, we also use Google Cloud's Managed Service for Prometheus (GMP) to monitor our application's performance and health.
- Container resource utilization
- API endpoint performance
- Database connection health
- Error rates and response times
Alerting is also enabled for critical metrics, ensuring timely notifications for system anomalies.
We used Datadog's Real User Monitoring (RUM) to gather and analyze real-time user interactions, performance metrics, and behavior patterns. This implementation enables us to make data-driven decisions for improving user experience and application performance.
Our RUM setup tracks:
- User Journey Analytics
- Page navigation patterns
- Feature usage frequency
- Time spent on features
Caption: User journey visualization showing common navigation paths and interaction patterns across the application
- Performance Metrics
- Page load times
- API response latency
- Resource loading speed
- Frontend rendering time
- Errors
- JavaScript errors
- Failed API calls
- UI rendering issues
- Network failures
We leverage Kubernetes native features to implement a robust continuous operations strategy, ensuring minimal downtime and seamless updates for our application.
The following Kubernetes capabilities will allow us to ensure continuous operations:
- Deployments: Manage rolling updates and rollbacks for our application containers, ensuring a controlled and gradual rollout of new versions.
- Liveness and Readiness Probes: Continuously monitor the health of our application containers, automatically restarting unhealthy containers and ensuring only healthy containers receive traffic.
- No External Dependencies: Leverage Kubernetes' built-in capabilities without relying on third-party tools.
- Simplified Management: Streamlined continuous operations management through Kubernetes' declarative configuration and automated processes.
- Efficient Resource Utilization: Minimize downtime and optimize resource usage through Kubernetes' rolling updates and health checks.ur continuous operations strategy includes the following deployment strategies:
- Rolling Updates: Gradually roll out new versions of our application, ensuring minimal disruption to users.
Find attached a link to the website: https://34.55.145.169/
Dashboard showing realtime weather forecast(temperature, humdity and wind speed) based on your location, there is also a chart to visualize soil trends over a number of days and a card showing soil level every 3 hours
Recent activity based on irrigation schedule updates and upcoing tasks
Irrigation schedule page where the user can plan how they will shcedule the watering of their farms adn how much water will be used, it also makes use of their location
Irrigation recommendation page which recommends irrigation metrics( irrigation window, amount of water needed for irrigation and actions to be taken) based on current weather conditions, soil moisture, humidity and wind speed. It also considers the plant type.