AirAware is a data-driven web application designed to help users understand how air pollution impacts respiratory health, with a particular focus on asthma and allergies. The platform aims to raise awareness, provide insights through data visualisation, and support informed decision-making for individuals sensitive to air quality.
Air pollution is a major environmental risk to health, especially for people with asthma and allergies. AirAware aggregates and analyses air quality and health-related data to highlight trends, risks, and insights in a clear and accessible way.
The project was built as part of a data-focused MVP, combining backend development, data analysis, and visualisation tools.
- Clone the repository:
git clone https://github.com/your-username/airaware.git
- Navigate into the project directory:
cd airaware - Install dependencies:
npm install
- Create a
.envfile and add required environment variables:DATABASE_URL=your_database_url JWT_SECRET=your_jwt_secret
- Start the development server:
npm run dev
- Access the API locally via:
http://localhost:3000 - Use Postman or a frontend client to interact with the available endpoints.
Register a new user
POST /api/auth/register HTTP/1.1
Host: localhost:3000
Content-Type: application/json{
"email": "user@example.com",
"password": "password123",
"condition": "asthma",
"sensitivity": "high"
}npm run dev # Start development server
npm start # Start production server
npm test # Run unit and integration tests- Uses
npm run dev - Includes detailed error logging
- Intended for local development and testing
- Environment variables loaded from .env
- Uses
npm start - Optimised for performance and stability
- Environment variables managed by the hosting platform
- Debug logging disabled
Before deploying to production, ensure:
- Environment variables are securely configured
- Database migrations are up to date
- All tests pass successfully
This project uses Jest for unit and integration testing.
Run all tests with:
npm test
- Example test
``` js
describe("Health check endpoint", () => {
it("should return status 200", async () => {
const res = await request(app).get("/api/health");
expect(res.statusCode).toBe(200);
});
});The tests cover
- User authentication logic
- Model functions
- Protected routes
- Error handling
AirAware uses JWT-based authentication.
- User registers with email and password.
- Password is hashed using
bcrypt. - A JWT is generated and returned to the user.
- The JWT is stored client-side (e.g. localStorage).
- Protected routes require a valid JWT in the
Authorisationheader.
If the token is missing, invalid, or expired, access is denied.
The application can be deployed to platforms such as Render, Railway, or Heroku.
- Push the project to GitHub.
- Create a new service on your chosen platform.
- Set the following environment variables:
DATABASE_URL
JWT_SECRET- Ensure the build and start commands are set correctly:
npm install
npm start- Use a managed PostgreSQL database.
- Do not commit the
.envfile. - Run tests before deploying to production.
| Method | Endpoint | Description | Auth Required |
|---|---|---|---|
| POST | /api/auth/register |
Register a new user | ❌ No |
| POST | /api/auth/login |
Log in an existing user | ❌ No |
| GET | /api/users/profile |
Get logged-in user profile | ✅ Yes |
| PUT | /api/users/profile |
Update user information | ✅ Yes |
| GET | /api/health |
API health check | ❌ No |
Air pollution is a significant environmental and public health issue, particularly for individuals with respiratory conditions such as asthma and allergies. While air quality data is widely available, it is often fragmented, difficult to interpret, and not directly linked to health impacts. This makes it challenging for affected individuals and stakeholders to understand risks and make informed decisions.
AirAware bridges the gap between raw air quality data and real-world health impacts by:
- Combining environmental and health-related datasets
- Presenting insights through clear, interactive visualisations
- Focusing specifically on asthma and allergy-related sensitivities
- Providing a foundation for personalised, data-driven health awareness
Data analysis is a core component of the AirAware project, enabling the transformation of raw datasets into meaningful insights.
- Used for data cleaning, preparation, and exploratory analysis
- Handled missing values and inconsistent records
- Performed aggregations and trend analysis on air pollution and health data
- Enabled scalable data processing using Python notebooks
- Used to create interactive dashboards and visualisations
- Highlighted trends in air pollution levels over time
- Visualised relationships between pollutants and respiratory health outcomes
- Allowed filtering by location, pollutant type, and time period
These tools together support evidence-based insights and enhance the accessibility of complex datasets.
The AirAware application is built using a modular, layered architecture that separates backend services, data processing, and visualisation. This ensures scalability, maintainability, and clear responsibility across components.
┌───────────────────────┐
│ Client / Consumer │
│ (Postman / Frontend) │
└───────────┬───────────┘
│ HTTP Requests
▼
┌───────────────────────┐
│ Node.js / Express API│
│ - Auth (JWT) │
│ - Business Logic │
└───────────┬───────────┘
│ SQL Queries
▼
┌───────────────────────┐
│ PostgreSQL DB │
│ - Users │
│ - App Data │
└───────────┬───────────┘
│ Data Export
▼
┌───────────────────────┐
│ Databricks │
│ - Data Cleaning │
│ - Analysis (Python) │
└───────────┬───────────┘
│ Processed Data
▼
┌───────────────────────┐
│ Tableau │
│ - Dashboards │
│ - Visual Insights │
└───────────────────────┘
- Client / API Consumer
- Postman or frontend application
- Backend
- Node.js & Express.js REST API
- JWT-based authentication
- Database
- PostgreSQL for persistent user and application data
- Data Layer
- Data processing and analysis in Databricks
- Visualisation Layer
- Tableau dashboards for insights and reporting
Analysis of air quality and health-related datasets revealed several key insights.
- Certain pollutants (such as particulate matter) consistently showed higher concentrations in urban areas.
- Periods of increased air pollution aligned with higher reported respiratory health risks.
- Seasonal trends indicated worse air quality during specific months.
- Geographic variation highlighted regions with consistently poorer air quality.
Tableau dashboards enabled:
- Comparison of pollutant levels over time
- Filtering by location and pollutant type
- Identification of high-risk periods for asthma and allergy sufferers
These insights demonstrate the value of combining environmental and health data to support awareness and informed decision-making.
While the project provides valuable insights, several data limitations were identified.
- Missing values were present in some datasets and required cleaning.
- Data sources varied in granularity and update frequency.
- Health data was aggregated and did not represent individual diagnoses.
- No real-time data integration in the MVP.
- Limited geographic coverage depending on data availability.
- Correlation does not imply causation between pollution levels and health outcomes.
These limitations were considered during analysis and provide direction for future improvements.