Architecture Diagram
Site Installation Architecture Overview
Your site installation system is a full-stack AWS serverless application that enables installers to submit IoT device installations with images, GPS data, and device metadata. Here's the complete architecture:
Frontend Layer
Location: InstallerDeviceFormPage.jsx
Key Components:
InstallerDeviceFormPage: Main form page for device installation
Installer Components:
SiteInfoSection: Site details (location ID, installer info, location type)DeviceDetailsSection: Device configuration (category, model, asset name)PulseCounterSection: Pulse counter configuration for utility metersWeatherMonitoringSection: Weather station configurationImageUploadSection: Image upload with GPS extraction
Key Services:
installerDeviceService.js: Device CRUD operationsinstallerEntitiesService.js: Fetch location types, device categories, modelss3Service.js: S3 presigned URL generation for images
Data Flow:
User fills form → collects site data, device data, pulse/weather data, images
Calls
submitInstallation()→ creates FormData with multipart/form-dataPOSTs to
/installationsendpoint with JWT token
API Gateway Layer
Infrastructure: cdk-stack.ts
API: AtriaInstallerAPI (REST API Gateway)
Base URL: ${API_URL} (from VITE_INSTALLER_APP_API_URL)
Key Endpoints:
Endpoint | Method | Lambda | Purpose |
|---|---|---|---|
| POST | InstallationSubmissionLambda | Submit new device installation |
| GET | EntityResourceLambda | Get device details |
| DELETE | EntityResourceLambda | Delete device |
| DELETE | EntityResourceLambda | Delete device image |
| GET | EntityResourceLambda | Get device categories |
| GET | EntityResourceLambda | Get location types |
| GET | EntityResourceLambda | Get device models |
| GET | EntityResourceLambda | Get device model units |
| GET | EntityResourceLambda | Fetch LoRaWAN device data |
| PUT | EntityResourceLambda | Update LoRaWAN metadata |
| GET | ProcessImagesLambda | Get processed images |
| GET | ProcessImagesLambda | Get GPS coordinates |
Authentication:
Cognito User Pool Authorizer (
AtriaInstallerAuthorizer)JWT token in
Authorization: Bearer <token>header
Lambda Functions Layer
Location: installer
1. Installation Submission Lambda
File: installation_submission_lambda.py
Handler: installer.installation_submission_lambda.lambda_handler
Timeout: 5 minutes
Memory: 1024 MB
Responsibilities:
Parse multipart/form-data from API Gateway
Extract GPS coordinates from image EXIF data
Upload images to S3 (
{locationId}/installation/{deviceId}/{deviceId}-image-{N}.jpg)Save device record to DynamoDB (
AtriaInstallerDeviceDetails)Update LoRaWAN device tables with site info
Handle pulse counter and weather station configurations
Support both CREATE and UPDATE operations
Key Functions:
extract_gps_from_image()upload_image_to_s3()update_lorawan_device_site_info()convert_device_type_to_taxonomy_code()
2. Entity Resource Lambda
File: entity_resource_lambda.py
Handler: installer.entity_resource_lambda.lambda_handler
Timeout: 5 minutes
Memory: 1024 MB
Responsibilities:
Fetch entity data (device categories, location types, models)
Query device details by deviceId/siteId
Generate S3 presigned URLs for device images
Manage LoRaWAN device interactions (AWS IoT Wireless)
Delete devices and images
3. Device Details Lambda
File: device_details_lambda.py
Handler: installer.device_details_lambda.lambda_handler
Timeout: 5 minutes
Runtime: Python 3.9
Responsibilities:
S3 trigger on
.txtfile uploadsParse CSV device data from S3
Create/update device records in DynamoDB
Standardize pulse counter values
4. Process Images Lambda
File: process_images_lambda/process_images_lambda.py
Handler: lambda_handler
Timeout: 15 minutes
Memory: 1536 MB
Responsibilities:
Fetch processed images for PDF generation
Extract GPS data from images
Database Layer (DynamoDB)
1. AtriaInstallerDeviceDetails
Partition Key: EntityId (deviceId)
Sort Key: SecondaryId (locationId/siteId)
Attributes Example:
{
EntityId: "deviceId",
SecondaryId: "locationId",
DeviceCategory: "sensor",
Model: "Device Model Name",
InstallerName: "John Doe",
InstallerCompany: "Install Co",
ImageKeys: ["SITE123/installation/12abc/12abc-image-1.jpg"],
CreatedAt: "2025-10-23T12:34:56Z",
Status: "submitted"
}