# peter812/prm architecture

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

- Interactive diagram: https://gitdiagram.com/peter812/prm
- Repository: https://github.com/peter812/prm

## Overview

PRM is a personal relationship manager for recording people and their connections, notes, interactions, groups, social accounts, and family relationships. The main workflow is a signed-in user navigating the web app, making API requests, and managing relationship data persisted in PostgreSQL. The application also exposes family-tree, social-media, AI/vector, import/export, image-storage, and background-task capabilities. The README gives only a brief product description; several branches are represented by routes and pages in the tree, but their detailed server-side wiring was not sampled.

Main entry points: [`client/src/App.tsx`](https://github.com/peter812/prm/blob/main/client/src/App.tsx) (App and router), [`client/src/lib/queryClient.ts`](https://github.com/peter812/prm/blob/main/client/src/lib/queryClient.ts) (API client), [`server/routes.ts`](https://github.com/peter812/prm/blob/main/server/routes.ts) (Route registration), [`server/routes/auth-setup.ts`](https://github.com/peter812/prm/blob/main/server/routes/auth-setup.ts) (Auth and import routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Web experience"]
  node_app["App and router<br/>[App.tsx]"]
  node_imagesui["Image management<br/>[images-list.tsx]"]
  node_query["API client<br/>[queryClient.ts]"]
end

subgraph group_api["API and workflows"]
  node_importui["Import and export"]
  node_tasksui["Task controls<br/>[tasks-settings.tsx]"]
  node_routes["Route registration<br/>[routes.ts]"]
  node_authroutes["Auth and import routes<br/>[auth-setup.ts]"]
  node_socialroutes["People and social routes<br/>[people-groups.ts]"]
  node_familyroutes["Family routes<br/>[family.ts]"]
  node_socialmediaroutes["Social media routes<br/>[social-media.ts]"]
end

subgraph group_relationship["Relationship management"]
  node_people["People profiles<br/>[people-list.tsx]"]
  node_familyui["Family tree UI<br/>[family-tree.tsx]"]
  node_socialui["Social graph UI"]
  node_notesui["Notes and interactions<br/>[notes-tab.tsx]"]
end

subgraph group_intelligence["Search and intelligence"]
  node_airoutes["AI and vector routes<br/>[ai-vector.ts]"]
  node_aitools["AI tools<br/>[ai-tools.ts]"]
  node_familyai["Family tree AI<br/>[family-tree-ai.ts]"]
  node_vector["Vector search"]
end

subgraph group_persistence["Persistence and media"]
  node_storage["Domain storage<br/>[storage.ts]"]
  node_schema["Domain schema<br/>[schema.ts]"]
  node_db[("PostgreSQL<br/>[db.ts]")]
  node_s3["S3 image storage<br/>[s3.ts]"]
  node_local["Local image storage<br/>[local-storage.ts]"]
end

node_user(("Signed-in user"))
node_postgres[("PostgreSQL service")]
node_cloud["S3 service"]

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_people
node_app -->|"routes to"| node_familyui
node_app -->|"routes to"| node_socialui
node_app -->|"shows"| node_notesui
node_app -->|"routes to"| node_importui
node_app -->|"routes to"| node_imagesui
node_app -->|"routes to"| node_tasksui
node_people -->|"requests API"| node_query
node_familyui -->|"requests API"| node_query
node_socialui -->|"requests API"| node_query
node_notesui -->|"requests API"| node_query
node_importui -->|"requests API"| node_query
node_imagesui -->|"requests API"| node_query
node_tasksui -->|"requests API"| node_query
node_query -->|"sends HTTP"| node_routes
node_routes -->|"registers"| node_authroutes
node_routes -->|"registers"| node_socialroutes
node_routes -->|"registers"| node_socialmediaroutes
node_routes -->|"registers"| node_airoutes
node_routes -->|"registers"| node_familyroutes
node_authroutes -->|"reads and writes"| node_storage
node_authroutes -->|"uploads and deletes"| node_s3
node_authroutes -->|"uploads and deletes"| node_local
node_storage -->|"queries"| node_db
node_storage -->|"uses tables"| node_schema
node_db -->|"connects"| node_postgres
node_s3 -->|"stores images"| node_cloud
node_airoutes -->|"dispatches search"| node_vector
node_airoutes -->|"exposes tools"| node_aitools
node_airoutes -->|"exposes family AI"| node_familyai

click node_app "https://github.com/peter812/prm/blob/main/client/src/App.tsx"
click node_people "https://github.com/peter812/prm/blob/main/client/src/pages/people-list.tsx"
click node_familyui "https://github.com/peter812/prm/blob/main/client/src/pages/family-tree.tsx"
click node_socialui "https://github.com/peter812/prm/blob/main/client/src/pages/social-graph-3d.tsx"
click node_notesui "https://github.com/peter812/prm/blob/main/client/src/components/notes-tab.tsx"
click node_importui "https://github.com/peter812/prm/blob/main/client/src/pages/import-export-home.tsx"
click node_imagesui "https://github.com/peter812/prm/blob/main/client/src/pages/images-list.tsx"
click node_tasksui "https://github.com/peter812/prm/blob/main/client/src/pages/tasks-settings.tsx"
click node_query "https://github.com/peter812/prm/blob/main/client/src/lib/queryClient.ts"
click node_routes "https://github.com/peter812/prm/blob/main/server/routes.ts"
click node_authroutes "https://github.com/peter812/prm/blob/main/server/routes/auth-setup.ts"
click node_socialroutes "https://github.com/peter812/prm/blob/main/server/routes/people-groups.ts"
click node_familyroutes "https://github.com/peter812/prm/blob/main/server/routes/family.ts"
click node_socialmediaroutes "https://github.com/peter812/prm/blob/main/server/routes/social-media.ts"
click node_airoutes "https://github.com/peter812/prm/blob/main/server/routes/ai-vector.ts"
click node_aitools "https://github.com/peter812/prm/blob/main/server/ai-tools.ts"
click node_familyai "https://github.com/peter812/prm/blob/main/server/family-tree-ai.ts"
click node_vector "https://github.com/peter812/prm/blob/main/server/vector-universal.ts"
click node_storage "https://github.com/peter812/prm/blob/main/server/storage.ts"
click node_schema "https://github.com/peter812/prm/blob/main/shared/schema.ts"
click node_db "https://github.com/peter812/prm/blob/main/server/db.ts"
click node_s3 "https://github.com/peter812/prm/blob/main/server/s3.ts"
click node_local "https://github.com/peter812/prm/blob/main/server/local-storage.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_app,node_imagesui,node_query,node_user toneBlue
class node_importui,node_tasksui,node_routes,node_authroutes,node_socialroutes,node_familyroutes,node_socialmediaroutes,node_postgres toneAmber
class node_people,node_familyui,node_socialui,node_notesui toneMint
class node_airoutes,node_aitools,node_familyai,node_vector toneRose
class node_storage,node_schema,node_db,node_s3,node_local,node_cloud toneIndigo
```

## Components

### Web experience

- [App and router](https://github.com/peter812/prm/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Image management](https://github.com/peter812/prm/blob/main/client/src/pages/images-list.tsx): `client/src/pages/images-list.tsx`
- [API client](https://github.com/peter812/prm/blob/main/client/src/lib/queryClient.ts): `client/src/lib/queryClient.ts`

### API and workflows

- [Import and export](https://github.com/peter812/prm/blob/main/client/src/pages/import-export-home.tsx): `client/src/pages/import-export-home.tsx`
- [Task controls](https://github.com/peter812/prm/blob/main/client/src/pages/tasks-settings.tsx): `client/src/pages/tasks-settings.tsx`
- [Route registration](https://github.com/peter812/prm/blob/main/server/routes.ts): `server/routes.ts`
- [Auth and import routes](https://github.com/peter812/prm/blob/main/server/routes/auth-setup.ts): `server/routes/auth-setup.ts`
- [People and social routes](https://github.com/peter812/prm/blob/main/server/routes/people-groups.ts): `server/routes/people-groups.ts`
- [Family routes](https://github.com/peter812/prm/blob/main/server/routes/family.ts): `server/routes/family.ts`
- [Social media routes](https://github.com/peter812/prm/blob/main/server/routes/social-media.ts): `server/routes/social-media.ts`

### Relationship management

- [People profiles](https://github.com/peter812/prm/blob/main/client/src/pages/people-list.tsx): `client/src/pages/people-list.tsx`
- [Family tree UI](https://github.com/peter812/prm/blob/main/client/src/pages/family-tree.tsx): `client/src/pages/family-tree.tsx`
- [Social graph UI](https://github.com/peter812/prm/blob/main/client/src/pages/social-graph-3d.tsx): `client/src/pages/social-graph-3d.tsx`
- [Notes and interactions](https://github.com/peter812/prm/blob/main/client/src/components/notes-tab.tsx): `client/src/components/notes-tab.tsx`

### Search and intelligence

- [AI and vector routes](https://github.com/peter812/prm/blob/main/server/routes/ai-vector.ts): `server/routes/ai-vector.ts`
- [AI tools](https://github.com/peter812/prm/blob/main/server/ai-tools.ts): `server/ai-tools.ts`
- [Family tree AI](https://github.com/peter812/prm/blob/main/server/family-tree-ai.ts): `server/family-tree-ai.ts`
- [Vector search](https://github.com/peter812/prm/blob/main/server/vector-universal.ts): `server/vector-universal.ts`

### Persistence and media

- [Domain storage](https://github.com/peter812/prm/blob/main/server/storage.ts): `server/storage.ts`
- [Domain schema](https://github.com/peter812/prm/blob/main/shared/schema.ts): `shared/schema.ts`
- [PostgreSQL](https://github.com/peter812/prm/blob/main/server/db.ts): `server/db.ts`
- [S3 image storage](https://github.com/peter812/prm/blob/main/server/s3.ts): `server/s3.ts`
- [Local image storage](https://github.com/peter812/prm/blob/main/server/local-storage.ts): `server/local-storage.ts`

### Other components

- **Signed-in user**
- **PostgreSQL service**
- **S3 service**

## Connections

- Signed-in user → App and router: uses
- App and router → People profiles: routes to
- App and router → Family tree UI: routes to
- App and router → Social graph UI: routes to
- App and router → Notes and interactions: shows
- App and router → Import and export: routes to
- App and router → Image management: routes to
- App and router → Task controls: routes to
- People profiles → API client: requests API
- Family tree UI → API client: requests API
- Social graph UI → API client: requests API
- Notes and interactions → API client: requests API
- Import and export → API client: requests API
- Image management → API client: requests API
- Task controls → API client: requests API
- API client → Route registration: sends HTTP
- Route registration → Auth and import routes: registers
- Route registration → People and social routes: registers
- Route registration → Social media routes: registers
- Route registration → AI and vector routes: registers
- Route registration → Family routes: registers
- Auth and import routes → Domain storage: reads and writes
- Auth and import routes → S3 image storage: uploads and deletes
- Auth and import routes → Local image storage: uploads and deletes
- Domain storage → PostgreSQL: queries
- Domain storage → Domain schema: uses tables
- PostgreSQL → PostgreSQL service: connects
- S3 image storage → S3 service: stores images
- AI and vector routes → Vector search: dispatches search
- AI and vector routes → AI tools: exposes tools
- AI and vector routes → Family tree AI: exposes family AI
