# goutamchoudhary907/mulaqat architecture

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

- Interactive diagram: https://gitdiagram.com/goutamchoudhary907/mulaqat
- Repository: https://github.com/goutamchoudhary907/mulaqat

## Overview

Mulaqat is a campus-only dating and social app. Students register and complete a five-answer vibe check, then browse compatibility-ranked profiles, like or pass, and chat after a mutual match. Separate product branches support anonymous Spotted confessions and profile management; the README also documents illustrated avatars, secret-admirer counts, reactions, typing indicators, and online presence. The excerpts show frontend routing, session/socket setup, API routing, and several controller-to-model operations. Other capability links are documented or left unverified where source excerpts do not show their wiring.

Main entry points: [`client/src/App.jsx`](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/App.jsx) (App routing), [`client/src/lib/api.js`](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/lib/api.js) (API client), [`server/server.js`](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/server.js) (HTTP and socket server), [`server/controllers/matchController.js`](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/matchController.js) (Discovery and matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Student app"]
  node_app["App routing<br/>[App.jsx]"]
  node_session["Session and presence<br/>[AuthContext.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_onboarding["Registration and vibe<br/>[Onboarding.jsx]"]
  node_profile["Profile<br/>[Profile.jsx]"]
  node_avatars["Illustrated avatars<br/>[avatars.js]"]
end

subgraph group_server["API and identity"]
  node_backend["HTTP and socket server<br/>[server.js]"]
  node_dbconn["MongoDB connection<br/>[db.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authlogic["Account and session logic<br/>[authController.js]"]
  node_users[("User records<br/>[User.js]")]
end

subgraph group_matching["Matching and chat"]
  node_discover["Discover deck<br/>[Discover.jsx]"]
  node_swipe["Swipe deck<br/>[SwipeDeck.jsx]"]
  node_matches["Matches list<br/>[Matches.jsx]"]
  node_chat["Realtime chat<br/>[Chat.jsx]"]
  node_matchroutes["Match routes<br/>[matchRoutes.js]"]
  node_matchlogic["Discovery and matching<br/>[matchController.js]"]
  node_messages[("Message records<br/>[Message.js]")]
  node_socket["Socket events<br/>[socket.js]"]
end

subgraph group_community["Campus community"]
  node_spotted["Spotted wall<br/>[Spotted.jsx]"]
  node_confroutes["Confession routes"]
  node_conflogic["Confession operations"]
  node_confessions[("Confession records<br/>[Confession.js]")]
  node_reports["Report operations<br/>[reportRoutes.js]"]
end

node_student(("Student"))

node_student -->|"uses"| node_app
node_app -->|"wraps"| node_session
node_app -->|"routes to"| node_onboarding
node_app -->|"routes to"| node_discover
node_app -->|"routes to"| node_matches
node_app -->|"routes to"| node_chat
node_app -->|"routes to"| node_spotted
node_app -->|"routes to"| node_profile
node_session -->|"calls"| node_api
node_discover -->|"calls"| node_api
node_discover -->|"renders"| node_swipe
node_matches -->|"calls"| node_api
node_chat -->|"calls"| node_api
node_spotted -->|"calls"| node_api
node_backend -->|"connects"| node_dbconn
node_backend -->|"mounts"| node_authroutes
node_backend -->|"mounts"| node_matchroutes
node_backend -->|"mounts"| node_confroutes
node_backend -->|"initializes"| node_socket
node_authroutes -->|"dispatches"| node_authlogic
node_authlogic -->|"reads and writes"| node_users
node_matchroutes -->|"dispatches"| node_matchlogic
node_matchlogic -->|"reads and writes"| node_users
node_matchlogic -->|"reads and deletes"| node_messages
node_socket -->|"stores messages"| node_messages
node_socket -->|"updates presence"| node_users
node_confroutes -->|"dispatches"| node_conflogic
node_conflogic -->|"reads and writes"| node_confessions
node_conflogic -->|"reads campus"| node_users
node_api -.->|"requests API"| node_backend
node_onboarding -.->|"submits profile"| node_api
node_profile -.->|"updates profile"| node_api
node_avatars -.->|"offers avatar choices"| node_onboarding
node_matchlogic -.->|"returns ranked profiles"| node_discover
node_matchlogic -.->|"returns matches"| node_matches
node_socket -.->|"delivers live chat"| node_chat
node_conflogic -.->|"serves wall"| node_spotted
node_reports -.->|"mounted by"| node_backend

click node_app "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/App.jsx"
click node_session "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/context/AuthContext.jsx"
click node_api "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/lib/api.js"
click node_onboarding "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Onboarding.jsx"
click node_discover "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Discover.jsx"
click node_swipe "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/components/SwipeDeck.jsx"
click node_matches "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Matches.jsx"
click node_chat "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Chat.jsx"
click node_spotted "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Spotted.jsx"
click node_profile "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Profile.jsx"
click node_backend "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/server.js"
click node_dbconn "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/config/db.js"
click node_authroutes "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/authRoutes.js"
click node_authlogic "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/authController.js"
click node_users "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/models/User.js"
click node_matchroutes "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/matchRoutes.js"
click node_matchlogic "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/matchController.js"
click node_messages "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/models/Message.js"
click node_socket "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/socket/socket.js"
click node_confroutes "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/confessionRoutes.js"
click node_conflogic "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/confessionController.js"
click node_confessions "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/models/Confession.js"
click node_reports "https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/reportRoutes.js"
click node_avatars "https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/lib/avatars.js"

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_session,node_api,node_onboarding,node_profile,node_avatars toneBlue
class node_backend,node_dbconn,node_authroutes,node_authlogic,node_users toneAmber
class node_discover,node_swipe,node_matches,node_chat,node_matchroutes,node_matchlogic,node_messages,node_socket toneMint
class node_spotted,node_confroutes,node_conflogic,node_confessions,node_reports toneRose
class node_student toneIndigo
```

## Components

### Student app

- [App routing](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Session and presence](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [API client](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/lib/api.js): `client/src/lib/api.js`
- [Registration and vibe](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Onboarding.jsx): `client/src/pages/Onboarding.jsx`
- [Profile](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Profile.jsx): `client/src/pages/Profile.jsx`
- [Illustrated avatars](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/lib/avatars.js): `client/src/lib/avatars.js`

### API and identity

- [HTTP and socket server](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/server.js): `server/server.js`
- [MongoDB connection](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/config/db.js): `server/config/db.js`
- [Auth routes](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/authRoutes.js): `server/routes/authRoutes.js`
- [Account and session logic](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [User records](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/models/User.js): `server/models/User.js`

### Matching and chat

- [Discover deck](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Discover.jsx): `client/src/pages/Discover.jsx`
- [Swipe deck](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/components/SwipeDeck.jsx): `client/src/components/SwipeDeck.jsx`
- [Matches list](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Matches.jsx): `client/src/pages/Matches.jsx`
- [Realtime chat](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Chat.jsx): `client/src/pages/Chat.jsx`
- [Match routes](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/matchRoutes.js): `server/routes/matchRoutes.js`
- [Discovery and matching](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/matchController.js): `server/controllers/matchController.js`
- [Message records](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/models/Message.js): `server/models/Message.js`
- [Socket events](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/socket/socket.js): `server/socket/socket.js`

### Campus community

- [Spotted wall](https://github.com/goutamchoudhary907/mulaqat/blob/main/client/src/pages/Spotted.jsx): `client/src/pages/Spotted.jsx`
- [Confession routes](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/confessionRoutes.js): `server/routes/confessionRoutes.js`
- [Confession operations](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/controllers/confessionController.js): `server/controllers/confessionController.js`
- [Confession records](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/models/Confession.js): `server/models/Confession.js`
- [Report operations](https://github.com/goutamchoudhary907/mulaqat/blob/main/server/routes/reportRoutes.js): `server/routes/reportRoutes.js`

### Other components

- **Student**

## Connections

- Student → App routing: uses
- App routing → Session and presence: wraps (evidence: `client/src/App.jsx`)
- App routing → Registration and vibe: routes to (evidence: `client/src/App.jsx`)
- App routing → Discover deck: routes to (evidence: `client/src/App.jsx`)
- App routing → Matches list: routes to (evidence: `client/src/App.jsx`)
- App routing → Realtime chat: routes to (evidence: `client/src/App.jsx`)
- App routing → Spotted wall: routes to (evidence: `client/src/App.jsx`)
- App routing → Profile: routes to (evidence: `client/src/App.jsx`)
- Session and presence → API client: calls (evidence: `client/src/context/AuthContext.jsx`)
- Discover deck → API client: calls (evidence: `client/src/pages/Discover.jsx`)
- Discover deck → Swipe deck: renders (evidence: `client/src/pages/Discover.jsx`)
- Matches list → API client: calls (evidence: `client/src/pages/Matches.jsx`)
- Realtime chat → API client: calls (evidence: `client/src/pages/Chat.jsx`)
- Spotted wall → API client: calls (evidence: `client/src/pages/Spotted.jsx`)
- HTTP and socket server → MongoDB connection: connects (evidence: `server/server.js`)
- HTTP and socket server → Auth routes: mounts (evidence: `server/server.js`)
- HTTP and socket server → Match routes: mounts (evidence: `server/server.js`)
- HTTP and socket server → Confession routes: mounts (evidence: `server/server.js`)
- HTTP and socket server → Socket events: initializes (evidence: `server/server.js`)
- Auth routes → Account and session logic: dispatches (evidence: `server/routes/authRoutes.js`)
- Account and session logic → User records: reads and writes (evidence: `server/controllers/authController.js`)
- Match routes → Discovery and matching: dispatches (evidence: `server/routes/matchRoutes.js`)
- Discovery and matching → User records: reads and writes (evidence: `server/controllers/matchController.js`)
- Discovery and matching → Message records: reads and deletes (evidence: `server/controllers/matchController.js`)
- Socket events → Message records: stores messages (evidence: `server/socket/socket.js`)
- Socket events → User records: updates presence (evidence: `server/socket/socket.js`)
- Confession routes → Confession operations: dispatches (evidence: `server/routes/confessionRoutes.js`)
- Confession operations → Confession records: reads and writes (evidence: `server/controllers/confessionController.js`)
- Confession operations → User records: reads campus (evidence: `server/controllers/confessionController.js`)
- API client → HTTP and socket server: requests API
- Registration and vibe → API client: submits profile
- Profile → API client: updates profile
- Illustrated avatars → Registration and vibe: offers avatar choices
- Discovery and matching → Discover deck: returns ranked profiles
- Discovery and matching → Matches list: returns matches
- Socket events → Realtime chat: delivers live chat
- Confession operations → Spotted wall: serves wall
- Report operations → HTTP and socket server: mounted by (evidence: `server/server.js`)
