# harshmalviya7415/vybe architecture

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

## Overview

Vybe is a campus social and local-business promotion platform. Students and staff use the mobile app to join campus communities, share feed posts, discover notices and deals, and message connections or groups; businesses manage profiles and campaigns through the business experience. The backend exposes authenticated APIs, persists product data in MongoDB, and supports real-time chat and push notifications. The README documents the broad feature set; sampled server routes and controller excerpts establish selected dispatch and persistence links, while unsampled feature internals are represented conservatively.

Main entry points: [`backend/server.js`](https://github.com/harshmalviya7415/vybe/blob/main/backend/server.js) (Backend API), [`backend/config/db.js`](https://github.com/harshmalviya7415/vybe/blob/main/backend/config/db.js) (MongoDB records), [`frontend/src/app`](https://github.com/harshmalviya7415/vybe/tree/main/frontend/src/app) (Vybe mobile app), [`backend/controller/messageController.js`](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/messageController.js) (Direct messaging)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User experiences"]
  node_mobile["Vybe mobile app"]
  node_businessweb["Business web portal"]
end

subgraph group_identity["Identity and community"]
  node_auth["Auth and profiles"]
  node_community["Community discovery"]
end

subgraph group_engagement["Campus engagement"]
  node_feed["Campus feed<br/>[postcontroller.js]"]
  node_reactions["Post reactions"]
  node_alerts["Campus alerts<br/>[campusalert.js]"]
  node_vibe["Daily vibe check<br/>[vibecheck.js]"]
  node_messaging["Direct messaging"]
  node_realtime["Live chat channels<br/>[handlers.js]"]
  node_backchannels["Backchannels<br/>[backchannel.js]"]
end

subgraph group_commerce["Business promotion"]
  node_businessprofile["Business profiles"]
  node_deals["Deals and targeting<br/>[dealcontroller.js]"]
end

subgraph group_platform["Backend platform"]
  node_api["Backend API<br/>[server.js]"]
  node_notifications["Push notifications"]
  node_mongo[("MongoDB records<br/>[db.js]")]
  node_redis[("Redis<br/>[redis.js]")]
  node_cloudinary["Cloudinary media<br/>[cloudinary.js]"]
end

node_users(("Campus users"))
node_businesses(("Business owners"))
node_fcm["Firebase messaging"]

node_users -->|"use"| node_mobile
node_businesses -->|"manage campaigns"| node_businessweb
node_mobile -->|"API requests"| node_api
node_businessweb -->|"business API"| node_api
node_api -->|"dispatches auth"| node_auth
node_api -->|"dispatches discovery"| node_community
node_api -->|"dispatches posts"| node_feed
node_api -->|"dispatches reactions"| node_reactions
node_api -->|"dispatches alerts"| node_alerts
node_api -->|"dispatches checks"| node_vibe
node_api -->|"dispatches messages"| node_messaging
node_api -->|"dispatches rooms"| node_backchannels
node_api -->|"dispatches profiles"| node_businessprofile
node_api -->|"dispatches deals"| node_deals
node_feed -->|"reads and writes posts"| node_mongo
node_reactions -->|"stores reactions"| node_mongo
node_messaging -->|"stores messages"| node_mongo
node_deals -->|"reads and writes deals"| node_mongo
node_businessprofile -->|"stores profiles"| node_mongo
node_api -.->|"uploads media"| node_cloudinary
node_api -->|"starts sockets"| node_realtime
node_realtime -->|"tracks live presence"| node_redis
node_realtime -->|"stores chat messages"| node_mongo
node_messaging -->|"requests push"| node_notifications
node_notifications -->|"reads tokens and saves notices"| node_mongo
node_notifications -->|"sends push"| node_fcm
node_mobile -->|"registers push token"| node_api

click node_mobile "https://github.com/harshmalviya7415/vybe/tree/main/frontend/src/app"
click node_businessweb "https://github.com/harshmalviya7415/vybe/tree/main/web/src"
click node_api "https://github.com/harshmalviya7415/vybe/blob/main/backend/server.js"
click node_auth "https://github.com/harshmalviya7415/vybe/tree/main/backend/controller"
click node_community "https://github.com/harshmalviya7415/vybe/tree/main/backend/controller"
click node_feed "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/postcontroller.js"
click node_reactions "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/postreactcontrollers.js"
click node_alerts "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/campusalert.js"
click node_vibe "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/vibecheck.js"
click node_messaging "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/messageController.js"
click node_realtime "https://github.com/harshmalviya7415/vybe/blob/main/backend/socket/handlers.js"
click node_backchannels "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/backchannel.js"
click node_businessprofile "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/businessProfileController.js"
click node_deals "https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/dealcontroller.js"
click node_notifications "https://github.com/harshmalviya7415/vybe/blob/main/backend/services/notificationService.js"
click node_mongo "https://github.com/harshmalviya7415/vybe/blob/main/backend/config/db.js"
click node_redis "https://github.com/harshmalviya7415/vybe/blob/main/backend/config/redis.js"
click node_cloudinary "https://github.com/harshmalviya7415/vybe/blob/main/backend/config/cloudinary.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_mobile,node_businessweb,node_users toneBlue
class node_auth,node_community toneAmber
class node_feed,node_reactions,node_alerts,node_vibe,node_messaging,node_realtime,node_backchannels toneMint
class node_businessprofile,node_deals toneRose
class node_api,node_notifications,node_mongo,node_redis,node_cloudinary,node_businesses,node_fcm toneIndigo
```

## Components

### User experiences

- [Vybe mobile app](https://github.com/harshmalviya7415/vybe/tree/main/frontend/src/app): `frontend/src/app`
- [Business web portal](https://github.com/harshmalviya7415/vybe/tree/main/web/src): `web/src`

### Identity and community

- [Auth and profiles](https://github.com/harshmalviya7415/vybe/tree/main/backend/controller): `backend/controller`
- [Community discovery](https://github.com/harshmalviya7415/vybe/tree/main/backend/controller): `backend/controller`

### Campus engagement

- [Campus feed](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/postcontroller.js): `backend/controller/postcontroller.js`
- [Post reactions](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/postreactcontrollers.js): `backend/controller/postreactcontrollers.js`
- [Campus alerts](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/campusalert.js): `backend/controller/campusalert.js`
- [Daily vibe check](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/vibecheck.js): `backend/controller/vibecheck.js`
- [Direct messaging](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/messageController.js): `backend/controller/messageController.js`
- [Live chat channels](https://github.com/harshmalviya7415/vybe/blob/main/backend/socket/handlers.js): `backend/socket/handlers.js`
- [Backchannels](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/backchannel.js): `backend/controller/backchannel.js`

### Business promotion

- [Business profiles](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/businessProfileController.js): `backend/controller/businessProfileController.js`
- [Deals and targeting](https://github.com/harshmalviya7415/vybe/blob/main/backend/controller/dealcontroller.js): `backend/controller/dealcontroller.js`

### Backend platform

- [Backend API](https://github.com/harshmalviya7415/vybe/blob/main/backend/server.js): `backend/server.js`
- [Push notifications](https://github.com/harshmalviya7415/vybe/blob/main/backend/services/notificationService.js): `backend/services/notificationService.js`
- [MongoDB records](https://github.com/harshmalviya7415/vybe/blob/main/backend/config/db.js): `backend/config/db.js`
- [Redis](https://github.com/harshmalviya7415/vybe/blob/main/backend/config/redis.js): `backend/config/redis.js`
- [Cloudinary media](https://github.com/harshmalviya7415/vybe/blob/main/backend/config/cloudinary.js): `backend/config/cloudinary.js`

### Other components

- **Campus users**
- **Business owners**
- **Firebase messaging**

## Connections

- Campus users → Vybe mobile app: use
- Business owners → Business web portal: manage campaigns
- Vybe mobile app → Backend API: API requests
- Business web portal → Backend API: business API
- Backend API → Auth and profiles: dispatches auth
- Backend API → Community discovery: dispatches discovery
- Backend API → Campus feed: dispatches posts
- Backend API → Post reactions: dispatches reactions
- Backend API → Campus alerts: dispatches alerts
- Backend API → Daily vibe check: dispatches checks
- Backend API → Direct messaging: dispatches messages
- Backend API → Backchannels: dispatches rooms
- Backend API → Business profiles: dispatches profiles
- Backend API → Deals and targeting: dispatches deals
- Campus feed → MongoDB records: reads and writes posts
- Post reactions → MongoDB records: stores reactions
- Direct messaging → MongoDB records: stores messages
- Deals and targeting → MongoDB records: reads and writes deals
- Business profiles → MongoDB records: stores profiles
- Backend API → Cloudinary media: uploads media
- Backend API → Live chat channels: starts sockets
- Live chat channels → Redis: tracks live presence
- Live chat channels → MongoDB records: stores chat messages
- Direct messaging → Push notifications: requests push
- Push notifications → MongoDB records: reads tokens and saves notices
- Push notifications → Firebase messaging: sends push
- Vybe mobile app → Backend API: registers push token
