# thetechwrangler/social-site architecture

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

- Interactive diagram: https://gitdiagram.com/thetechwrangler/social-site
- Repository: https://github.com/thetechwrangler/social-site

## Overview

Social Site is a chronological, user-controlled social platform. People use its React interface to sign in, publish and interact with posts, follow people, join groups, discover games, message, and browse external-world content; administrators moderate accounts and reports. The browser API client connects those experiences to Express route modules and SQLite-backed services. The README documents the principal capabilities, while source excerpts show server initialization, authentication, feed/API behavior, and selected service dependencies; several feature-specific internals are not sampled, so their detailed links are omitted.

Main entry points: [`server/routes/auth.ts`](https://github.com/thetechwrangler/social-site/blob/main/server/routes/auth.ts) (Authentication), [`server/index.ts`](https://github.com/thetechwrangler/social-site/blob/main/server/index.ts) (Express API), [`server/database.ts`](https://github.com/thetechwrangler/social-site/blob/main/server/database.ts) (SQLite database), [`src/api/client.ts`](https://github.com/thetechwrangler/social-site/blob/main/src/api/client.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web experience"]
  node_app["React application<br/>[App.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_home["Home feed<br/>[HomePage.tsx]"]
  node_profile["Profiles<br/>[ProfilePage.tsx]"]
  node_admin_ui["Admin console<br/>[AdminPage.tsx]"]
  node_post_card["Post card<br/>[PostCard.tsx]"]
end

subgraph group_api["API and identity"]
  node_server["Express API<br/>[index.ts]"]
  node_auth_routes["Authentication<br/>[auth.ts]"]
  node_auth_providers["OAuth providers<br/>[authProviders.ts]"]
  node_middleware["Access middleware<br/>[middleware.ts]"]
end

subgraph group_social["Social features"]
  node_feed_routes["Feed endpoints<br/>[feed.ts]"]
  node_post_routes["Posts and comments<br/>[posts.ts]"]
  node_groups_routes["Groups<br/>[groups.ts]"]
  node_messages_routes["Direct messages<br/>[messages.ts]"]
  node_admin_routes["Moderation<br/>[admin.ts]"]
end

subgraph group_discovery["Discovery and media"]
  node_games_routes["Games and LFG<br/>[games.ts]"]
  node_rss_service["RSS and world feed<br/>[rssService.ts]"]
  node_external_content["External content"]
  node_youtube["YouTube integration<br/>[youtubeService.ts]"]
end

subgraph group_platform["Persistence and operations"]
  node_database[("SQLite database<br/>[database.ts]")]
  node_auth_events["Auth event logging<br/>[authEvents.ts]"]
  node_email["Email delivery<br/>[email.ts]"]
  node_diagnostics["Safe diagnostics<br/>[safeDiagnostics.ts]"]
end

node_person(("Person"))

node_person -->|"uses"| node_app
node_app -->|"requests through"| node_api_client
node_server -->|"initializes"| node_database
node_server -->|"mounts"| node_auth_routes
node_server -->|"mounts"| node_feed_routes
node_server -->|"mounts"| node_admin_routes
node_server -->|"configures"| node_auth_providers
node_auth_routes -->|"reads and writes"| node_database
node_auth_routes -->|"records events"| node_auth_events
node_auth_routes -->|"sends mail"| node_email
node_auth_routes -->|"logs failures"| node_diagnostics
node_auth_providers -->|"uses"| node_database
node_auth_providers -->|"uses"| node_auth_events
node_auth_providers -->|"logs failures"| node_diagnostics
node_middleware -->|"authenticates requests"| node_auth_routes
node_admin_routes -->|"reads and writes"| node_database
node_admin_routes -->|"guards operations"| node_middleware
node_admin_routes -->|"records actions"| node_auth_events
node_api_client -->|"requests feed"| node_feed_routes
node_rss_service -->|"reads and writes"| node_database
node_rss_service -->|"uses service"| node_external_content
node_rss_service -->|"uses service"| node_youtube
node_external_content -->|"reads and writes"| node_database
node_post_card -->|"loads interactions"| node_api_client
node_profile -->|"loads profile"| node_api_client
node_admin_ui -->|"requests admin data"| node_api_client

click node_app "https://github.com/thetechwrangler/social-site/blob/main/src/App.tsx"
click node_api_client "https://github.com/thetechwrangler/social-site/blob/main/src/api/client.ts"
click node_home "https://github.com/thetechwrangler/social-site/blob/main/src/pages/HomePage.tsx"
click node_profile "https://github.com/thetechwrangler/social-site/blob/main/src/pages/ProfilePage.tsx"
click node_admin_ui "https://github.com/thetechwrangler/social-site/blob/main/src/pages/AdminPage.tsx"
click node_post_card "https://github.com/thetechwrangler/social-site/blob/main/src/components/PostCard.tsx"
click node_server "https://github.com/thetechwrangler/social-site/blob/main/server/index.ts"
click node_auth_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/auth.ts"
click node_auth_providers "https://github.com/thetechwrangler/social-site/blob/main/server/authProviders.ts"
click node_middleware "https://github.com/thetechwrangler/social-site/blob/main/server/middleware.ts"
click node_feed_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/feed.ts"
click node_post_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/posts.ts"
click node_groups_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/groups.ts"
click node_messages_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/messages.ts"
click node_admin_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/admin.ts"
click node_games_routes "https://github.com/thetechwrangler/social-site/blob/main/server/routes/games.ts"
click node_rss_service "https://github.com/thetechwrangler/social-site/blob/main/server/rssService.ts"
click node_external_content "https://github.com/thetechwrangler/social-site/blob/main/server/externalContentService.ts"
click node_youtube "https://github.com/thetechwrangler/social-site/blob/main/server/youtubeService.ts"
click node_database "https://github.com/thetechwrangler/social-site/blob/main/server/database.ts"
click node_auth_events "https://github.com/thetechwrangler/social-site/blob/main/server/authEvents.ts"
click node_email "https://github.com/thetechwrangler/social-site/blob/main/server/email.ts"
click node_diagnostics "https://github.com/thetechwrangler/social-site/blob/main/server/safeDiagnostics.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_api_client,node_home,node_profile,node_admin_ui,node_post_card toneBlue
class node_server,node_auth_routes,node_auth_providers,node_middleware toneAmber
class node_feed_routes,node_post_routes,node_groups_routes,node_messages_routes,node_admin_routes toneMint
class node_games_routes,node_rss_service,node_external_content,node_youtube toneRose
class node_database,node_auth_events,node_email,node_diagnostics,node_person toneIndigo
```

## Components

### Web experience

- [React application](https://github.com/thetechwrangler/social-site/blob/main/src/App.tsx): `src/App.tsx`
- [API client](https://github.com/thetechwrangler/social-site/blob/main/src/api/client.ts): `src/api/client.ts`
- [Home feed](https://github.com/thetechwrangler/social-site/blob/main/src/pages/HomePage.tsx): `src/pages/HomePage.tsx`
- [Profiles](https://github.com/thetechwrangler/social-site/blob/main/src/pages/ProfilePage.tsx): `src/pages/ProfilePage.tsx`
- [Admin console](https://github.com/thetechwrangler/social-site/blob/main/src/pages/AdminPage.tsx): `src/pages/AdminPage.tsx`
- [Post card](https://github.com/thetechwrangler/social-site/blob/main/src/components/PostCard.tsx): `src/components/PostCard.tsx`

### API and identity

- [Express API](https://github.com/thetechwrangler/social-site/blob/main/server/index.ts): `server/index.ts`
- [Authentication](https://github.com/thetechwrangler/social-site/blob/main/server/routes/auth.ts): `server/routes/auth.ts`
- [OAuth providers](https://github.com/thetechwrangler/social-site/blob/main/server/authProviders.ts): `server/authProviders.ts`
- [Access middleware](https://github.com/thetechwrangler/social-site/blob/main/server/middleware.ts): `server/middleware.ts`

### Social features

- [Feed endpoints](https://github.com/thetechwrangler/social-site/blob/main/server/routes/feed.ts): `server/routes/feed.ts`
- [Posts and comments](https://github.com/thetechwrangler/social-site/blob/main/server/routes/posts.ts): `server/routes/posts.ts`
- [Groups](https://github.com/thetechwrangler/social-site/blob/main/server/routes/groups.ts): `server/routes/groups.ts`
- [Direct messages](https://github.com/thetechwrangler/social-site/blob/main/server/routes/messages.ts): `server/routes/messages.ts`
- [Moderation](https://github.com/thetechwrangler/social-site/blob/main/server/routes/admin.ts): `server/routes/admin.ts`

### Discovery and media

- [Games and LFG](https://github.com/thetechwrangler/social-site/blob/main/server/routes/games.ts): `server/routes/games.ts`
- [RSS and world feed](https://github.com/thetechwrangler/social-site/blob/main/server/rssService.ts): `server/rssService.ts`
- [External content](https://github.com/thetechwrangler/social-site/blob/main/server/externalContentService.ts): `server/externalContentService.ts`
- [YouTube integration](https://github.com/thetechwrangler/social-site/blob/main/server/youtubeService.ts): `server/youtubeService.ts`

### Persistence and operations

- [SQLite database](https://github.com/thetechwrangler/social-site/blob/main/server/database.ts): `server/database.ts`
- [Auth event logging](https://github.com/thetechwrangler/social-site/blob/main/server/authEvents.ts): `server/authEvents.ts`
- [Email delivery](https://github.com/thetechwrangler/social-site/blob/main/server/email.ts): `server/email.ts`
- [Safe diagnostics](https://github.com/thetechwrangler/social-site/blob/main/server/safeDiagnostics.ts): `server/safeDiagnostics.ts`

### Other components

- **Person**

## Connections

- Person → React application: uses (evidence: `README.md`)
- React application → API client: requests through (evidence: `src/App.tsx`)
- Express API → SQLite database: initializes (evidence: `server/index.ts`)
- Express API → Authentication: mounts (evidence: `server/index.ts`)
- Express API → Feed endpoints: mounts (evidence: `server/index.ts`)
- Express API → Moderation: mounts (evidence: `server/index.ts`)
- Express API → OAuth providers: configures (evidence: `server/index.ts`)
- Authentication → SQLite database: reads and writes (evidence: `server/routes/auth.ts`)
- Authentication → Auth event logging: records events (evidence: `server/routes/auth.ts`)
- Authentication → Email delivery: sends mail (evidence: `server/routes/auth.ts`)
- Authentication → Safe diagnostics: logs failures (evidence: `server/routes/auth.ts`)
- OAuth providers → SQLite database: uses (evidence: `server/authProviders.ts`)
- OAuth providers → Auth event logging: uses (evidence: `server/authProviders.ts`)
- OAuth providers → Safe diagnostics: logs failures (evidence: `server/authProviders.ts`)
- Access middleware → Authentication: authenticates requests (evidence: `server/middleware.ts`)
- Moderation → SQLite database: reads and writes (evidence: `server/routes/admin.ts`)
- Moderation → Access middleware: guards operations (evidence: `server/routes/admin.ts`)
- Moderation → Auth event logging: records actions (evidence: `server/routes/admin.ts`)
- API client → Feed endpoints: requests feed (evidence: `src/api/client.ts`)
- RSS and world feed → SQLite database: reads and writes (evidence: `server/rssService.ts`)
- RSS and world feed → External content: uses service (evidence: `server/rssService.ts`)
- RSS and world feed → YouTube integration: uses service (evidence: `server/rssService.ts`)
- External content → SQLite database: reads and writes (evidence: `server/externalContentService.ts`)
- Post card → API client: loads interactions (evidence: `src/components/PostCard.tsx`)
- Profiles → API client: loads profile (evidence: `src/pages/ProfilePage.tsx`)
- Admin console → API client: requests admin data (evidence: `src/pages/AdminPage.tsx`)
