# sravya-cyber/devbrand architecture

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

- Interactive diagram: https://gitdiagram.com/sravya-cyber/devbrand
- Repository: https://github.com/sravya-cyber/devbrand

## Overview

DevBrand turns a developer’s coding activity into milestone drafts and scheduled social posts. Users connect coding profiles, review activity and milestones, generate or edit content, score and schedule posts, then inspect calendar and analytics views. The backend combines API handlers, MongoDB-backed state, scheduled milestone checks, Gemini content generation, and a Redis-backed publishing worker. The README documents analytics and scheduler capabilities; some route implementations were not sampled, so those links are omitted or marked unverified.

Main entry points: [`client/src/App.jsx`](https://github.com/sravya-cyber/devbrand/blob/main/client/src/App.jsx) (Web app routes), [`server/services/milestoneService.js`](https://github.com/sravya-cyber/devbrand/blob/main/server/services/milestoneService.js) (Milestone checker), [`client/src/services/api.js`](https://github.com/sravya-cyber/devbrand/blob/main/client/src/services/api.js) (HTTP API client), [`server/index.js`](https://github.com/sravya-cyber/devbrand/blob/main/server/index.js) (Express API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["Web app routes<br/>[App.jsx]"]
  node_auth_ui["Auth context<br/>[AuthContext.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_post_ui["Post studio<br/>[CreatePost.jsx]"]
  node_calendar["Post calendar<br/>[Calendar.jsx]"]
  node_analytics_ui["Analytics view<br/>[Analytics.jsx]"]
  node_accounts_ui["Connected accounts<br/>[Accounts.jsx]"]
  node_milestones_ui["Milestone review<br/>[Milestones.jsx]"]
end

subgraph group_api["API and identity"]
  node_api_client["HTTP API client<br/>[api.js]"]
  node_server["Express API<br/>[index.js]"]
  node_auth_routes["Auth handlers<br/>[authController.js]"]
  node_auth_guard["JWT guard<br/>[auth.js]"]
end

subgraph group_content["Content and publishing"]
  node_post_routes["Post handlers<br/>[postController.js]"]
  node_ai_routes["AI handlers<br/>[aiController.js]"]
  node_gemini["Gemini content AI<br/>[geminiService.js]"]
  node_post_queue["Post scheduler<br/>[postQueue.js]"]
  node_post_worker["Publishing worker<br/>[postWorker.js]"]
  node_linkedin["LinkedIn publishing<br/>[linkedinService.js]"]
end

subgraph group_milestones["Activity and milestones"]
  node_milestone_service["Milestone checker"]
  node_cf_service["Codeforces tracking"]
  node_lc_service["LeetCode tracking<br/>[leetcodeService.js]"]
  node_gh_service["GitHub tracking<br/>[githubService.js]"]
end

subgraph group_state["Persistent state"]
  node_users[("User profiles<br/>[User.js]")]
  node_posts[("Posts<br/>[Post.js]")]
  node_milestones[("Milestone records<br/>[Milestone.js]")]
  node_notifications[("Notifications<br/>[Notification.js]")]
  node_social_accounts[("Social accounts<br/>[SocialAccount.js]")]
end

node_developer(("Developer"))
node_redis[("Redis")]
node_mongo[("MongoDB")]
node_gemini_service{{"Gemini API"}}
node_coding_platforms{{"Coding platforms"}}

node_developer -->|"uses"| node_app
node_app -->|"provides auth"| node_auth_ui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_post_ui
node_app -->|"routes to"| node_calendar
node_app -->|"routes to"| node_analytics_ui
node_app -->|"routes to"| node_accounts_ui
node_app -->|"routes to"| node_milestones_ui
node_auth_ui -->|"requests"| node_api_client
node_dashboard -->|"requests"| node_api_client
node_post_ui -->|"requests"| node_api_client
node_calendar -->|"requests"| node_api_client
node_analytics_ui -->|"requests"| node_api_client
node_accounts_ui -->|"requests"| node_api_client
node_milestones_ui -->|"requests"| node_api_client
node_api_client -.->|"HTTP requests"| node_server
node_server -->|"mounts routes"| node_auth_routes
node_server -->|"mounts routes"| node_post_routes
node_server -->|"mounts routes"| node_ai_routes
node_server -->|"starts checker"| node_milestone_service
node_auth_routes -->|"protects routes"| node_auth_guard
node_auth_routes -->|"authenticates users"| node_users
node_auth_guard -->|"loads user"| node_users
node_post_routes -->|"creates and reads"| node_posts
node_post_routes -->|"scores content"| node_gemini
node_post_routes -->|"schedules jobs"| node_post_queue
node_ai_routes -->|"generates content"| node_gemini
node_gemini -->|"calls"| node_gemini_service
node_post_queue -.->|"persists jobs"| node_redis
node_post_worker -->|"processes jobs"| node_post_queue
node_post_worker -->|"updates status"| node_posts
node_post_worker -->|"loads account"| node_social_accounts
node_post_worker -->|"publishes to"| node_linkedin
node_post_worker -->|"records outcome"| node_notifications
node_linkedin -.->|"publishes externally"| node_coding_platforms
node_milestone_service -->|"loads and updates"| node_users
node_milestone_service -->|"checks profile"| node_cf_service
node_milestone_service -->|"checks profile"| node_lc_service
node_milestone_service -->|"checks profile"| node_gh_service
node_milestone_service -->|"stores discoveries"| node_milestones
node_milestone_service -->|"creates alerts"| node_notifications
node_milestone_service -->|"drafts celebration"| node_gemini
node_cf_service -.->|"fetches stats"| node_coding_platforms
node_lc_service -.->|"fetches stats"| node_coding_platforms
node_gh_service -.->|"fetches stats"| node_coding_platforms
node_server -->|"connects"| node_mongo

click node_app "https://github.com/sravya-cyber/devbrand/blob/main/client/src/App.jsx"
click node_auth_ui "https://github.com/sravya-cyber/devbrand/blob/main/client/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Dashboard.jsx"
click node_post_ui "https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/CreatePost.jsx"
click node_calendar "https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Calendar.jsx"
click node_analytics_ui "https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Analytics.jsx"
click node_accounts_ui "https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Accounts.jsx"
click node_milestones_ui "https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Milestones.jsx"
click node_api_client "https://github.com/sravya-cyber/devbrand/blob/main/client/src/services/api.js"
click node_server "https://github.com/sravya-cyber/devbrand/blob/main/server/index.js"
click node_auth_routes "https://github.com/sravya-cyber/devbrand/blob/main/server/controllers/authController.js"
click node_auth_guard "https://github.com/sravya-cyber/devbrand/blob/main/server/middleware/auth.js"
click node_post_routes "https://github.com/sravya-cyber/devbrand/blob/main/server/controllers/postController.js"
click node_ai_routes "https://github.com/sravya-cyber/devbrand/blob/main/server/controllers/aiController.js"
click node_gemini "https://github.com/sravya-cyber/devbrand/blob/main/server/services/geminiService.js"
click node_post_queue "https://github.com/sravya-cyber/devbrand/blob/main/server/queues/postQueue.js"
click node_post_worker "https://github.com/sravya-cyber/devbrand/blob/main/server/queues/workers/postWorker.js"
click node_linkedin "https://github.com/sravya-cyber/devbrand/blob/main/server/services/linkedinService.js"
click node_milestone_service "https://github.com/sravya-cyber/devbrand/blob/main/server/services/milestoneService.js"
click node_cf_service "https://github.com/sravya-cyber/devbrand/blob/main/server/services/codeforcesService.js"
click node_lc_service "https://github.com/sravya-cyber/devbrand/blob/main/server/services/leetcodeService.js"
click node_gh_service "https://github.com/sravya-cyber/devbrand/blob/main/server/services/githubService.js"
click node_users "https://github.com/sravya-cyber/devbrand/blob/main/server/models/User.js"
click node_posts "https://github.com/sravya-cyber/devbrand/blob/main/server/models/Post.js"
click node_milestones "https://github.com/sravya-cyber/devbrand/blob/main/server/models/Milestone.js"
click node_notifications "https://github.com/sravya-cyber/devbrand/blob/main/server/models/Notification.js"
click node_social_accounts "https://github.com/sravya-cyber/devbrand/blob/main/server/models/SocialAccount.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_auth_ui,node_dashboard,node_post_ui,node_calendar,node_analytics_ui,node_accounts_ui,node_milestones_ui toneBlue
class node_api_client,node_server,node_auth_routes,node_auth_guard,node_redis,node_mongo toneAmber
class node_post_routes,node_ai_routes,node_gemini,node_post_queue,node_post_worker,node_linkedin,node_gemini_service toneMint
class node_milestone_service,node_cf_service,node_lc_service,node_gh_service toneRose
class node_users,node_posts,node_milestones,node_notifications,node_social_accounts,node_developer,node_coding_platforms toneIndigo
```

## Components

### Web application

- [Web app routes](https://github.com/sravya-cyber/devbrand/blob/main/client/src/App.jsx): `client/src/App.jsx`
- [Auth context](https://github.com/sravya-cyber/devbrand/blob/main/client/src/context/AuthContext.jsx): `client/src/context/AuthContext.jsx`
- [Dashboard](https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Dashboard.jsx): `client/src/pages/Dashboard.jsx`
- [Post studio](https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/CreatePost.jsx): `client/src/pages/CreatePost.jsx`
- [Post calendar](https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Calendar.jsx): `client/src/pages/Calendar.jsx`
- [Analytics view](https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Analytics.jsx): `client/src/pages/Analytics.jsx`
- [Connected accounts](https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Accounts.jsx): `client/src/pages/Accounts.jsx`
- [Milestone review](https://github.com/sravya-cyber/devbrand/blob/main/client/src/pages/Milestones.jsx): `client/src/pages/Milestones.jsx`

### API and identity

- [HTTP API client](https://github.com/sravya-cyber/devbrand/blob/main/client/src/services/api.js): `client/src/services/api.js`
- [Express API](https://github.com/sravya-cyber/devbrand/blob/main/server/index.js): `server/index.js`
- [Auth handlers](https://github.com/sravya-cyber/devbrand/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [JWT guard](https://github.com/sravya-cyber/devbrand/blob/main/server/middleware/auth.js): `server/middleware/auth.js`

### Content and publishing

- [Post handlers](https://github.com/sravya-cyber/devbrand/blob/main/server/controllers/postController.js): `server/controllers/postController.js`
- [AI handlers](https://github.com/sravya-cyber/devbrand/blob/main/server/controllers/aiController.js): `server/controllers/aiController.js`
- [Gemini content AI](https://github.com/sravya-cyber/devbrand/blob/main/server/services/geminiService.js): `server/services/geminiService.js`
- [Post scheduler](https://github.com/sravya-cyber/devbrand/blob/main/server/queues/postQueue.js): `server/queues/postQueue.js`
- [Publishing worker](https://github.com/sravya-cyber/devbrand/blob/main/server/queues/workers/postWorker.js): `server/queues/workers/postWorker.js`
- [LinkedIn publishing](https://github.com/sravya-cyber/devbrand/blob/main/server/services/linkedinService.js): `server/services/linkedinService.js`

### Activity and milestones

- [Milestone checker](https://github.com/sravya-cyber/devbrand/blob/main/server/services/milestoneService.js): `server/services/milestoneService.js`
- [Codeforces tracking](https://github.com/sravya-cyber/devbrand/blob/main/server/services/codeforcesService.js): `server/services/codeforcesService.js`
- [LeetCode tracking](https://github.com/sravya-cyber/devbrand/blob/main/server/services/leetcodeService.js): `server/services/leetcodeService.js`
- [GitHub tracking](https://github.com/sravya-cyber/devbrand/blob/main/server/services/githubService.js): `server/services/githubService.js`

### Persistent state

- [User profiles](https://github.com/sravya-cyber/devbrand/blob/main/server/models/User.js): `server/models/User.js`
- [Posts](https://github.com/sravya-cyber/devbrand/blob/main/server/models/Post.js): `server/models/Post.js`
- [Milestone records](https://github.com/sravya-cyber/devbrand/blob/main/server/models/Milestone.js): `server/models/Milestone.js`
- [Notifications](https://github.com/sravya-cyber/devbrand/blob/main/server/models/Notification.js): `server/models/Notification.js`
- [Social accounts](https://github.com/sravya-cyber/devbrand/blob/main/server/models/SocialAccount.js): `server/models/SocialAccount.js`

### Other components

- **Developer**
- **Redis**
- **MongoDB**
- **Gemini API**
- **Coding platforms**

## Connections

- Developer → Web app routes: uses (evidence: `client/src/App.jsx`)
- Web app routes → Auth context: provides auth (evidence: `client/src/App.jsx`)
- Web app routes → Dashboard: routes to (evidence: `client/src/App.jsx`)
- Web app routes → Post studio: routes to (evidence: `client/src/App.jsx`)
- Web app routes → Post calendar: routes to (evidence: `client/src/App.jsx`)
- Web app routes → Analytics view: routes to (evidence: `client/src/App.jsx`)
- Web app routes → Connected accounts: routes to (evidence: `client/src/App.jsx`)
- Web app routes → Milestone review: routes to (evidence: `client/src/App.jsx`)
- Auth context → HTTP API client: requests (evidence: `client/src/context/AuthContext.jsx`)
- Dashboard → HTTP API client: requests (evidence: `client/src/pages/Dashboard.jsx`)
- Post studio → HTTP API client: requests (evidence: `client/src/pages/CreatePost.jsx`)
- Post calendar → HTTP API client: requests (evidence: `client/src/pages/Calendar.jsx`)
- Analytics view → HTTP API client: requests (evidence: `client/src/pages/Analytics.jsx`)
- Connected accounts → HTTP API client: requests (evidence: `client/src/pages/Accounts.jsx`)
- Milestone review → HTTP API client: requests (evidence: `client/src/pages/Milestones.jsx`)
- HTTP API client → Express API: HTTP requests
- Express API → Auth handlers: mounts routes (evidence: `server/index.js`)
- Express API → Post handlers: mounts routes (evidence: `server/index.js`)
- Express API → AI handlers: mounts routes (evidence: `server/index.js`)
- Express API → Milestone checker: starts checker (evidence: `server/index.js`)
- Auth handlers → JWT guard: protects routes (evidence: `server/routes/auth.js`)
- Auth handlers → User profiles: authenticates users (evidence: `server/controllers/authController.js`)
- JWT guard → User profiles: loads user (evidence: `server/middleware/auth.js`)
- Post handlers → Posts: creates and reads (evidence: `server/controllers/postController.js`)
- Post handlers → Gemini content AI: scores content (evidence: `server/controllers/postController.js`)
- Post handlers → Post scheduler: schedules jobs (evidence: `server/controllers/postController.js`)
- AI handlers → Gemini content AI: generates content (evidence: `server/controllers/aiController.js`)
- Gemini content AI → Gemini API: calls (evidence: `server/services/geminiService.js`)
- Post scheduler → Redis: persists jobs
- Publishing worker → Post scheduler: processes jobs (evidence: `server/queues/workers/postWorker.js`)
- Publishing worker → Posts: updates status (evidence: `server/queues/workers/postWorker.js`)
- Publishing worker → Social accounts: loads account (evidence: `server/queues/workers/postWorker.js`)
- Publishing worker → LinkedIn publishing: publishes to (evidence: `server/queues/workers/postWorker.js`)
- Publishing worker → Notifications: records outcome (evidence: `server/queues/workers/postWorker.js`)
- LinkedIn publishing → Coding platforms: publishes externally
- Milestone checker → User profiles: loads and updates (evidence: `server/services/milestoneService.js`)
- Milestone checker → Codeforces tracking: checks profile (evidence: `server/services/milestoneService.js`)
- Milestone checker → LeetCode tracking: checks profile (evidence: `server/services/milestoneService.js`)
- Milestone checker → GitHub tracking: checks profile (evidence: `server/services/milestoneService.js`)
- Milestone checker → Milestone records: stores discoveries (evidence: `server/services/milestoneService.js`)
- Milestone checker → Notifications: creates alerts (evidence: `server/services/milestoneService.js`)
- Milestone checker → Gemini content AI: drafts celebration (evidence: `server/services/milestoneService.js`)
- Codeforces tracking → Coding platforms: fetches stats
- LeetCode tracking → Coding platforms: fetches stats
- GitHub tracking → Coding platforms: fetches stats
- Express API → MongoDB: connects (evidence: `server/index.js`)
