# ctrl-freaks26/skillswap architecture

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

- Interactive diagram: https://gitdiagram.com/ctrl-freaks26/skillswap
- Repository: https://github.com/ctrl-freaks26/skillswap

## Overview

SkillSwap is a peer-to-peer skill-exchange product, with a React web client, an Expo mobile shell, and an Express REST API. The visible web journey runs from landing and account access through onboarding to a dashboard; the API currently implements registration, login, logout, and the current-user endpoint. Matching, swap sessions, and communication are documented product areas but remain API stubs. Edges reflect shown routing and calls or README statements; unsampled implementations and client-to-API request flows are not inferred.

Main entry points: [`apps/web/src/App.tsx`](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/App.tsx) (Web route shell), [`apps/api/src/routes.ts`](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/routes.ts) (Versioned API routes), [`apps/api/src/app.ts`](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/app.ts) (HTTP application), [`apps/web/src/pages/RegisterPage.tsx`](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/RegisterPage.tsx) (Registration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web route shell<br/>[App.tsx]"]
  node_landing["Landing page<br/>[LandingPage.tsx]"]
  node_registration["Registration<br/>[RegisterPage.tsx]"]
  node_login["Login<br/>[LoginPage.tsx]"]
  node_onboarding["Skill onboarding<br/>[OnboardingPage.tsx]"]
  node_dashboard["Dashboard<br/>[DashboardPage.tsx]"]
  node_appshell["Signed-in shell<br/>[AppShell.tsx]"]
  node_authaside["Auth branding<br/>[AuthAside.tsx]"]
end

subgraph group_mobile["Mobile client"]
  node_mobileapp["Mobile app shell<br/>[App.tsx]"]
  node_shared["Shared types<br/>[index.ts]"]
end

subgraph group_api["API runtime"]
  node_apiapp["HTTP application<br/>[app.ts]"]
  node_apiroutes["Versioned API routes<br/>[routes.ts]"]
  node_config["Runtime configuration<br/>[env.ts]"]
  node_postgres[("Postgres persistence<br/>[prisma.ts]")]
  node_redis[("Redis sessions<br/>[redis.ts]")]
end

subgraph group_identity["Identity"]
  node_identityroutes["Identity routes<br/>[identity.routes.ts]"]
  node_identitycontroller["Identity controller"]
  node_identityservice["Identity service"]
end

subgraph group_exchange["Exchange services"]
  node_matching["Skill matching"]
  node_communication["Chat and notifications"]
  node_swapsessions["Swap sessions<br/>[sessions.routes.ts]"]
end

node_visitor(("Student or staff"))

node_visitor -->|"uses"| node_webapp
node_webapp -->|"routes to"| node_landing
node_webapp -->|"routes to"| node_registration
node_webapp -->|"routes to"| node_login
node_webapp -->|"routes to"| node_onboarding
node_webapp -->|"routes to"| node_dashboard
node_webapp -->|"wraps signed-in pages"| node_appshell
node_registration -->|"renders"| node_authaside
node_login -->|"renders"| node_authaside
node_mobileapp -->|"uses skill levels"| node_shared
node_apiapp -->|"mounts API routes"| node_apiroutes
node_apiroutes -->|"mounts auth routes"| node_identityroutes
node_apiroutes -->|"mounts matches routes"| node_matching
node_apiroutes -->|"mounts conversations routes"| node_communication
node_apiroutes -->|"mounts swap routes"| node_swapsessions
node_apiapp -->|"stores sessions"| node_redis
node_apiapp -->|"reads settings"| node_config
node_identityroutes -->|"dispatches handlers"| node_identitycontroller
node_identitycontroller -->|"calls"| node_identityservice
node_identityservice -->|"accesses database"| node_postgres
node_matching -.->|"supports skill discovery"| node_visitor
node_communication -.->|"supports chat and alerts"| node_visitor
node_swapsessions -.->|"supports skill swaps"| node_visitor

click node_webapp "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/App.tsx"
click node_landing "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/LandingPage.tsx"
click node_registration "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/RegisterPage.tsx"
click node_login "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/LoginPage.tsx"
click node_onboarding "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/OnboardingPage.tsx"
click node_dashboard "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/DashboardPage.tsx"
click node_appshell "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/components/AppShell.tsx"
click node_authaside "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/components/AuthAside.tsx"
click node_mobileapp "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/mobile/App.tsx"
click node_shared "https://github.com/ctrl-freaks26/skillswap/blob/dev/packages/shared/src/index.ts"
click node_apiapp "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/app.ts"
click node_apiroutes "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/routes.ts"
click node_config "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/config/env.ts"
click node_postgres "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/common/db/prisma.ts"
click node_redis "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/common/redis/redis.ts"
click node_identityroutes "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/identity/identity.routes.ts"
click node_identitycontroller "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/identity/identity.controller.ts"
click node_identityservice "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/identity/identity.service.ts"
click node_matching "https://github.com/ctrl-freaks26/skillswap/tree/dev/apps/api/src/modules/matching"
click node_communication "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/communication/communication.routes.ts"
click node_swapsessions "https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/sessions/sessions.routes.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_webapp,node_landing,node_registration,node_login,node_onboarding,node_dashboard,node_appshell,node_authaside toneBlue
class node_mobileapp,node_shared toneAmber
class node_apiapp,node_apiroutes,node_config,node_postgres,node_redis toneMint
class node_identityroutes,node_identitycontroller,node_identityservice toneRose
class node_matching,node_communication,node_swapsessions,node_visitor toneIndigo
```

## Components

### Web experience

- [Web route shell](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/App.tsx): `apps/web/src/App.tsx`
- [Landing page](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/LandingPage.tsx): `apps/web/src/pages/LandingPage.tsx`
- [Registration](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/RegisterPage.tsx): `apps/web/src/pages/RegisterPage.tsx`
- [Login](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/LoginPage.tsx): `apps/web/src/pages/LoginPage.tsx`
- [Skill onboarding](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/OnboardingPage.tsx): `apps/web/src/pages/OnboardingPage.tsx`
- [Dashboard](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/pages/DashboardPage.tsx): `apps/web/src/pages/DashboardPage.tsx`
- [Signed-in shell](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/components/AppShell.tsx): `apps/web/src/components/AppShell.tsx`
- [Auth branding](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/web/src/components/AuthAside.tsx): `apps/web/src/components/AuthAside.tsx`

### Mobile client

- [Mobile app shell](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/mobile/App.tsx): `apps/mobile/App.tsx`
- [Shared types](https://github.com/ctrl-freaks26/skillswap/blob/dev/packages/shared/src/index.ts): `packages/shared/src/index.ts`

### API runtime

- [HTTP application](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Versioned API routes](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/routes.ts): `apps/api/src/routes.ts`
- [Runtime configuration](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/config/env.ts): `apps/api/src/config/env.ts`
- [Postgres persistence](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/common/db/prisma.ts): `apps/api/src/common/db/prisma.ts`
- [Redis sessions](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/common/redis/redis.ts): `apps/api/src/common/redis/redis.ts`

### Identity

- [Identity routes](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/identity/identity.routes.ts): `apps/api/src/modules/identity/identity.routes.ts`
- [Identity controller](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/identity/identity.controller.ts): `apps/api/src/modules/identity/identity.controller.ts`
- [Identity service](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/identity/identity.service.ts): `apps/api/src/modules/identity/identity.service.ts`

### Exchange services

- [Skill matching](https://github.com/ctrl-freaks26/skillswap/tree/dev/apps/api/src/modules/matching): `apps/api/src/modules/matching`
- [Chat and notifications](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/communication/communication.routes.ts): `apps/api/src/modules/communication/communication.routes.ts`
- [Swap sessions](https://github.com/ctrl-freaks26/skillswap/blob/dev/apps/api/src/modules/sessions/sessions.routes.ts): `apps/api/src/modules/sessions/sessions.routes.ts`

### Other components

- **Student or staff**

## Connections

- Student or staff → Web route shell: uses
- Web route shell → Landing page: routes to (evidence: `apps/web/src/App.tsx`)
- Web route shell → Registration: routes to (evidence: `apps/web/src/App.tsx`)
- Web route shell → Login: routes to (evidence: `apps/web/src/App.tsx`)
- Web route shell → Skill onboarding: routes to (evidence: `apps/web/src/App.tsx`)
- Web route shell → Dashboard: routes to (evidence: `apps/web/src/App.tsx`)
- Web route shell → Signed-in shell: wraps signed-in pages (evidence: `apps/web/src/App.tsx`)
- Registration → Auth branding: renders (evidence: `apps/web/src/pages/RegisterPage.tsx`)
- Login → Auth branding: renders (evidence: `apps/web/src/pages/LoginPage.tsx`)
- Mobile app shell → Shared types: uses skill levels (evidence: `apps/mobile/App.tsx`)
- HTTP application → Versioned API routes: mounts API routes (evidence: `apps/api/src/app.ts`)
- Versioned API routes → Identity routes: mounts auth routes (evidence: `apps/api/src/routes.ts`)
- Versioned API routes → Skill matching: mounts matches routes (evidence: `apps/api/src/routes.ts`)
- Versioned API routes → Chat and notifications: mounts conversations routes (evidence: `apps/api/src/routes.ts`)
- Versioned API routes → Swap sessions: mounts swap routes (evidence: `apps/api/src/routes.ts`)
- HTTP application → Redis sessions: stores sessions (evidence: `apps/api/src/app.ts`)
- HTTP application → Runtime configuration: reads settings (evidence: `apps/api/src/app.ts`)
- Identity routes → Identity controller: dispatches handlers (evidence: `apps/api/src/modules/identity/identity.routes.ts`)
- Identity controller → Identity service: calls (evidence: `apps/api/src/modules/identity/identity.controller.ts`)
- Identity service → Postgres persistence: accesses database (evidence: `apps/api/src/modules/identity/identity.service.ts`)
- Skill matching → Student or staff: supports skill discovery (evidence: `README.md`)
- Chat and notifications → Student or staff: supports chat and alerts (evidence: `apps/api/src/modules/communication/communication.routes.ts`)
- Swap sessions → Student or staff: supports skill swaps (evidence: `README.md`)
