# anshulkavi/skillswap_platform architecture

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

- Interactive diagram: https://gitdiagram.com/anshulkavi/skillswap_platform
- Repository: https://github.com/anshulkavi/skillswap_platform

## Overview

SkillSwap is a skill-exchange and collaborative-learning platform. A user enters through the React app, authenticates, and can discover or publish skill listings, connect with other members, and use community, learning-video, leaderboard, and messaging features. FastAPI routes handle those domain actions, with authentication, schemas, and relational persistence as shared internal layers; chat and video calling also use WebSocket signaling. The graph reflects documented routes and indexed imports; several frontend feature pages and backend route implementations were not sampled, so unverified links are omitted or marked dashed.

Main entry points: [`SkillSwap-backend/main.py`](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/main.py) (FastAPI application), [`SkillSwap-backend/models/database.py`](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/models/database.py) (SQL database), [`SkillSwap-frontend/src/routes/AppRouter.jsx`](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/routes/AppRouter.jsx) (Route dispatch), [`SkillSwap-backend/routers/skill_exchange.py`](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/skill_exchange.py) (Listings and requests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_app["App shell<br/>[App.jsx]"]
  node_router["Route dispatch<br/>[AppRouter.jsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_authroutes["Login and signup<br/>[login.py]"]
  node_authcore["Token validation<br/>[dependencies.py]"]
  node_profile["User profiles<br/>[profile.py]"]
end

subgraph group_exchange["Skill exchange"]
  node_exchangeui["Exchange browsing"]
  node_listings["Listings and requests<br/>[skill_exchange.py]"]
end

subgraph group_community["Community and learning"]
  node_communityui["Community feed<br/>[CommunityPage.jsx]"]
  node_communityapi["Community posts<br/>[community.py]"]
  node_videosui["Learning videos<br/>[VideosPage.jsx]"]
  node_videosapi["Video catalog<br/>[videos.py]"]
  node_leaderboard["Leaderboard<br/>[leaderboard.py]"]
end

subgraph group_communication["Real-time communication"]
  node_chatui["Chat interface<br/>[ChatLayout.jsx]"]
  node_socketclient["WebSocket client<br/>[useWebSocket.js]"]
  node_chatapi["Chat routes<br/>[chat.py]"]
  node_videocall["Video signaling<br/>[video_call.py]"]
  node_connections["Room connections"]
end

subgraph group_backend["API and persistence"]
  node_api["FastAPI application<br/>[main.py]"]
  node_database[("SQL database<br/>[database.py]")]
  node_models["Domain models<br/>[models.py]"]
  node_schemas["API schemas<br/>[schemas.py]"]
end

node_member(("Member"))
node_media["Cloudinary storage"]

node_member -->|"uses"| node_app
node_app -->|"renders"| node_router
node_app -->|"provides auth"| node_authui
node_router -->|"checks auth"| node_authui
node_router -->|"routes to"| node_exchangeui
node_router -->|"routes to"| node_communityui
node_router -->|"routes to"| node_videosui
node_router -->|"routes to"| node_chatui
node_authui -->|"calls API"| node_authroutes
node_authroutes -->|"validates tokens"| node_authcore
node_authroutes -->|"reads and writes"| node_database
node_profile -->|"reads and writes"| node_database
node_exchangeui -.->|"requests listings"| node_listings
node_listings -->|"reads and writes"| node_database
node_listings -->|"requires user"| node_authcore
node_listings -->|"validates data"| node_schemas
node_communityui -.->|"requests feed"| node_communityapi
node_communityapi -->|"reads and writes"| node_database
node_communityapi -->|"requires user"| node_authcore
node_videosui -.->|"requests videos"| node_videosapi
node_videosapi -->|"reads and writes"| node_database
node_videosapi -->|"uploads media"| node_media
node_leaderboard -->|"reads scores"| node_database
node_chatui -.->|"uses socket"| node_socketclient
node_socketclient -.->|"opens socket"| node_chatapi
node_chatapi -->|"broadcasts messages"| node_connections
node_chatapi -->|"stores messages"| node_database
node_videocall -->|"manages rooms"| node_connections
node_api -->|"registers routes"| node_authroutes
node_api -->|"registers routes"| node_profile
node_api -->|"registers routes"| node_listings
node_api -->|"registers routes"| node_communityapi
node_api -->|"registers routes"| node_leaderboard
node_api -->|"registers routes"| node_videosapi
node_api -->|"registers routes"| node_chatapi
node_api -->|"registers routes"| node_videocall
node_api -->|"creates tables"| node_database
node_models -->|"uses base"| node_database

click node_app "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/App.jsx"
click node_router "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/routes/AppRouter.jsx"
click node_authui "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/context/AuthContext.jsx"
click node_authroutes "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/login.py"
click node_authcore "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/auth/dependencies.py"
click node_profile "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/profile.py"
click node_exchangeui "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/SkillExchangePage.jsx"
click node_listings "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/skill_exchange.py"
click node_communityui "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/CommunityPage.jsx"
click node_communityapi "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/community.py"
click node_videosui "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/VideosPage.jsx"
click node_videosapi "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/videos.py"
click node_leaderboard "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/leaderboard.py"
click node_chatui "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/ChatLayout.jsx"
click node_socketclient "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/hooks/useWebSocket.js"
click node_chatapi "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/chat.py"
click node_videocall "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/video_call.py"
click node_connections "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/websocket_manager.py"
click node_api "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/main.py"
click node_database "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/models/database.py"
click node_models "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/models/models.py"
click node_schemas "https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/schemas.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_app,node_router toneBlue
class node_authui,node_authroutes,node_authcore,node_profile,node_media toneAmber
class node_exchangeui,node_listings toneMint
class node_communityui,node_communityapi,node_videosui,node_videosapi,node_leaderboard toneRose
class node_chatui,node_socketclient,node_chatapi,node_videocall,node_connections,node_member toneIndigo
class node_api,node_database,node_models,node_schemas toneTeal
```

## Components

### React client

- [App shell](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/App.jsx): `SkillSwap-frontend/src/App.jsx`
- [Route dispatch](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/routes/AppRouter.jsx): `SkillSwap-frontend/src/routes/AppRouter.jsx`

### Identity and profiles

- [Auth state](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/context/AuthContext.jsx): `SkillSwap-frontend/src/context/AuthContext.jsx`
- [Login and signup](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/login.py): `SkillSwap-backend/routers/login.py`
- [Token validation](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/auth/dependencies.py): `SkillSwap-backend/auth/dependencies.py`
- [User profiles](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/profile.py): `SkillSwap-backend/routers/profile.py`

### Skill exchange

- [Exchange browsing](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/SkillExchangePage.jsx): `SkillSwap-frontend/src/pages/SkillExchangePage.jsx`
- [Listings and requests](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/skill_exchange.py): `SkillSwap-backend/routers/skill_exchange.py`

### Community and learning

- [Community feed](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/CommunityPage.jsx): `SkillSwap-frontend/src/pages/CommunityPage.jsx`
- [Community posts](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/community.py): `SkillSwap-backend/routers/community.py`
- [Learning videos](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/VideosPage.jsx): `SkillSwap-frontend/src/pages/VideosPage.jsx`
- [Video catalog](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/videos.py): `SkillSwap-backend/routers/videos.py`
- [Leaderboard](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/leaderboard.py): `SkillSwap-backend/routers/leaderboard.py`

### Real-time communication

- [Chat interface](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/pages/ChatLayout.jsx): `SkillSwap-frontend/src/pages/ChatLayout.jsx`
- [WebSocket client](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-frontend/src/hooks/useWebSocket.js): `SkillSwap-frontend/src/hooks/useWebSocket.js`
- [Chat routes](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/chat.py): `SkillSwap-backend/routers/chat.py`
- [Video signaling](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/routers/video_call.py): `SkillSwap-backend/routers/video_call.py`
- [Room connections](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/websocket_manager.py): `SkillSwap-backend/websocket_manager.py`

### API and persistence

- [FastAPI application](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/main.py): `SkillSwap-backend/main.py`
- [SQL database](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/models/database.py): `SkillSwap-backend/models/database.py`
- [Domain models](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/models/models.py): `SkillSwap-backend/models/models.py`
- [API schemas](https://github.com/anshulkavi/skillswap_platform/blob/main/SkillSwap-backend/schemas.py): `SkillSwap-backend/schemas.py`

### Other components

- **Member**
- **Cloudinary storage**

## Connections

- Member → App shell: uses (evidence: `README.md`)
- App shell → Route dispatch: renders (evidence: `SkillSwap-frontend/src/App.jsx`)
- App shell → Auth state: provides auth (evidence: `SkillSwap-frontend/src/App.jsx`)
- Route dispatch → Auth state: checks auth (evidence: `SkillSwap-frontend/src/routes/AppRouter.jsx`)
- Route dispatch → Exchange browsing: routes to (evidence: `SkillSwap-frontend/src/routes/AppRouter.jsx`)
- Route dispatch → Community feed: routes to (evidence: `SkillSwap-frontend/src/routes/AppRouter.jsx`)
- Route dispatch → Learning videos: routes to (evidence: `SkillSwap-frontend/src/routes/AppRouter.jsx`)
- Route dispatch → Chat interface: routes to (evidence: `SkillSwap-frontend/src/routes/AppRouter.jsx`)
- Auth state → Login and signup: calls API (evidence: `SkillSwap-frontend/src/context/AuthContext.jsx`)
- Login and signup → Token validation: validates tokens (evidence: `SkillSwap-backend/auth/dependencies.py`)
- Login and signup → SQL database: reads and writes (evidence: `SkillSwap-backend/routers/login.py`)
- User profiles → SQL database: reads and writes (evidence: `SkillSwap-backend/routers/profile.py`)
- Exchange browsing → Listings and requests: requests listings
- Listings and requests → SQL database: reads and writes (evidence: `SkillSwap-backend/routers/skill_exchange.py`)
- Listings and requests → Token validation: requires user (evidence: `SkillSwap-backend/routers/skill_exchange.py`)
- Listings and requests → API schemas: validates data (evidence: `SkillSwap-backend/routers/skill_exchange.py`)
- Community feed → Community posts: requests feed
- Community posts → SQL database: reads and writes (evidence: `SkillSwap-backend/routers/community.py`)
- Community posts → Token validation: requires user (evidence: `SkillSwap-backend/routers/community.py`)
- Learning videos → Video catalog: requests videos
- Video catalog → SQL database: reads and writes (evidence: `SkillSwap-backend/routers/videos.py`)
- Video catalog → Cloudinary storage: uploads media (evidence: `SkillSwap-backend/routers/videos.py`)
- Leaderboard → SQL database: reads scores (evidence: `SkillSwap-backend/routers/leaderboard.py`)
- Chat interface → WebSocket client: uses socket
- WebSocket client → Chat routes: opens socket
- Chat routes → Room connections: broadcasts messages (evidence: `SkillSwap-backend/routers/chat.py`)
- Chat routes → SQL database: stores messages (evidence: `SkillSwap-backend/routers/chat.py`)
- Video signaling → Room connections: manages rooms (evidence: `SkillSwap-backend/routers/video_call.py`)
- FastAPI application → Login and signup: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → User profiles: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → Listings and requests: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → Community posts: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → Leaderboard: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → Video catalog: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → Chat routes: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → Video signaling: registers routes (evidence: `SkillSwap-backend/main.py`)
- FastAPI application → SQL database: creates tables (evidence: `SkillSwap-backend/main.py`)
- Domain models → SQL database: uses base (evidence: `SkillSwap-backend/models/models.py`)
