Work

freelance · 2024

CTC Flood Classification

Astro.jsDrizzleORMNode.jsMapping

A data collection platform for CTC engineers to input and map nationwide project data for flood monitoring analysis.

CTC Flood Classification mapping interface for monitoring project data

CTC Flood Classification: Mapping Nationwide Projects for Flood Risk Analysis

During my internship at Control Technique de Construction (CTC), I developed a comprehensive platform enabling engineers across Algeria to collect, map, and analyze project data for the organization’s flood monitoring initiative.

CTC Project Map Interface

This nationwide data collection system provides CTC with critical insights into regional construction projects, facilitating better flood risk assessment and prevention strategies through geographic visualization and data analysis.

Project Overview

The CTC Flood Classification platform addresses the challenge of aggregating construction data from diverse regions across Algeria to support flood risk assessment. As flood patterns continue to evolve due to climate change and urban development, CTC required a centralized system to collect, visualize, and analyze project data with geographic context.

Key Objective

Create a unified platform that allows engineers from different regions to input construction project data, map their locations, and provide the organization with valuable insights for flood monitoring systems.

Technical Implementation

Frontend Development with Astro.js

For the frontend, I selected Astro.js due to its excellent performance characteristics and ability to create a seamless mapping experience:

  • Interactive Mapping Interface: Implemented interactive maps using Leaflet.js integrated with Astro
  • Responsive Design: Created a fully responsive interface accessible on both office computers and field devices
  • Form Validation: Built comprehensive validation for data collection forms to ensure quality inputs
  • Data Visualization: Developed dashboards to visualize the flood risk metrics by region
Frontend Tech Stack
  • 🚀 Astro.js for static site generation
  • 🗺️ Leaflet.js for interactive mapping
  • 📊 Chart.js for data visualization
  • 🎨 Tailwind CSS for styling

Backend Architecture

The backend infrastructure was built to support reliable data collection across multiple regions:

  • API Development: Created RESTful API endpoints using Node.js to handle data submission and retrieval
  • Database Design: Implemented a relational database schema using DrizzleORM for efficient data management
  • Authentication System: Developed role-based access control for engineers, supervisors, and administrators
  • Data Validation Pipeline: Built a comprehensive validation system to ensure data integrity
// Sample DrizzleORM schema for project data
import { sqliteTable, text, integer, real } from 'drizzle-orm/sqlite-core';

export const projects = sqliteTable('projects', {
  id: text('id').primaryKey(),
  name: text('name').notNull(),
  region: text('region').notNull(),
  latitude: real('latitude').notNull(),
  longitude: real('longitude').notNull(),
  floodRiskLevel: integer('flood_risk_level').notNull(),
  soilType: text('soil_type'),
  elevationMeters: real('elevation_meters'),
  annualRainfallMm: real('annual_rainfall_mm'),
  submittedBy: text('submitted_by').notNull(),
  submittedDate: text('submitted_date').notNull(),
});

Security and Authorization

Given the sensitive nature of the construction data and its national importance, security was a top priority:

  • JWT-based Authentication: Implemented secure token-based authentication
  • Role-based Access: Created tiered access levels for different user roles
  • Data Encryption: Ensured sensitive data was properly encrypted
  • Audit Trails: Maintained comprehensive logs of all data submissions and changes

Mapping Functionality

The heart of the platform is its mapping capabilities, allowing for:

  • Interactive Pinpointing: Engineers can precisely mark project locations on the map
  • Clustered Visualization: Projects are clustered for better visualization in densely populated areas
  • Filtering Capabilities: Users can filter projects by region, risk level, date range, and other parameters
  • Exportable Data: All map data can be exported for further analysis in GIS systems

Impact and Results

The CTC Flood Classification platform has had significant impact since its deployment:

  • National Coverage: Successfully collected data from over 40 regions across Algeria
  • Data Volume: Cataloged more than 1,200 construction projects in the first two months
  • Risk Assessment: Identified three high-risk zones previously not prioritized
  • Efficiency Improvement: Reduced the time for nationwide data collection by 65%

Future Development

The platform was designed with extensibility in mind, with plans for:

  • Machine Learning Integration: Implementing predictive models for flood risk assessment
  • Mobile Application: Developing a companion mobile app for field data collection
  • Real-time Weather Integration: Connecting with meteorological data for enhanced risk analysis
  • Historical Analysis: Adding capabilities to analyze changes in flood risk over time

Conclusion

The CTC Flood Classification project represents a significant advancement in how construction data is collected and analyzed for flood monitoring in Algeria. By bringing together nationwide data into a unified platform with powerful mapping capabilities, CTC now has the tools to make more informed decisions about flood risk assessment and prevention strategies.

This project is part of my story: read Chapter 3: Engineering Meets Management for the context around it.