# sungodemk/msu-engineering-engagement-hub architecture

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

- Interactive diagram: https://gitdiagram.com/sungodemk/msu-engineering-engagement-hub
- Repository: https://github.com/sungodemk/msu-engineering-engagement-hub

## Overview

This repository appears to implement an engineering engagement hub: staff browse company and person records, inspect activity and relationships, follow companies, edit entities, and review duplicate matches. The frontend routes and API helper are shown, and backend route modules are registered by the Flask app; sampled route excerpts show database-backed company, profile, edit, and stewardship behavior. Other listed pages and ingestion/matching scripts are represented as capabilities from the source index, but their internal calls were not inspected, so uncertain links are omitted.

Main entry points: [`frontend/src/App.jsx`](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/App.jsx) (App routes), [`backend/app.py`](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/app.py) (Flask app), [`backend/database.py`](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/database.py) (PostgreSQL access), [`frontend/src/api.js`](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/api.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Hub interface"]
  node_routes["App routes<br/>[App.jsx]"]
  node_companyui["Company view<br/>[company_page.jsx]"]
  node_personui["Person views<br/>[persons_page.jsx]"]
  node_dashboard["Dashboard<br/>[dashboard.jsx]"]
  node_temporal["Activity timeline<br/>[temporal.jsx]"]
  node_relationship["Relationship graph<br/>[relationship.jsx]"]
  node_stewardship["Match review"]
  node_portfolio["Portfolio<br/>[portfolio.jsx]"]
  node_profile["User profile<br/>[profile_page.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["Backend API"]
  node_app["Flask app<br/>[app.py]"]
  node_company_api["Company API<br/>[company.py]"]
  node_person_api["Person API<br/>[person.py]"]
  node_matching_api["Matching API<br/>[matching.py]"]
  node_edits_api["Entity edits<br/>[edits.py]"]
  node_profile_api["Profile API<br/>[profile.py]"]
end

subgraph group_data["Engagement data"]
  node_database[("PostgreSQL access<br/>[database.py]")]
  node_days["Date calculation<br/>[days_calculator.py]"]
  node_entity_edits["Edit history<br/>[entity_edits.py]"]
  node_merge["Entity merging<br/>[merge_entities.py]"]
  node_rescore["Match rescoring<br/>[rescoring.py]"]
  node_company_match["Company matching<br/>[company_matcher.py]"]
  node_person_match["Person matching<br/>[person_matcher.py]"]
  node_ingestion["Data ingestion"]
end

subgraph group_identity["Identity and access"]
  node_auth["Login authorization<br/>[auth.py]"]
  node_firebase["Firebase identity<br/>[firebase.js]"]
end

node_staff(("Hub user"))

node_staff -->|"navigates"| node_routes
node_routes -->|"routes to"| node_companyui
node_routes -->|"routes to"| node_personui
node_routes -->|"routes to"| node_dashboard
node_routes -->|"routes to"| node_portfolio
node_routes -->|"routes to"| node_stewardship
node_routes -->|"routes to"| node_profile
node_companyui -->|"renders"| node_temporal
node_dashboard -->|"renders"| node_temporal
node_dashboard -->|"renders"| node_relationship
node_companyui -->|"requests data"| node_api_client
node_personui -->|"requests data"| node_api_client
node_profile -->|"requests data"| node_api_client
node_stewardship -->|"requests data"| node_api_client
node_api_client -->|"gets token"| node_firebase
node_api_client -.->|"sends HTTP"| node_app
node_app -->|"registers routes"| node_company_api
node_app -->|"registers routes"| node_person_api
node_app -->|"registers routes"| node_matching_api
node_app -->|"registers routes"| node_edits_api
node_app -->|"registers routes"| node_profile_api
node_company_api -->|"reads and writes"| node_database
node_company_api -->|"calculates days"| node_days
node_person_api -->|"reads data"| node_database
node_matching_api -->|"reads and writes"| node_database
node_matching_api -->|"merges entities"| node_merge
node_edits_api -->|"reads and writes"| node_database
node_edits_api -->|"resolves entity"| node_merge
node_edits_api -->|"rescores company"| node_rescore
node_edits_api -->|"uses edit history"| node_entity_edits
node_profile_api -->|"reads and writes"| node_database
node_profile_api -->|"resolves entity"| node_merge
node_profile_api -->|"resolves source"| node_entity_edits
node_rescore -->|"uses matcher"| node_company_match
node_rescore -->|"uses matcher"| node_person_match
node_auth -->|"updates login"| node_database
node_company_api -->|"queries records"| node_database

click node_routes "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/App.jsx"
click node_companyui "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/company_page.jsx"
click node_personui "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/persons_page.jsx"
click node_dashboard "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/dashboard.jsx"
click node_temporal "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/graphs/temporal.jsx"
click node_relationship "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/graphs/relationship.jsx"
click node_stewardship "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/stewardship_queue.jsx"
click node_portfolio "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/portfolio.jsx"
click node_profile "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/profile_page.jsx"
click node_api_client "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/api.js"
click node_app "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/app.py"
click node_company_api "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/company.py"
click node_person_api "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/person.py"
click node_matching_api "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/matching.py"
click node_edits_api "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/edits.py"
click node_profile_api "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/profile.py"
click node_database "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/database.py"
click node_days "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/days_calculator/days_calculator.py"
click node_entity_edits "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/entity_edits.py"
click node_merge "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/merge_entities.py"
click node_rescore "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/rescoring.py"
click node_company_match "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/company_matcher.py"
click node_person_match "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/person_matcher.py"
click node_ingestion "https://github.com/sungodemk/msu-engineering-engagement-hub/tree/main/backend/scripts"
click node_auth "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/auth.py"
click node_firebase "https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/firebase.js"

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_routes,node_companyui,node_personui,node_dashboard,node_temporal,node_relationship,node_stewardship,node_portfolio,node_profile,node_api_client,node_staff toneBlue
class node_app,node_company_api,node_person_api,node_matching_api,node_edits_api,node_profile_api toneAmber
class node_database,node_days,node_entity_edits,node_merge,node_rescore,node_company_match,node_person_match,node_ingestion toneMint
class node_auth,node_firebase toneRose
```

## Components

### Hub interface

- [App routes](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Company view](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/company_page.jsx): `frontend/src/pages/company_page.jsx`
- [Person views](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/persons_page.jsx): `frontend/src/pages/persons_page.jsx`
- [Dashboard](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/dashboard.jsx): `frontend/src/pages/dashboard.jsx`
- [Activity timeline](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/graphs/temporal.jsx): `frontend/src/graphs/temporal.jsx`
- [Relationship graph](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/graphs/relationship.jsx): `frontend/src/graphs/relationship.jsx`
- [Match review](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/stewardship_queue.jsx): `frontend/src/pages/stewardship_queue.jsx`
- [Portfolio](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/portfolio.jsx): `frontend/src/pages/portfolio.jsx`
- [User profile](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/pages/profile_page.jsx): `frontend/src/pages/profile_page.jsx`
- [API client](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/api.js): `frontend/src/api.js`

### Backend API

- [Flask app](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/app.py): `backend/app.py`
- [Company API](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/company.py): `backend/routes/company.py`
- [Person API](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/person.py): `backend/routes/person.py`
- [Matching API](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/matching.py): `backend/routes/matching.py`
- [Entity edits](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/edits.py): `backend/routes/edits.py`
- [Profile API](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/routes/profile.py): `backend/routes/profile.py`

### Engagement data

- [PostgreSQL access](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/database.py): `backend/database.py`
- [Date calculation](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/days_calculator/days_calculator.py): `backend/days_calculator/days_calculator.py`
- [Edit history](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/entity_edits.py): `backend/scripts/entity_edits.py`
- [Entity merging](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/merge_entities.py): `backend/scripts/merge_entities.py`
- [Match rescoring](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/rescoring.py): `backend/scripts/rescoring.py`
- [Company matching](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/company_matcher.py): `backend/scripts/company_matcher.py`
- [Person matching](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/scripts/person_matcher.py): `backend/scripts/person_matcher.py`
- [Data ingestion](https://github.com/sungodemk/msu-engineering-engagement-hub/tree/main/backend/scripts): `backend/scripts`

### Identity and access

- [Login authorization](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/backend/auth.py): `backend/auth.py`
- [Firebase identity](https://github.com/sungodemk/msu-engineering-engagement-hub/blob/main/frontend/src/firebase.js): `frontend/src/firebase.js`

### Other components

- **Hub user**

## Connections

- Hub user → App routes: navigates (evidence: `frontend/src/App.jsx`)
- App routes → Company view: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Person views: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Portfolio: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Match review: routes to (evidence: `frontend/src/App.jsx`)
- App routes → User profile: routes to (evidence: `frontend/src/App.jsx`)
- Company view → Activity timeline: renders (evidence: `frontend/src/pages/company_page.jsx`)
- Dashboard → Activity timeline: renders (evidence: `frontend/src/pages/dashboard.jsx`)
- Dashboard → Relationship graph: renders (evidence: `frontend/src/pages/dashboard.jsx`)
- Company view → API client: requests data (evidence: `frontend/src/pages/company_page.jsx`)
- Person views → API client: requests data (evidence: `frontend/src/pages/persons_page.jsx`)
- User profile → API client: requests data (evidence: `frontend/src/pages/profile_page.jsx`)
- Match review → API client: requests data (evidence: `frontend/src/pages/stewardship_queue.jsx`)
- API client → Firebase identity: gets token (evidence: `frontend/src/api.js`)
- API client → Flask app: sends HTTP
- Flask app → Company API: registers routes (evidence: `backend/app.py`)
- Flask app → Person API: registers routes (evidence: `backend/app.py`)
- Flask app → Matching API: registers routes (evidence: `backend/app.py`)
- Flask app → Entity edits: registers routes (evidence: `backend/app.py`)
- Flask app → Profile API: registers routes (evidence: `backend/app.py`)
- Company API → PostgreSQL access: reads and writes (evidence: `backend/routes/company.py`)
- Company API → Date calculation: calculates days (evidence: `backend/routes/company.py`)
- Person API → PostgreSQL access: reads data (evidence: `backend/routes/person.py`)
- Matching API → PostgreSQL access: reads and writes (evidence: `backend/routes/matching.py`)
- Matching API → Entity merging: merges entities (evidence: `backend/routes/matching.py`)
- Entity edits → PostgreSQL access: reads and writes (evidence: `backend/routes/edits.py`)
- Entity edits → Entity merging: resolves entity (evidence: `backend/routes/edits.py`)
- Entity edits → Match rescoring: rescores company (evidence: `backend/routes/edits.py`)
- Entity edits → Edit history: uses edit history (evidence: `backend/routes/edits.py`)
- Profile API → PostgreSQL access: reads and writes (evidence: `backend/routes/profile.py`)
- Profile API → Entity merging: resolves entity (evidence: `backend/routes/profile.py`)
- Profile API → Edit history: resolves source (evidence: `backend/routes/profile.py`)
- Match rescoring → Company matching: uses matcher (evidence: `backend/scripts/rescoring.py`)
- Match rescoring → Person matching: uses matcher (evidence: `backend/scripts/rescoring.py`)
- Login authorization → PostgreSQL access: updates login (evidence: `backend/auth.py`)
- Company API → PostgreSQL access: queries records (evidence: `backend/routes/company.py`)
