AWS Builder Center

AirPulse: Building an Intelligent Campus Environmental Monitoring Platform on AWS

Discover how AirPulse uses a React frontend, an Express API, PostgreSQL with PostGIS, and AWS infrastructure to bring campus environmental monitoring, hotspot analysis, and predictive insights into one platform.

AirPulse: Building an Intelligent Campus Environmental Monitoring Platform on AWS

Introduction

Environmental conditions can significantly affect the comfort, safety, and everyday experience of students and staff on a campus. However, environmental observations, monitoring data, and potential hotspots can be difficult to understand when information is scattered across different systems.
AirPulse is a campus environmental monitoring platform designed to bring environmental observations, hotspot analysis, historical information, alerts, and predictive insights together in one place.
The goal of AirPulse is to make environmental data easier to access and interpret through a web-based dashboard backed by a database and REST API. AWS provides the infrastructure that supports the deployed application.

What Is AirPulse?

AirPulse is a web application that brings several environmental monitoring capabilities together.
Key features include:
  • Environmental observations: Access environmental monitoring data through the application.
  • Hotspot analysis: View information about potential environmental hotspots.
  • Historical monitoring: Retrieve historical observations for analysis.
  • Alerts: Access environmental alerts and related information.
  • Prediction insights: Explore predictions and compare available models.
  • Centralized dashboard: Bring different monitoring and analysis capabilities into one interface.
These features are designed to make environmental information easier to explore and support more informed decisions.

Technology Stack

AirPulse uses a modern web development stack.

Frontend

The frontend is built with React and Vite. It provides the user interface through which users interact with environmental observations, alerts, historical data, and predictions.
The frontend is deployed using AWS Amplify Hosting and connected to a GitHub repository.

Backend

The backend uses Node.js and Express to provide REST API endpoints. These endpoints handle requests from the frontend and retrieve the relevant information from the database.
The backend runs on an Ubuntu-based Amazon EC2 instance.

Database

AirPulse uses PostgreSQL with PostGIS for storing and working with structured and geospatial data. PostGIS adds spatial capabilities that are useful for representing and analyzing location-based environmental information.
The database is hosted on Amazon RDS.

How AWS Powers AirPulse

1. AWS Amplify Hosting

AWS Amplify hosts the AirPulse frontend and connects the deployment process to the GitHub repository.
This setup makes it easier to publish frontend updates through the application's source-control workflow. When frontend changes are pushed to the configured branch, Amplify can build and deploy the application.

2. Amazon EC2

Amazon EC2 runs the AirPulse backend API on an Ubuntu server.
The Express application exposes endpoints for environmental observations, alerts, hotspot information, predictions, and application status. Running the backend on EC2 gives the project a dedicated compute environment for its API.

3. Amazon RDS for PostgreSQL

Amazon RDS provides the managed relational database used by AirPulse.
The backend connects to the database to retrieve and manage application data. Using a managed database service reduces the need to handle database-server administration manually.

4. PostGIS

PostGIS extends PostgreSQL with geospatial data types and functions. This is particularly relevant to AirPulse because environmental monitoring can involve locations, monitoring stations, and spatial relationships.
The application database has PostGIS enabled, allowing spatial functionality to be supported by the database layer.

5. GitHub Integration

GitHub stores the project's source code and provides the repository used by the frontend deployment workflow.
Connecting the repository to Amplify helps keep the deployed frontend aligned with the codebase.

Architecture Overview

The AirPulse deployment follows a straightforward three-layer architecture:
  1. Presentation layer: React frontend hosted on AWS Amplify.
  1. Application layer: Express REST API running on Amazon EC2.
  1. Data layer: PostgreSQL with PostGIS hosted on Amazon RDS.
The request flow works as follows:
A user opens the AirPulse website. The frontend sends an HTTP request to the backend API. The backend processes the request and communicates with the database when data is required. The API then returns a response that the frontend uses to display the requested information.
Keeping these responsibilities separate makes the application easier to maintain and provides a foundation for future improvements.

Deployment Challenges and What I Learned

Deploying a full-stack application involves more than making the frontend accessible through a browser. The frontend, backend, database, and network configuration must all work together.
During the deployment of AirPulse, several important areas required attention.

Database Connectivity

Connecting the backend to Amazon RDS required configuring the database connection and SSL settings. I also needed to ensure that the database security rules allowed connections from the backend server without unnecessarily exposing the database publicly.

API Availability

The backend needed to remain available independently of my local development environment. Running the API on EC2 helped separate backend execution from my personal computer.

Frontend and Backend Integration

The deployed frontend and backend operate on different origins. This introduced two important configuration requirements: using the correct API base URL and configuring Cross-Origin Resource Sharing (CORS) to allow requests from the deployed frontend.
This reinforced an important lesson: a successful frontend deployment does not automatically mean that the entire full-stack application is functioning correctly.

Deployment Verification

I used the API's health endpoint to check whether the backend was responding and whether its database connection was established. Testing these components separately made it easier to distinguish infrastructure problems from frontend integration issues.

Security and Reliability Considerations

The deployment also highlighted several areas that matter when running a web application on cloud infrastructure:
  • Keep database credentials and other secrets out of source control.
  • Restrict database access to the backend's security group.
  • Use encrypted database connections.
  • Configure CORS to allow only the intended frontend origins.
  • Monitor the backend process and review application logs when errors occur.
  • Use a stable production API endpoint for the frontend.
These practices help create a more reliable foundation for a cloud-hosted application.

Future Improvements

AirPulse can be extended in several directions as the project evolves:
  • Introduce automated testing into the deployment workflow.
  • Add monitoring, logging, and alerting for application health.
  • Improve the analysis and visualization of historical environmental observations.
  • Expand geospatial analysis of monitoring stations and environmental hotspots.
  • Strengthen deployment automation and production configuration.
  • Explore additional AWS services where they provide a clear benefit to the application.
These improvements could make the platform easier to operate and help it support more advanced environmental analysis.

Conclusion

Building AirPulse has been an opportunity to bring together frontend development, backend APIs, relational databases, geospatial data, and cloud deployment.
AWS Amplify, Amazon EC2, and Amazon RDS each serve a distinct role in the architecture. Together with React, Express, PostgreSQL, and PostGIS, they provide a foundation for a full-stack environmental monitoring platform.
The experience has also demonstrated the importance of configuring networking, database security, API endpoints, and CORS correctly. These details are essential for turning a locally working application into one that users can access through a deployed website.
AirPulse represents a foundation that can continue to evolve through better observability, automated deployment, and more advanced environmental data analysis.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article