# yogeswar142/gvibe architecture

> Architecture diagram of the GitHub repository yogeswar142/gvibe, 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/yogeswar142/gvibe
- Repository: https://github.com/yogeswar142/gvibe

## Overview

GVibe is a campus social platform with a Node/Express backend: users access social content, messaging, location sharing, and link analytics through authenticated APIs, with chat also supporting real-time Socket.IO events. The graph follows the visible server-to-route-to-controller structure and includes documented domain capabilities represented in the tree. The frontend tree contains native platform scaffolding but no sampled Dart application source, so its runtime behavior and API wiring cannot be mapped. Some controller-to-model links are omitted where source was not sampled.

Main entry points: [`backend/src/app.js`](https://github.com/yogeswar142/gvibe/blob/main/backend/src/app.js) (Express app), [`backend/src/controllers/post.controller.js`](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/post.controller.js) (Post controller), [`backend/src/controllers/message.controller.js`](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/message.controller.js) (Message controller), [`backend/src/services/socket.service.js`](https://github.com/yogeswar142/gvibe/blob/main/backend/src/services/socket.service.js) (Socket service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_server["Server startup<br/>[server.js]"]
  node_app["Express app<br/>[app.js]"]
  node_authroute["Auth routes<br/>[auth.routes.js]"]
  node_authctrl["Auth controller<br/>[auth.controller.js]"]
  node_authmw["Auth middleware<br/>[auth.middleware.js]"]
  node_dbconn["Database connector<br/>[db.js]"]
end

subgraph group_social["Social content"]
  node_userroute["User routes<br/>[user.routes.js]"]
  node_userctrl["User controller<br/>[user.controller.js]"]
  node_usermodel[("User records<br/>[User.js]")]
  node_postroute["Post routes<br/>[post.routes.js]"]
  node_postctrl["Post controller<br/>[post.controller.js]"]
  node_postmodel[("Post records<br/>[Post.js]")]
  node_discovery["Discovery controller"]
  node_vibe["Vibe controller<br/>[vibe.controller.js]"]
  node_lostroute["Lost-item routes"]
  node_lostctrl["Lost-item controller"]
  node_lostmodel[("Lost-item records<br/>[LostItem.js]")]
end

subgraph group_messaging["Messaging"]
  node_msgroute["Message routes<br/>[message.routes.js]"]
  node_msgctrl["Message controller"]
  node_socket["Socket service<br/>[socket.service.js]"]
  node_msgmodel[("Message records<br/>[Message.js]")]
  node_community[("Community records<br/>[Community.js]")]
end

subgraph group_utility["Sharing and location"]
  node_locationroute["Location routes"]
  node_locationctrl["Location controller"]
  node_locationmodel[("Location sessions<br/>[LiveLocation.js]")]
  node_linkroute["Short-link routes"]
  node_linkctrl["Short-link controller"]
  node_linkmodel[("Short-link records<br/>[ShortLink.js]")]
  node_analytics["Analytics controller"]
  node_analyticsmodel[("User analytics<br/>[UserAnalytics.js]")]
end

node_client(("API client"))
node_mongo[("MongoDB")]

node_client -->|"sends requests"| node_app
node_server -->|"connects"| node_dbconn
node_server -->|"serves"| node_app
node_server -->|"initializes"| node_socket
node_dbconn -->|"connects"| node_mongo
node_app -->|"mounts"| node_authroute
node_app -->|"mounts"| node_userroute
node_app -->|"mounts"| node_postroute
node_app -->|"mounts"| node_lostroute
node_app -->|"mounts"| node_msgroute
node_app -->|"mounts"| node_locationroute
node_app -->|"mounts"| node_linkroute
node_app -->|"mounts"| node_analytics
node_app -->|"mounts"| node_discovery
node_app -->|"mounts"| node_vibe
node_authroute -->|"dispatches"| node_authctrl
node_userroute -->|"dispatches"| node_userctrl
node_postroute -->|"dispatches"| node_postctrl
node_lostroute -->|"dispatches"| node_lostctrl
node_msgroute -->|"dispatches"| node_msgctrl
node_locationroute -->|"dispatches"| node_locationctrl
node_linkroute -->|"dispatches"| node_linkctrl
node_userroute -->|"protects"| node_authmw
node_msgroute -->|"protects"| node_authmw
node_lostroute -->|"protects"| node_authmw
node_locationroute -->|"protects"| node_authmw
node_userctrl -->|"reads/writes"| node_usermodel
node_postctrl -->|"reads/writes"| node_postmodel
node_postctrl -->|"creates links"| node_linkmodel
node_postctrl -->|"updates"| node_analyticsmodel
node_lostctrl -->|"reads/writes"| node_lostmodel
node_msgctrl -->|"reads/writes"| node_msgmodel
node_msgctrl -->|"reads/writes"| node_community
node_msgctrl -->|"reads/writes"| node_usermodel
node_socket -->|"updates presence"| node_usermodel
node_socket -->|"stores messages"| node_msgmodel
node_socket -->|"checks membership"| node_community
node_locationctrl -->|"reads/writes"| node_locationmodel
node_linkctrl -->|"reads/writes"| node_linkmodel
node_linkctrl -->|"updates clicks"| node_analyticsmodel
node_analytics -->|"reads"| node_analyticsmodel

click node_server "https://github.com/yogeswar142/gvibe/blob/main/backend/server.js"
click node_app "https://github.com/yogeswar142/gvibe/blob/main/backend/src/app.js"
click node_authroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/auth.routes.js"
click node_authctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/auth.controller.js"
click node_authmw "https://github.com/yogeswar142/gvibe/blob/main/backend/src/middleware/auth.middleware.js"
click node_dbconn "https://github.com/yogeswar142/gvibe/blob/main/backend/src/config/db.js"
click node_userroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/user.routes.js"
click node_userctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/user.controller.js"
click node_usermodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/User.js"
click node_postroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/post.routes.js"
click node_postctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/post.controller.js"
click node_postmodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/Post.js"
click node_discovery "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/discovery.controller.js"
click node_vibe "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/vibe.controller.js"
click node_lostroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/lost_item.routes.js"
click node_lostctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/lost_item.controller.js"
click node_lostmodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/LostItem.js"
click node_msgroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/message.routes.js"
click node_msgctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/message.controller.js"
click node_socket "https://github.com/yogeswar142/gvibe/blob/main/backend/src/services/socket.service.js"
click node_msgmodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/Message.js"
click node_community "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/Community.js"
click node_locationroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/live_location.routes.js"
click node_locationctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/live_location.controller.js"
click node_locationmodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/LiveLocation.js"
click node_linkroute "https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/short_link.routes.js"
click node_linkctrl "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/short_link.controller.js"
click node_linkmodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/ShortLink.js"
click node_analytics "https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/analytics.controller.js"
click node_analyticsmodel "https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/UserAnalytics.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_server,node_app,node_authroute,node_authctrl,node_authmw,node_dbconn,node_client toneBlue
class node_userroute,node_userctrl,node_usermodel,node_postroute,node_postctrl,node_postmodel,node_discovery,node_vibe,node_lostroute,node_lostctrl,node_lostmodel,node_mongo toneAmber
class node_msgroute,node_msgctrl,node_socket,node_msgmodel,node_community toneMint
class node_locationroute,node_locationctrl,node_locationmodel,node_linkroute,node_linkctrl,node_linkmodel,node_analytics,node_analyticsmodel toneRose
```

## Components

### API runtime

- [Server startup](https://github.com/yogeswar142/gvibe/blob/main/backend/server.js): `backend/server.js`
- [Express app](https://github.com/yogeswar142/gvibe/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Auth controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [Auth middleware](https://github.com/yogeswar142/gvibe/blob/main/backend/src/middleware/auth.middleware.js): `backend/src/middleware/auth.middleware.js`
- [Database connector](https://github.com/yogeswar142/gvibe/blob/main/backend/src/config/db.js): `backend/src/config/db.js`

### Social content

- [User routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/user.routes.js): `backend/src/routes/user.routes.js`
- [User controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/user.controller.js): `backend/src/controllers/user.controller.js`
- [User records](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/User.js): `backend/src/models/User.js`
- [Post routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/post.routes.js): `backend/src/routes/post.routes.js`
- [Post controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/post.controller.js): `backend/src/controllers/post.controller.js`
- [Post records](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/Post.js): `backend/src/models/Post.js`
- [Discovery controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/discovery.controller.js): `backend/src/controllers/discovery.controller.js`
- [Vibe controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/vibe.controller.js): `backend/src/controllers/vibe.controller.js`
- [Lost-item routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/lost_item.routes.js): `backend/src/routes/lost_item.routes.js`
- [Lost-item controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/lost_item.controller.js): `backend/src/controllers/lost_item.controller.js`
- [Lost-item records](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/LostItem.js): `backend/src/models/LostItem.js`

### Messaging

- [Message routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/message.routes.js): `backend/src/routes/message.routes.js`
- [Message controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/message.controller.js): `backend/src/controllers/message.controller.js`
- [Socket service](https://github.com/yogeswar142/gvibe/blob/main/backend/src/services/socket.service.js): `backend/src/services/socket.service.js`
- [Message records](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/Message.js): `backend/src/models/Message.js`
- [Community records](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/Community.js): `backend/src/models/Community.js`

### Sharing and location

- [Location routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/live_location.routes.js): `backend/src/routes/live_location.routes.js`
- [Location controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/live_location.controller.js): `backend/src/controllers/live_location.controller.js`
- [Location sessions](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/LiveLocation.js): `backend/src/models/LiveLocation.js`
- [Short-link routes](https://github.com/yogeswar142/gvibe/blob/main/backend/src/routes/short_link.routes.js): `backend/src/routes/short_link.routes.js`
- [Short-link controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/short_link.controller.js): `backend/src/controllers/short_link.controller.js`
- [Short-link records](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/ShortLink.js): `backend/src/models/ShortLink.js`
- [Analytics controller](https://github.com/yogeswar142/gvibe/blob/main/backend/src/controllers/analytics.controller.js): `backend/src/controllers/analytics.controller.js`
- [User analytics](https://github.com/yogeswar142/gvibe/blob/main/backend/src/models/UserAnalytics.js): `backend/src/models/UserAnalytics.js`

### Other components

- **API client**
- **MongoDB**

## Connections

- API client → Express app: sends requests
- Server startup → Database connector: connects
- Server startup → Express app: serves
- Server startup → Socket service: initializes
- Database connector → MongoDB: connects
- Express app → Auth routes: mounts
- Express app → User routes: mounts
- Express app → Post routes: mounts
- Express app → Lost-item routes: mounts
- Express app → Message routes: mounts
- Express app → Location routes: mounts
- Express app → Short-link routes: mounts
- Express app → Analytics controller: mounts
- Express app → Discovery controller: mounts
- Express app → Vibe controller: mounts
- Auth routes → Auth controller: dispatches
- User routes → User controller: dispatches
- Post routes → Post controller: dispatches
- Lost-item routes → Lost-item controller: dispatches
- Message routes → Message controller: dispatches
- Location routes → Location controller: dispatches
- Short-link routes → Short-link controller: dispatches
- User routes → Auth middleware: protects
- Message routes → Auth middleware: protects
- Lost-item routes → Auth middleware: protects
- Location routes → Auth middleware: protects
- User controller → User records: reads/writes
- Post controller → Post records: reads/writes
- Post controller → Short-link records: creates links
- Post controller → User analytics: updates
- Lost-item controller → Lost-item records: reads/writes
- Message controller → Message records: reads/writes
- Message controller → Community records: reads/writes
- Message controller → User records: reads/writes
- Socket service → User records: updates presence
- Socket service → Message records: stores messages
- Socket service → Community records: checks membership
- Location controller → Location sessions: reads/writes
- Short-link controller → Short-link records: reads/writes
- Short-link controller → User analytics: updates clicks
- Analytics controller → User analytics: reads
