# abhaywangwad/social-connect architecture

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

- Interactive diagram: https://gitdiagram.com/abhaywangwad/social-connect
- Repository: https://github.com/abhaywangwad/social-connect

## Overview

Social Connect is a MERN social-media application. Users register or log in, then access protected feeds, profiles, search, saved posts, notifications, and messaging; they can also create and interact with content and manage social connections. Admins have a separate moderation workflow. The client entry point and selected server routes/controllers are visible in the excerpts; other capabilities are represented from the repository tree and README, so uncertain service-to-model wiring is omitted.

Main entry points: [`client/src/App.jsx`](https://github.com/abhaywangwad/social-connect/blob/main/client/src/App.jsx) (App routing), [`server/src/app.js`](https://github.com/abhaywangwad/social-connect/blob/main/server/src/app.js) (Express API), [`server/src/routes/userRoutes.js`](https://github.com/abhaywangwad/social-connect/blob/main/server/src/routes/userRoutes.js) (User routes), [`server/src/services/authService.js`](https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/authService.js) (Auth and sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["App routing<br/>[App.jsx]"]
  node_authui["Login and registration<br/>[LoginForm.jsx]"]
  node_feedui["Feed<br/>[FeedView.jsx]"]
  node_profileui["Profiles<br/>[ProfileView.jsx]"]
  node_searchui["Search<br/>[SearchView.jsx]"]
  node_postui["Post creation and cards"]
  node_savedui["Saved posts<br/>[SavedPostsView.jsx]"]
  node_notifui["Notifications"]
  node_adminui["Admin dashboard<br/>[AdminDashboard.jsx]"]
end

subgraph group_identity["Identity and access"]
  node_authstate["Authentication state<br/>[AuthContext.jsx]"]
  node_authservice["Auth client<br/>[authService.js]"]
  node_authctrl["Auth controller<br/>[authController.js]"]
  node_authlogic["Auth and sessions<br/>[authService.js]"]
  node_sessionlogic["Session management<br/>[sessionService.js]"]
end

subgraph group_social["Social product"]
  node_feedlogic["Feed and posts<br/>[feedService.js]"]
  node_sociallogic["Social interactions<br/>[followService.js]"]
  node_commentctrl["Comment controller"]
  node_moderation["Admin moderation"]
end

subgraph group_realtime["Realtime messaging"]
  node_messageui["Messages<br/>[MessagesView.jsx]"]
  node_socketclient["Socket client<br/>[socketManager.js]"]
  node_socketserver["Socket handlers<br/>[socketHandlers.js]"]
  node_typing["Typing state<br/>[typingManager.js]"]
end

subgraph group_server["API and persistence"]
  node_api["Express API<br/>[app.js]"]
  node_useroutes["User routes<br/>[userRoutes.js]"]
  node_adminroutes["Admin routes<br/>[adminRoutes.js]"]
  node_userctrl["User controller<br/>[userController.js]"]
  node_searchctrl["Search controller"]
  node_postctrl["Post controller<br/>[postController.js]"]
  node_commentlogic["Comment service<br/>[commentService.js]"]
  node_models["Domain models"]
end

node_visitor(("User"))
node_mongo[("MongoDB")]

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_authui
node_app -->|"routes to"| node_feedui
node_app -->|"routes to"| node_profileui
node_app -->|"routes to"| node_searchui
node_app -->|"routes to"| node_savedui
node_app -->|"routes to"| node_notifui
node_app -->|"routes to"| node_adminui
node_app -->|"routes to"| node_messageui
node_app -->|"provides"| node_authstate
node_authservice -->|"requests"| node_api
node_api -->|"dispatches"| node_authctrl
node_authctrl -->|"calls"| node_authlogic
node_authlogic -->|"calls"| node_sessionlogic
node_api -->|"mounts"| node_useroutes
node_useroutes -->|"dispatches"| node_userctrl
node_useroutes -->|"dispatches"| node_searchctrl
node_useroutes -->|"dispatches"| node_postctrl
node_api -->|"mounts"| node_adminroutes
node_adminroutes -->|"dispatches"| node_moderation
node_commentctrl -->|"calls"| node_commentlogic
node_socketclient -->|"emits events"| node_socketserver
node_socketserver -->|"tracks typing"| node_typing
node_authlogic -->|"uses"| node_models
node_sessionlogic -->|"uses"| node_models
node_models -->|"persists"| node_mongo

click node_app "https://github.com/abhaywangwad/social-connect/blob/main/client/src/App.jsx"
click node_authui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/auth/LoginForm.jsx"
click node_feedui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/feed/FeedView.jsx"
click node_profileui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/profile/ProfileView.jsx"
click node_searchui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/search/SearchView.jsx"
click node_postui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/posts/CreatePostModal.jsx"
click node_savedui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/saved/SavedPostsView.jsx"
click node_notifui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/notifications/NotificationsView.jsx"
click node_adminui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/admin/AdminDashboard.jsx"
click node_authstate "https://github.com/abhaywangwad/social-connect/blob/main/client/src/context/AuthContext.jsx"
click node_authservice "https://github.com/abhaywangwad/social-connect/blob/main/client/src/services/authService.js"
click node_authctrl "https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/authController.js"
click node_authlogic "https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/authService.js"
click node_sessionlogic "https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/sessionService.js"
click node_feedlogic "https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/feedService.js"
click node_sociallogic "https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/followService.js"
click node_commentctrl "https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/commentController.js"
click node_moderation "https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/adminModerationController.js"
click node_messageui "https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/messages/MessagesView.jsx"
click node_socketclient "https://github.com/abhaywangwad/social-connect/blob/main/client/src/socket/socketManager.js"
click node_socketserver "https://github.com/abhaywangwad/social-connect/blob/main/server/src/socket/socketHandlers.js"
click node_typing "https://github.com/abhaywangwad/social-connect/blob/main/server/src/socket/typingManager.js"
click node_api "https://github.com/abhaywangwad/social-connect/blob/main/server/src/app.js"
click node_useroutes "https://github.com/abhaywangwad/social-connect/blob/main/server/src/routes/userRoutes.js"
click node_adminroutes "https://github.com/abhaywangwad/social-connect/blob/main/server/src/routes/adminRoutes.js"
click node_userctrl "https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/userController.js"
click node_searchctrl "https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/searchController.js"
click node_postctrl "https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/postController.js"
click node_commentlogic "https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/commentService.js"
click node_models "https://github.com/abhaywangwad/social-connect/tree/main/server/src/models"

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_authui,node_feedui,node_profileui,node_searchui,node_postui,node_savedui,node_notifui,node_adminui,node_visitor toneBlue
class node_authstate,node_authservice,node_authctrl,node_authlogic,node_sessionlogic,node_mongo toneAmber
class node_feedlogic,node_sociallogic,node_commentctrl,node_moderation toneMint
class node_messageui,node_socketclient,node_socketserver,node_typing toneRose
class node_api,node_useroutes,node_adminroutes,node_userctrl,node_searchctrl,node_postctrl,node_commentlogic,node_models toneIndigo
```

## Components

### Web client

- [App routing](https://github.com/abhaywangwad/social-connect/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Login and registration](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/auth/LoginForm.jsx): `client/src/components/auth/LoginForm.jsx`
- [Feed](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/feed/FeedView.jsx): `client/src/components/feed/FeedView.jsx`
- [Profiles](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/profile/ProfileView.jsx): `client/src/components/profile/ProfileView.jsx`
- [Search](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/search/SearchView.jsx): `client/src/components/search/SearchView.jsx`
- [Post creation and cards](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/posts/CreatePostModal.jsx): `client/src/components/posts/CreatePostModal.jsx`
- [Saved posts](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/saved/SavedPostsView.jsx): `client/src/components/saved/SavedPostsView.jsx`
- [Notifications](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/notifications/NotificationsView.jsx): `client/src/components/notifications/NotificationsView.jsx`
- [Admin dashboard](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/admin/AdminDashboard.jsx): `client/src/components/admin/AdminDashboard.jsx`

### Identity and access

- [Authentication state](https://github.com/abhaywangwad/social-connect/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Auth client](https://github.com/abhaywangwad/social-connect/blob/main/client/src/services/authService.js): `client/src/services/authService.js`
- [Auth controller](https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/authController.js): `server/src/controllers/authController.js`
- [Auth and sessions](https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/authService.js): `server/src/services/authService.js`
- [Session management](https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/sessionService.js): `server/src/services/sessionService.js`

### Social product

- [Feed and posts](https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/feedService.js): `server/src/services/feedService.js`
- [Social interactions](https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/followService.js): `server/src/services/followService.js`
- [Comment controller](https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/commentController.js): `server/src/controllers/commentController.js`
- [Admin moderation](https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/adminModerationController.js): `server/src/controllers/adminModerationController.js`

### Realtime messaging

- [Messages](https://github.com/abhaywangwad/social-connect/blob/main/client/src/components/messages/MessagesView.jsx): `client/src/components/messages/MessagesView.jsx`
- [Socket client](https://github.com/abhaywangwad/social-connect/blob/main/client/src/socket/socketManager.js): `client/src/socket/socketManager.js`
- [Socket handlers](https://github.com/abhaywangwad/social-connect/blob/main/server/src/socket/socketHandlers.js): `server/src/socket/socketHandlers.js`
- [Typing state](https://github.com/abhaywangwad/social-connect/blob/main/server/src/socket/typingManager.js): `server/src/socket/typingManager.js`

### API and persistence

- [Express API](https://github.com/abhaywangwad/social-connect/blob/main/server/src/app.js): `server/src/app.js`
- [User routes](https://github.com/abhaywangwad/social-connect/blob/main/server/src/routes/userRoutes.js): `server/src/routes/userRoutes.js`
- [Admin routes](https://github.com/abhaywangwad/social-connect/blob/main/server/src/routes/adminRoutes.js): `server/src/routes/adminRoutes.js`
- [User controller](https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/userController.js): `server/src/controllers/userController.js`
- [Search controller](https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/searchController.js): `server/src/controllers/searchController.js`
- [Post controller](https://github.com/abhaywangwad/social-connect/blob/main/server/src/controllers/postController.js): `server/src/controllers/postController.js`
- [Comment service](https://github.com/abhaywangwad/social-connect/blob/main/server/src/services/commentService.js): `server/src/services/commentService.js`
- [Domain models](https://github.com/abhaywangwad/social-connect/tree/main/server/src/models): `server/src/models`

### Other components

- **User**
- **MongoDB**

## Connections

- User → App routing: uses
- App routing → Login and registration: renders
- App routing → Feed: routes to
- App routing → Profiles: routes to
- App routing → Search: routes to
- App routing → Saved posts: routes to
- App routing → Notifications: routes to
- App routing → Admin dashboard: routes to
- App routing → Messages: routes to
- App routing → Authentication state: provides
- Auth client → Express API: requests
- Express API → Auth controller: dispatches
- Auth controller → Auth and sessions: calls
- Auth and sessions → Session management: calls
- Express API → User routes: mounts
- User routes → User controller: dispatches
- User routes → Search controller: dispatches
- User routes → Post controller: dispatches
- Express API → Admin routes: mounts
- Admin routes → Admin moderation: dispatches
- Comment controller → Comment service: calls
- Socket client → Socket handlers: emits events
- Socket handlers → Typing state: tracks typing
- Auth and sessions → Domain models: uses
- Session management → Domain models: uses
- Domain models → MongoDB: persists
