# tp-shivha-shakthiy/trace architecture

> Architecture diagram of the GitHub repository tp-shivha-shakthiy/trace, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tp-shivha-shakthiy/trace
- Repository: https://github.com/tp-shivha-shakthiy/trace

## Overview

TRACE is a developer-intelligence application whose main workflow syncs GitHub activity asynchronously, stores normalized data in PostgreSQL, infers technical domains, and serves developer profiles to a React SPA. The graph includes OAuth/session handling and sync-job status alongside that workflow. Some service internals and frontend API calls were not excerpted, so those links rely on README documentation; unsampled subsystem paths use their exact tree paths.

Main entry points: [`app/api/routes_auth.py`](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_auth.py) (OAuth routes), [`app/services/ingestion.py`](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/ingestion.py) (Ingestion service), [`frontend/src/api.ts`](https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/api.ts) (API client), [`app/services/jobs.py`](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/jobs.py) (Job worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_spa["React SPA<br/>[App.tsx]"]
  node_home["Developer search<br/>[Home.tsx]"]
  node_profile_view["Profile view<br/>[Developer.tsx]"]
  node_api_client["API client<br/>[api.ts]"]
  node_ui_components["Profile components<br/>[components.tsx]"]
end

subgraph group_api["API and identity"]
  node_auth_routes["OAuth routes<br/>[routes_auth.py]"]
  node_sync_routes["Sync routes<br/>[routes_sync.py]"]
  node_developer_routes["Developer routes"]
  node_me_routes["Identity routes<br/>[routes_me.py]"]
  node_sessions["Sessions<br/>[sessions.py]"]
  node_oauth["OAuth service<br/>[oauth.py]"]
end

subgraph group_ingestion["Ingestion pipeline"]
  node_worker["Job worker<br/>[jobs.py]"]
  node_activity["GitHub activity<br/>[github_activity.py]"]
  node_github_client["GitHub client<br/>[github.py]"]
  node_normalizers["Event normalizers<br/>[normalizers.py]"]
  node_ingestion_service["Ingestion service<br/>[ingestion.py]"]
end

subgraph group_intelligence["Profile intelligence"]
  node_domain_inference["Domain inference<br/>[domains.py]"]
  node_profile_service["Profile service<br/>[profiles.py]"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("PostgreSQL")]
  node_orm_models["Data models<br/>[models.py]"]
  node_schema["Schema setup<br/>[schema.py]"]
end

node_developer(("Developer"))

node_developer -->|"uses"| node_spa
node_spa -->|"renders"| node_home
node_spa -->|"renders"| node_profile_view
node_home -->|"requests"| node_api_client
node_profile_view -->|"requests"| node_api_client
node_profile_view -->|"renders"| node_ui_components
node_api_client -.->|"calls API"| node_developer_routes
node_api_client -.->|"calls API"| node_sync_routes
node_developer -->|"signs in"| node_auth_routes
node_auth_routes -->|"exchanges code"| node_oauth
node_auth_routes -->|"creates session"| node_sessions
node_auth_routes -->|"enqueues sync"| node_worker
node_developer -->|"requests sync"| node_sync_routes
node_sync_routes -->|"enqueues job"| node_worker
node_worker -->|"runs ingestion"| node_ingestion_service
node_ingestion_service -->|"fetches bundle"| node_activity
node_activity -->|"fetches data"| node_github_client
node_github_client -->|"normalizes data"| node_normalizers
node_github_client -->|"reads GitHub"| node_developer
node_ingestion_service -->|"classifies repos"| node_domain_inference
node_ingestion_service -->|"upserts data"| node_postgres
node_worker -->|"records jobs"| node_postgres
node_profile_service -->|"reads profiles"| node_postgres
node_developer_routes -->|"gets profile"| node_profile_service
node_me_routes -->|"gets profile"| node_profile_service
node_profile_service -->|"builds signals"| node_domain_inference
node_postgres -->|"stores"| node_orm_models
node_schema -->|"initializes schema"| node_postgres
node_oauth -->|"authenticates via GitHub"| node_developer

click node_spa "https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/pages/Home.tsx"
click node_profile_view "https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/pages/Developer.tsx"
click node_api_client "https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/api.ts"
click node_ui_components "https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/components.tsx"
click node_auth_routes "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_auth.py"
click node_sync_routes "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_sync.py"
click node_developer_routes "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_developers.py"
click node_me_routes "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_me.py"
click node_sessions "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/sessions.py"
click node_oauth "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/oauth.py"
click node_worker "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/jobs.py"
click node_activity "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/github_activity.py"
click node_github_client "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/github.py"
click node_normalizers "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/normalizers.py"
click node_ingestion_service "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/ingestion.py"
click node_domain_inference "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/domains.py"
click node_profile_service "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/profiles.py"
click node_orm_models "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/models.py"
click node_schema "https://github.com/tp-shivha-shakthiy/trace/blob/main/app/schema.py"

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_spa,node_home,node_profile_view,node_api_client,node_ui_components toneBlue
class node_auth_routes,node_sync_routes,node_developer_routes,node_me_routes,node_sessions,node_oauth toneAmber
class node_worker,node_activity,node_github_client,node_normalizers,node_ingestion_service toneMint
class node_domain_inference,node_profile_service toneRose
class node_postgres,node_orm_models,node_schema,node_developer toneIndigo
```

## Components

### Web experience

- [React SPA](https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Developer search](https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/pages/Home.tsx): `frontend/src/pages/Home.tsx`
- [Profile view](https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/pages/Developer.tsx): `frontend/src/pages/Developer.tsx`
- [API client](https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/api.ts): `frontend/src/api.ts`
- [Profile components](https://github.com/tp-shivha-shakthiy/trace/blob/main/frontend/src/components.tsx): `frontend/src/components.tsx`

### API and identity

- [OAuth routes](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_auth.py): `app/api/routes_auth.py`
- [Sync routes](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_sync.py): `app/api/routes_sync.py`
- [Developer routes](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_developers.py): `app/api/routes_developers.py`
- [Identity routes](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/api/routes_me.py): `app/api/routes_me.py`
- [Sessions](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/sessions.py): `app/services/sessions.py`
- [OAuth service](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/oauth.py): `app/services/oauth.py`

### Ingestion pipeline

- [Job worker](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/jobs.py): `app/services/jobs.py`
- [GitHub activity](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/github_activity.py): `app/services/github_activity.py`
- [GitHub client](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/github.py): `app/github.py`
- [Event normalizers](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/normalizers.py): `app/normalizers.py`
- [Ingestion service](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/ingestion.py): `app/services/ingestion.py`

### Profile intelligence

- [Domain inference](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/domains.py): `app/services/domains.py`
- [Profile service](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/services/profiles.py): `app/services/profiles.py`

### Persistence

- **PostgreSQL**
- [Data models](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/models.py): `app/models.py`
- [Schema setup](https://github.com/tp-shivha-shakthiy/trace/blob/main/app/schema.py): `app/schema.py`

### Other components

- **Developer**

## Connections

- Developer → React SPA: uses
- React SPA → Developer search: renders (evidence: `frontend/src/App.tsx`)
- React SPA → Profile view: renders (evidence: `frontend/src/App.tsx`)
- Developer search → API client: requests (evidence: `frontend/src/pages/Home.tsx`)
- Profile view → API client: requests (evidence: `frontend/src/pages/Developer.tsx`)
- Profile view → Profile components: renders (evidence: `frontend/src/pages/Developer.tsx`)
- API client → Developer routes: calls API
- API client → Sync routes: calls API
- Developer → OAuth routes: signs in
- OAuth routes → OAuth service: exchanges code (evidence: `app/api/routes_auth.py`)
- OAuth routes → Sessions: creates session (evidence: `app/api/routes_auth.py`)
- OAuth routes → Job worker: enqueues sync (evidence: `app/api/routes_auth.py`)
- Developer → Sync routes: requests sync
- Sync routes → Job worker: enqueues job (evidence: `app/api/routes_sync.py`)
- Job worker → Ingestion service: runs ingestion (evidence: `app/services/jobs.py`)
- Ingestion service → GitHub activity: fetches bundle (evidence: `app/services/ingestion.py`)
- GitHub activity → GitHub client: fetches data (evidence: `app/services/github_activity.py`)
- GitHub client → Event normalizers: normalizes data
- GitHub client → Developer: reads GitHub (evidence: `app/github.py`)
- Ingestion service → Domain inference: classifies repos (evidence: `app/services/ingestion.py`)
- Ingestion service → PostgreSQL: upserts data
- Job worker → PostgreSQL: records jobs (evidence: `app/services/jobs.py`)
- Profile service → PostgreSQL: reads profiles
- Developer routes → Profile service: gets profile (evidence: `app/api/routes_developers.py`)
- Identity routes → Profile service: gets profile (evidence: `app/api/routes_me.py`)
- Profile service → Domain inference: builds signals (evidence: `app/services/profiles.py`)
- PostgreSQL → Data models: stores (evidence: `app/models.py`)
- Schema setup → PostgreSQL: initializes schema
- OAuth service → Developer: authenticates via GitHub
