# cayelaemj/newchanges architecture

> Architecture diagram of the GitHub repository cayelaemj/newchanges, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cayelaemj/newchanges
- Repository: https://github.com/cayelaemj/newchanges

## Overview

empower-fin is a multi-tenant financial-wellness portal. Users authenticate, then view employer or authorised portfolio analytics; administrators govern users, integrations, imports and operations. Source data is validated and assessed before it is committed, then snapshots feed dashboards and reports. A separate semantic-publication capability verifies and publishes stored objects. The graph combines README-documented product capabilities with sampled source and import references; several listed subsystems are unsampled, so their internal links are omitted rather than inferred.

Main entry points: [`src/server.ts`](https://github.com/cayelaemj/newchanges/blob/main/src/server.ts) (Fastify API), [`src/services/syncService.ts`](https://github.com/cayelaemj/newchanges/blob/main/src/services/syncService.ts) (Source synchronization), [`src/services/semanticObjectPipeline.ts`](https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticObjectPipeline.ts) (Object publication pipeline), [`src/services/database.ts`](https://github.com/cayelaemj/newchanges/blob/main/src/services/database.ts) (PostgreSQL access)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Portal surfaces"]
  node_server["Fastify API<br/>[server.ts]"]
  node_react["React dashboard<br/>[App.tsx]"]
  node_brand["Brand Engine<br/>[brand-engine.js]"]
end

subgraph group_access["Identity and administration"]
  node_auth["Authentication<br/>[authService.ts]"]
  node_mfa["Admin MFA<br/>[adminMfaRoutes.ts]"]
  node_database[("PostgreSQL access<br/>[database.ts]")]
  node_admin["Admin governance<br/>[securityService.ts]"]
end

subgraph group_ingestion["Data integration"]
  node_sourceadapter["Source adapters<br/>[sourceAdapter.ts]"]
  node_sync["Source synchronization<br/>[syncService.ts]"]
  node_imports["Import and validation<br/>[importService.ts]"]
  node_quality["Data quality guardrails"]
end

subgraph group_insights["Analytics and reporting"]
  node_mlops["MLOps governance<br/>[mlopsService.ts]"]
  node_snapshot["Dashboard snapshots<br/>[snapshotBuilder.ts]"]
  node_scoring["Wellness scoring<br/>[scoreEngine.ts]"]
  node_reports["Report formats<br/>[reportFormats.ts]"]
  node_scheduler["Scheduled reports<br/>[reportScheduler.ts]"]
end

subgraph group_semantic["Semantic publication"]
  node_semanticpipe["Object publication pipeline"]
  node_verification["Object verification"]
  node_publisher["Semantic publisher"]
  node_s3broker["S3 request broker"]
  node_settings["Storage settings"]
end

node_browser(("Portal users"))
node_sources["External source systems"]
node_objectstore[("S3-compatible storage")]

node_browser -->|"uses portal"| node_server
node_server -->|"authenticates"| node_auth
node_server -->|"routes MFA"| node_mfa
node_auth -->|"stores sessions"| node_database
node_mfa -->|"uses persistence"| node_database
node_browser -->|"opens workspace"| node_react
node_react -->|"requests dashboard data"| node_server
node_sources -->|"provides source data"| node_sourceadapter
node_server -->|"routes synchronization"| node_sync
node_sync -->|"reads sources"| node_sourceadapter
node_server -->|"routes imports"| node_imports
node_sync -->|"uses import handling"| node_imports
node_sync -->|"assesses incoming data"| node_quality
node_sync -->|"triggers assessments"| node_mlops
node_server -->|"serves dashboard data"| node_snapshot
node_snapshot -->|"reads application data"| node_database
node_snapshot -->|"computes wellness scores"| node_scoring
node_server -->|"serves reports"| node_reports
node_scheduler -.->|"formats scheduled output"| node_reports
node_server -->|"records security events"| node_admin
node_server -.->|"routes publication"| node_semanticpipe
node_semanticpipe -->|"verifies object"| node_verification
node_semanticpipe -->|"publishes manifest"| node_publisher
node_semanticpipe -.->|"obtains signed URLs"| node_s3broker
node_s3broker -->|"loads credentials"| node_settings
node_verification -.->|"transfers object bytes"| node_objectstore
node_publisher -.->|"records publication"| node_database
node_browser -->|"uses partner themes"| node_brand

click node_server "https://github.com/cayelaemj/newchanges/blob/main/src/server.ts"
click node_react "https://github.com/cayelaemj/newchanges/blob/main/frontend/src/App.tsx"
click node_auth "https://github.com/cayelaemj/newchanges/blob/main/src/services/authService.ts"
click node_mfa "https://github.com/cayelaemj/newchanges/blob/main/src/services/adminMfaRoutes.ts"
click node_database "https://github.com/cayelaemj/newchanges/blob/main/src/services/database.ts"
click node_admin "https://github.com/cayelaemj/newchanges/blob/main/src/services/securityService.ts"
click node_sourceadapter "https://github.com/cayelaemj/newchanges/blob/main/src/services/sourceAdapter.ts"
click node_sync "https://github.com/cayelaemj/newchanges/blob/main/src/services/syncService.ts"
click node_imports "https://github.com/cayelaemj/newchanges/blob/main/src/services/importService.ts"
click node_quality "https://github.com/cayelaemj/newchanges/blob/main/src/services/dataQualityService.ts"
click node_mlops "https://github.com/cayelaemj/newchanges/blob/main/src/services/mlopsService.ts"
click node_snapshot "https://github.com/cayelaemj/newchanges/blob/main/src/services/snapshotBuilder.ts"
click node_scoring "https://github.com/cayelaemj/newchanges/blob/main/src/services/scoreEngine.ts"
click node_reports "https://github.com/cayelaemj/newchanges/blob/main/src/services/reportFormats.ts"
click node_scheduler "https://github.com/cayelaemj/newchanges/blob/main/src/services/reportScheduler.ts"
click node_brand "https://github.com/cayelaemj/newchanges/blob/main/public/brand-engine.js"
click node_semanticpipe "https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticObjectPipeline.ts"
click node_verification "https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticObjectVerification.ts"
click node_publisher "https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticPublisher.ts"
click node_s3broker "https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticS3Broker.ts"
click node_settings "https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticStorageSettings.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server,node_react,node_brand,node_browser toneBlue
class node_auth,node_mfa,node_database,node_admin,node_objectstore toneAmber
class node_sourceadapter,node_sync,node_imports,node_quality toneMint
class node_mlops,node_snapshot,node_scoring,node_reports,node_scheduler toneRose
class node_semanticpipe,node_verification,node_publisher,node_s3broker,node_settings,node_sources toneIndigo
```

## Components

### Portal surfaces

- [Fastify API](https://github.com/cayelaemj/newchanges/blob/main/src/server.ts): `src/server.ts`
- [React dashboard](https://github.com/cayelaemj/newchanges/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Brand Engine](https://github.com/cayelaemj/newchanges/blob/main/public/brand-engine.js): `public/brand-engine.js`

### Identity and administration

- [Authentication](https://github.com/cayelaemj/newchanges/blob/main/src/services/authService.ts): `src/services/authService.ts`
- [Admin MFA](https://github.com/cayelaemj/newchanges/blob/main/src/services/adminMfaRoutes.ts): `src/services/adminMfaRoutes.ts`
- [PostgreSQL access](https://github.com/cayelaemj/newchanges/blob/main/src/services/database.ts): `src/services/database.ts`
- [Admin governance](https://github.com/cayelaemj/newchanges/blob/main/src/services/securityService.ts): `src/services/securityService.ts`

### Data integration

- [Source adapters](https://github.com/cayelaemj/newchanges/blob/main/src/services/sourceAdapter.ts): `src/services/sourceAdapter.ts`
- [Source synchronization](https://github.com/cayelaemj/newchanges/blob/main/src/services/syncService.ts): `src/services/syncService.ts`
- [Import and validation](https://github.com/cayelaemj/newchanges/blob/main/src/services/importService.ts): `src/services/importService.ts`
- [Data quality guardrails](https://github.com/cayelaemj/newchanges/blob/main/src/services/dataQualityService.ts): `src/services/dataQualityService.ts`

### Analytics and reporting

- [MLOps governance](https://github.com/cayelaemj/newchanges/blob/main/src/services/mlopsService.ts): `src/services/mlopsService.ts`
- [Dashboard snapshots](https://github.com/cayelaemj/newchanges/blob/main/src/services/snapshotBuilder.ts): `src/services/snapshotBuilder.ts`
- [Wellness scoring](https://github.com/cayelaemj/newchanges/blob/main/src/services/scoreEngine.ts): `src/services/scoreEngine.ts`
- [Report formats](https://github.com/cayelaemj/newchanges/blob/main/src/services/reportFormats.ts): `src/services/reportFormats.ts`
- [Scheduled reports](https://github.com/cayelaemj/newchanges/blob/main/src/services/reportScheduler.ts): `src/services/reportScheduler.ts`

### Semantic publication

- [Object publication pipeline](https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticObjectPipeline.ts): `src/services/semanticObjectPipeline.ts`
- [Object verification](https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticObjectVerification.ts): `src/services/semanticObjectVerification.ts`
- [Semantic publisher](https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticPublisher.ts): `src/services/semanticPublisher.ts`
- [S3 request broker](https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticS3Broker.ts): `src/services/semanticS3Broker.ts`
- [Storage settings](https://github.com/cayelaemj/newchanges/blob/main/src/services/semanticStorageSettings.ts): `src/services/semanticStorageSettings.ts`

### Other components

- **Portal users**
- **External source systems**
- **S3-compatible storage**

## Connections

- Portal users → Fastify API: uses portal (evidence: `README.md`)
- Fastify API → Authentication: authenticates (evidence: `src/server.ts`)
- Fastify API → Admin MFA: routes MFA (evidence: `src/server.ts`)
- Authentication → PostgreSQL access: stores sessions (evidence: `src/services/authService.ts`)
- Admin MFA → PostgreSQL access: uses persistence (evidence: `src/services/adminMfaRoutes.ts`)
- Portal users → React dashboard: opens workspace (evidence: `README.md`)
- React dashboard → Fastify API: requests dashboard data (evidence: `frontend/src/App.tsx`)
- External source systems → Source adapters: provides source data (evidence: `README.md`)
- Fastify API → Source synchronization: routes synchronization (evidence: `src/server.ts`)
- Source synchronization → Source adapters: reads sources (evidence: `src/services/syncService.ts`)
- Fastify API → Import and validation: routes imports (evidence: `src/server.ts`)
- Source synchronization → Import and validation: uses import handling (evidence: `src/services/syncService.ts`)
- Source synchronization → Data quality guardrails: assesses incoming data (evidence: `src/services/syncService.ts`)
- Source synchronization → MLOps governance: triggers assessments (evidence: `src/services/syncService.ts`)
- Fastify API → Dashboard snapshots: serves dashboard data (evidence: `src/server.ts`)
- Dashboard snapshots → PostgreSQL access: reads application data (evidence: `src/services/snapshotBuilder.ts`)
- Dashboard snapshots → Wellness scoring: computes wellness scores (evidence: `src/services/snapshotBuilder.ts`)
- Fastify API → Report formats: serves reports (evidence: `src/server.ts`)
- Scheduled reports → Report formats: formats scheduled output
- Fastify API → Admin governance: records security events (evidence: `src/server.ts`)
- Fastify API → Object publication pipeline: routes publication
- Object publication pipeline → Object verification: verifies object (evidence: `src/services/semanticObjectPipeline.ts`)
- Object publication pipeline → Semantic publisher: publishes manifest (evidence: `src/services/semanticObjectPipeline.ts`)
- Object publication pipeline → S3 request broker: obtains signed URLs
- S3 request broker → Storage settings: loads credentials (evidence: `src/services/semanticS3Broker.ts`)
- Object verification → S3-compatible storage: transfers object bytes
- Semantic publisher → PostgreSQL access: records publication
- Portal users → Brand Engine: uses partner themes (evidence: `README.md`)
