This repository was archived by the owner on May 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Software Architecture
NathanGrenier edited this page Apr 13, 2026
·
21 revisions


The project follows a modular folder structure that closely aligns with the system's conceptual Entity Relationship Diagram (ERD). Components are grouped by purpose—data, logic, and presentation—translating the architectural concepts into concrete code.
The backend structure mirrors the relationships defined in the diagram:
-
Entities & Database: The entities shown in the diagram (Users, Claims, Flights) are implemented as database models in
backend/src/db/schema.tsusing Drizzle ORM. -
Business Logic: The
backend/src/services/directory contains the specific logic for how these entities interact. Files likedelayService.tsandsubmittedClaimService.tshandle the behind-the-scenes work—matching users to claims and processing flight data—directly implementing the relationships found in the ERD. -
API Routes: The
backend/src/routes/directory acts as the interface, exposing internal models to the frontend and automation services.
While the diagram references AI Agents and OCR results, the implementation lives in specific backend sub-modules:
-
backend/src/emails/&backend/src/jobs/: These directories handle background automation, document parsing, and communication tasks.
-
frontend/: Built with React Native and Expo, this directory contains the user interface. While the ERD focuses on data, this folder provides the screens required for users to interact with the backend logic.
Several essential components exist in the code structure to support the application, even if they are not visualized in the high-level diagram:
-
Testing: Unit and integration tests reside in
backend/src/test/. -
Workflows: The
n8n/folder contains workflow orchestration logic that sits on top of the system to connect services. -
Configuration: Deployment and environment setups are managed via
docker-compose.yml,tsconfig.json, andeslint.config.mts.
The following table maps the high-level architectural layers to their specific implementation within the codebase.
| Architectural Layer | Example in Diagram (ERD) | Implementation in Code | Description |
|---|---|---|---|
| Core Entities / Database | User, Claim, Flight, Documents | backend/src/db/schema.ts |
Tables in the ERD are represented as Drizzle ORM models. |
| Relationships / Domain Logic | Foreign keys (e.g., Claim → User) | backend/src/services/ |
Services implement logic connecting database entities. |
| API Layer (Controllers) | (Not shown in ERD) | backend/src/routes/ |
REST endpoints exposing backend functionality. |
| Automation / AI Integrations | AI-Agent, OCR_result |
backend/src/emails/, backend/src/jobs/
|
Automated claim handling, OCR, and background jobs. |
| Frontend / Presentation | (Not represented in ERD) | frontend/ |
React Native interface for user interaction. |
| Testing / Validation | (Not represented in ERD) |
backend/src/test/, frontend/__tests__/
|
Unit and integration testing layers. |
| Configuration / Infrastructure | (Not represented in ERD) |
docker-compose.yml, tsconfig.json
|
Build, lint, and deployment configuration. |
| Workflow Automation | (Implicit support layer) | n8n/ |
Workflow orchestration and process automation. |