# harshwss23/incogniito architecture

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

- Interactive diagram: https://gitdiagram.com/harshwss23/incogniito
- Repository: https://github.com/harshwss23/incogniito

## Overview

IncognIITo is an IIT Kanpur-restricted anonymous social-matching platform. Students verify by email OTP, authenticate, find a queued match, then interact through live video signaling and realtime chat; sessions can be rated and users can pursue persistent connections. Profiles, reporting/blocking, and admin moderation form parallel safety and community workflows. The graph combines sampled wiring with README-documented capabilities; unsampled modules are represented by their exact tree paths, without asserting unverified internal calls.

Main entry points: [`backend/src/server.ts`](https://github.com/harshwss23/incogniito/blob/main/backend/src/server.ts) (HTTP and socket server), [`src/app/routes/AppRoutes.tsx`](https://github.com/harshwss23/incogniito/blob/main/src/app/routes/AppRoutes.tsx) (App routes), [`backend/src/config/database.ts`](https://github.com/harshwss23/incogniito/blob/main/backend/src/config/database.ts) (PostgreSQL), [`backend/src/controllers/matchController.ts`](https://github.com/harshwss23/incogniito/blob/main/backend/src/controllers/matchController.ts) (Match API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App shell<br/>[App.tsx]"]
  node_routes["App routes<br/>[AppRoutes.tsx]"]
  node_registration["Registration"]
  node_login["Login screens"]
  node_authclient["Auth API client<br/>[auth.ts]"]
  node_profileui["Profile UI<br/>[UserProfile.tsx]"]
  node_home["Home and dashboard<br/>[Homepage.tsx]"]
  node_matchingui["Matchmaking UI<br/>[MatchingBuffer.tsx]"]
  node_liveui["Live interaction"]
  node_chatui["Realtime chat UI"]
  node_postsession["Post-session actions"]
end

subgraph group_identity["Identity and profiles"]
  node_authroutes["Auth routes<br/>[authRoutes.ts]"]
  node_otp["OTP workflow<br/>[otpService.ts]"]
  node_email["Email delivery<br/>[emailService.ts]"]
  node_profiles["Profile API<br/>[userRoutes.ts]"]
end

subgraph group_sessions["Matching and live sessions"]
  node_matching["Match API<br/>[matchController.ts]"]
  node_queue["Match queue<br/>[queueService.ts]"]
  node_matchlogic["Pairing logic<br/>[matchingService.ts]"]
  node_socket["Socket events<br/>[socket.ts]"]
end

subgraph group_community["Connections and safety"]
  node_requestui["Connection requests UI"]
  node_requests["Connection requests API<br/>[requestRoutes.ts]"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.tsx]"]
  node_admin["Admin API<br/>[adminController.ts]"]
end

subgraph group_platform["Backend platform"]
  node_server["HTTP and socket server<br/>[server.ts]"]
  node_database[("PostgreSQL<br/>[database.ts]")]
  node_redis["Redis configuration<br/>[redis.ts]"]
  node_cloudinary["Avatar storage<br/>[cloudinary.ts]"]
end

node_student(("IITK student"))

node_student -->|"uses"| node_app
node_app -->|"renders"| node_routes
node_routes -->|"routes to"| node_registration
node_routes -->|"routes to"| node_login
node_registration -.->|"requests OTP"| node_authroutes
node_login -.->|"authenticates via"| node_authclient
node_authclient -->|"calls"| node_authroutes
node_authroutes -.->|"uses OTP"| node_otp
node_otp -->|"sends email"| node_email
node_authroutes -.->|"persists identity"| node_database
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_profileui
node_profileui -.->|"updates profile"| node_profiles
node_profiles -->|"reads and writes"| node_database
node_profiles -.->|"uploads avatar"| node_cloudinary
node_home -.->|"starts matching"| node_matchingui
node_matchingui -.->|"joins queue"| node_matching
node_matching -->|"manages queue"| node_queue
node_matching -->|"checks sessions"| node_database
node_server -->|"initializes"| node_matchlogic
node_server -->|"uses"| node_queue
node_server -.->|"configures queue"| node_redis
node_queue -.->|"stores queue state"| node_redis
node_matching -.->|"returns paired users"| node_liveui
node_liveui -.->|"signals session"| node_socket
node_chatui -.->|"sends chat events"| node_socket
node_server -->|"registers handlers"| node_socket
node_socket -.->|"persists messages"| node_database
node_liveui -.->|"ends session"| node_postsession
node_postsession -->|"rates session"| node_matching
node_routes -->|"routes to"| node_requestui
node_requestui -.->|"manages requests"| node_requests
node_requests -->|"reads and writes"| node_database
node_student -.->|"moderates"| node_adminui
node_adminui -.->|"reviews reports"| node_admin
node_admin -->|"reads and writes"| node_database
node_server -->|"mounts routes"| node_authroutes
node_server -->|"mounts routes"| node_profiles
node_server -->|"mounts routes"| node_requests
node_server -->|"mounts routes"| node_admin

click node_app "https://github.com/harshwss23/incogniito/blob/main/src/app/App.tsx"
click node_routes "https://github.com/harshwss23/incogniito/blob/main/src/app/routes/AppRoutes.tsx"
click node_registration "https://github.com/harshwss23/incogniito/blob/main/src/app/components/RegistrationScreen.tsx"
click node_login "https://github.com/harshwss23/incogniito/blob/main/src/app/components/DedicatedLoginScreen.tsx"
click node_authclient "https://github.com/harshwss23/incogniito/blob/main/src/services/auth.ts"
click node_profileui "https://github.com/harshwss23/incogniito/blob/main/src/app/components/UserProfile.tsx"
click node_home "https://github.com/harshwss23/incogniito/blob/main/src/app/components/Homepage.tsx"
click node_matchingui "https://github.com/harshwss23/incogniito/blob/main/src/app/components/MatchingBuffer.tsx"
click node_liveui "https://github.com/harshwss23/incogniito/blob/main/src/app/components/LiveInteractionRoom.tsx"
click node_chatui "https://github.com/harshwss23/incogniito/blob/main/src/app/components/FuturisticChatInterface.tsx"
click node_postsession "https://github.com/harshwss23/incogniito/blob/main/src/app/components/PostSessionModal.tsx"
click node_authroutes "https://github.com/harshwss23/incogniito/blob/main/backend/src/routes/authRoutes.ts"
click node_otp "https://github.com/harshwss23/incogniito/blob/main/backend/src/services/otpService.ts"
click node_email "https://github.com/harshwss23/incogniito/blob/main/backend/src/services/emailService.ts"
click node_profiles "https://github.com/harshwss23/incogniito/blob/main/backend/src/routes/userRoutes.ts"
click node_matching "https://github.com/harshwss23/incogniito/blob/main/backend/src/controllers/matchController.ts"
click node_queue "https://github.com/harshwss23/incogniito/blob/main/backend/src/services/queueService.ts"
click node_matchlogic "https://github.com/harshwss23/incogniito/blob/main/backend/src/services/matchingService.ts"
click node_socket "https://github.com/harshwss23/incogniito/blob/main/backend/src/socket/socket.ts"
click node_requestui "https://github.com/harshwss23/incogniito/blob/main/src/app/components/ChatRequestsDashboard.tsx"
click node_requests "https://github.com/harshwss23/incogniito/blob/main/backend/src/routes/requestRoutes.ts"
click node_adminui "https://github.com/harshwss23/incogniito/blob/main/src/app/components/AdminDashboard.tsx"
click node_admin "https://github.com/harshwss23/incogniito/blob/main/backend/src/controllers/adminController.ts"
click node_server "https://github.com/harshwss23/incogniito/blob/main/backend/src/server.ts"
click node_database "https://github.com/harshwss23/incogniito/blob/main/backend/src/config/database.ts"
click node_redis "https://github.com/harshwss23/incogniito/blob/main/backend/src/config/redis.ts"
click node_cloudinary "https://github.com/harshwss23/incogniito/blob/main/backend/src/config/cloudinary.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_routes,node_registration,node_login,node_authclient,node_profileui,node_home,node_matchingui,node_liveui,node_chatui,node_postsession toneBlue
class node_authroutes,node_otp,node_email,node_profiles toneAmber
class node_matching,node_queue,node_matchlogic,node_socket toneMint
class node_requestui,node_requests,node_adminui,node_admin toneRose
class node_server,node_database,node_redis,node_cloudinary,node_student toneIndigo
```

## Components

### Web client

- [App shell](https://github.com/harshwss23/incogniito/blob/main/src/app/App.tsx): `src/app/App.tsx`
- [App routes](https://github.com/harshwss23/incogniito/blob/main/src/app/routes/AppRoutes.tsx): `src/app/routes/AppRoutes.tsx`
- [Registration](https://github.com/harshwss23/incogniito/blob/main/src/app/components/RegistrationScreen.tsx): `src/app/components/RegistrationScreen.tsx`
- [Login screens](https://github.com/harshwss23/incogniito/blob/main/src/app/components/DedicatedLoginScreen.tsx): `src/app/components/DedicatedLoginScreen.tsx`
- [Auth API client](https://github.com/harshwss23/incogniito/blob/main/src/services/auth.ts): `src/services/auth.ts`
- [Profile UI](https://github.com/harshwss23/incogniito/blob/main/src/app/components/UserProfile.tsx): `src/app/components/UserProfile.tsx`
- [Home and dashboard](https://github.com/harshwss23/incogniito/blob/main/src/app/components/Homepage.tsx): `src/app/components/Homepage.tsx`
- [Matchmaking UI](https://github.com/harshwss23/incogniito/blob/main/src/app/components/MatchingBuffer.tsx): `src/app/components/MatchingBuffer.tsx`
- [Live interaction](https://github.com/harshwss23/incogniito/blob/main/src/app/components/LiveInteractionRoom.tsx): `src/app/components/LiveInteractionRoom.tsx`
- [Realtime chat UI](https://github.com/harshwss23/incogniito/blob/main/src/app/components/FuturisticChatInterface.tsx): `src/app/components/FuturisticChatInterface.tsx`
- [Post-session actions](https://github.com/harshwss23/incogniito/blob/main/src/app/components/PostSessionModal.tsx): `src/app/components/PostSessionModal.tsx`

### Identity and profiles

- [Auth routes](https://github.com/harshwss23/incogniito/blob/main/backend/src/routes/authRoutes.ts): `backend/src/routes/authRoutes.ts`
- [OTP workflow](https://github.com/harshwss23/incogniito/blob/main/backend/src/services/otpService.ts): `backend/src/services/otpService.ts`
- [Email delivery](https://github.com/harshwss23/incogniito/blob/main/backend/src/services/emailService.ts): `backend/src/services/emailService.ts`
- [Profile API](https://github.com/harshwss23/incogniito/blob/main/backend/src/routes/userRoutes.ts): `backend/src/routes/userRoutes.ts`

### Matching and live sessions

- [Match API](https://github.com/harshwss23/incogniito/blob/main/backend/src/controllers/matchController.ts): `backend/src/controllers/matchController.ts`
- [Match queue](https://github.com/harshwss23/incogniito/blob/main/backend/src/services/queueService.ts): `backend/src/services/queueService.ts`
- [Pairing logic](https://github.com/harshwss23/incogniito/blob/main/backend/src/services/matchingService.ts): `backend/src/services/matchingService.ts`
- [Socket events](https://github.com/harshwss23/incogniito/blob/main/backend/src/socket/socket.ts): `backend/src/socket/socket.ts`

### Connections and safety

- [Connection requests UI](https://github.com/harshwss23/incogniito/blob/main/src/app/components/ChatRequestsDashboard.tsx): `src/app/components/ChatRequestsDashboard.tsx`
- [Connection requests API](https://github.com/harshwss23/incogniito/blob/main/backend/src/routes/requestRoutes.ts): `backend/src/routes/requestRoutes.ts`
- [Admin dashboard](https://github.com/harshwss23/incogniito/blob/main/src/app/components/AdminDashboard.tsx): `src/app/components/AdminDashboard.tsx`
- [Admin API](https://github.com/harshwss23/incogniito/blob/main/backend/src/controllers/adminController.ts): `backend/src/controllers/adminController.ts`

### Backend platform

- [HTTP and socket server](https://github.com/harshwss23/incogniito/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [PostgreSQL](https://github.com/harshwss23/incogniito/blob/main/backend/src/config/database.ts): `backend/src/config/database.ts`
- [Redis configuration](https://github.com/harshwss23/incogniito/blob/main/backend/src/config/redis.ts): `backend/src/config/redis.ts`
- [Avatar storage](https://github.com/harshwss23/incogniito/blob/main/backend/src/config/cloudinary.ts): `backend/src/config/cloudinary.ts`

### Other components

- **IITK student**

## Connections

- IITK student → App shell: uses (evidence: `README.md`)
- App shell → App routes: renders (evidence: `src/app/App.tsx`)
- App routes → Registration: routes to (evidence: `src/app/routes/AppRoutes.tsx`)
- App routes → Login screens: routes to (evidence: `src/app/routes/AppRoutes.tsx`)
- Registration → Auth routes: requests OTP (evidence: `README.md`)
- Login screens → Auth API client: authenticates via (evidence: `README.md`)
- Auth API client → Auth routes: calls (evidence: `src/services/auth.ts`)
- Auth routes → OTP workflow: uses OTP (evidence: `README.md`)
- OTP workflow → Email delivery: sends email (evidence: `backend/src/services/otpService.ts`)
- Auth routes → PostgreSQL: persists identity (evidence: `README.md`)
- App routes → Home and dashboard: routes to (evidence: `src/app/routes/AppRoutes.tsx`)
- App routes → Profile UI: routes to (evidence: `src/app/routes/AppRoutes.tsx`)
- Profile UI → Profile API: updates profile (evidence: `README.md`)
- Profile API → PostgreSQL: reads and writes (evidence: `backend/src/routes/userRoutes.ts`)
- Profile API → Avatar storage: uploads avatar (evidence: `README.md`)
- Home and dashboard → Matchmaking UI: starts matching (evidence: `README.md`)
- Matchmaking UI → Match API: joins queue (evidence: `README.md`)
- Match API → Match queue: manages queue (evidence: `backend/src/controllers/matchController.ts`)
- Match API → PostgreSQL: checks sessions (evidence: `backend/src/controllers/matchController.ts`)
- HTTP and socket server → Pairing logic: initializes (evidence: `backend/src/server.ts`)
- HTTP and socket server → Match queue: uses (evidence: `backend/src/server.ts`)
- HTTP and socket server → Redis configuration: configures queue (evidence: `README.md`)
- Match queue → Redis configuration: stores queue state (evidence: `README.md`)
- Match API → Live interaction: returns paired users (evidence: `README.md`)
- Live interaction → Socket events: signals session (evidence: `README.md`)
- Realtime chat UI → Socket events: sends chat events (evidence: `README.md`)
- HTTP and socket server → Socket events: registers handlers (evidence: `backend/src/server.ts`)
- Socket events → PostgreSQL: persists messages (evidence: `README.md`)
- Live interaction → Post-session actions: ends session (evidence: `README.md`)
- Post-session actions → Match API: rates session (evidence: `src/app/components/PostSessionModal.tsx`)
- App routes → Connection requests UI: routes to (evidence: `src/app/routes/AppRoutes.tsx`)
- Connection requests UI → Connection requests API: manages requests (evidence: `README.md`)
- Connection requests API → PostgreSQL: reads and writes (evidence: `backend/src/routes/requestRoutes.ts`)
- IITK student → Admin dashboard: moderates (evidence: `README.md`)
- Admin dashboard → Admin API: reviews reports (evidence: `README.md`)
- Admin API → PostgreSQL: reads and writes (evidence: `backend/src/controllers/adminController.ts`)
- HTTP and socket server → Auth routes: mounts routes (evidence: `backend/src/server.ts`)
- HTTP and socket server → Profile API: mounts routes (evidence: `backend/src/server.ts`)
- HTTP and socket server → Connection requests API: mounts routes (evidence: `backend/src/server.ts`)
- HTTP and socket server → Admin API: mounts routes (evidence: `backend/src/server.ts`)
