# anurag-joshi-1403/social_sync_webapp architecture

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

- Interactive diagram: https://gitdiagram.com/anurag-joshi-1403/social_sync_webapp
- Repository: https://github.com/anurag-joshi-1403/social_sync_webapp

## Overview

SocialSync is a React social-media management app backed by an Express API. Users authenticate, connect simulated platform accounts, generate AI caption options, edit posts into drafts or scheduled posts, and review publishing status and engagement in dashboard and analytics views. The backend scheduler simulates publishing and stores generated engagement in MongoDB. The map includes README-documented capabilities whose implementation was not sampled; their internal wiring is therefore omitted where source evidence is unavailable.

Main entry points: [`backend/src/app.js`](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/app.js) (Express API), [`frontend/src/App.jsx`](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/App.jsx) (App routes), [`backend/src/models/Post.js`](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/models/Post.js) (MongoDB models), [`frontend/src/context/PostsContext.jsx`](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/PostsContext.jsx) (Post state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React application"]
  node_app["App routes<br/>[App.jsx]"]
  node_accountui["Account manager<br/>[Accounts.jsx]"]
  node_accountstate["Account state"]
  node_accountcontroller["Account controller"]
  node_platforms["Platform definitions<br/>[platforms.js]"]
end

subgraph group_creation["Content creation"]
  node_editor["Post editor<br/>[PostEditor.jsx]"]
  node_poststate["Post state<br/>[PostsContext.jsx]"]
  node_postservice["Post requests<br/>[postsService.js]"]
  node_postcontroller["Post controller<br/>[postController.js]"]
  node_contentcontroller["Caption endpoint"]
  node_ai["Gemini caption service<br/>[openaiService.js]"]
end

subgraph group_api["API and identity"]
  node_authui["Login and register<br/>[Login.jsx]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_authservice["Auth requests<br/>[authService.js]"]
  node_api["Express API<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_authcontroller["Auth controller<br/>[authController.js]"]
  node_authmiddleware["JWT protection<br/>[auth.js]"]
end

subgraph group_publishing["Publishing and insights"]
  node_scheduleui["Schedule calendar<br/>[Schedule.jsx]"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_analyticsui["Analytics<br/>[Analytics.jsx]"]
  node_scheduler["Publishing scheduler<br/>[scheduler.js]"]
  node_publisher["Simulated publisher"]
  node_analyticscontroller["Analytics controller"]
end

subgraph group_persistence["Persistent data"]
  node_mongo[("MongoDB models<br/>[Post.js]")]
end

node_user(("SocialSync user"))
node_gemini{{"Google Gemini"}}

node_user -->|"uses"| node_app
node_app -->|"routes to"| node_authui
node_app -->|"routes to"| node_editor
node_app -->|"routes to"| node_scheduleui
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_analyticsui
node_app -->|"routes to"| node_accountui
node_authui -->|"uses"| node_authstate
node_authstate -->|"calls"| node_authservice
node_authservice -->|"sends requests"| node_api
node_editor -->|"creates and edits"| node_poststate
node_editor -.->|"requests captions"| node_contentcontroller
node_poststate -->|"calls"| node_postservice
node_postservice -->|"sends requests"| node_api
node_accountui -->|"uses"| node_accountstate
node_accountstate -->|"uses definitions"| node_platforms
node_user -->|"calls REST API"| node_api
node_api -->|"mounts"| node_authroutes
node_authroutes -->|"routes to"| node_authcontroller
node_authroutes -->|"protects routes"| node_authmiddleware
node_authcontroller -->|"reads and writes users"| node_mongo
node_authmiddleware -->|"loads user"| node_mongo
node_api -->|"mounts posts"| node_postcontroller
node_postcontroller -->|"reads and writes posts"| node_mongo
node_api -->|"mounts accounts"| node_accountcontroller
node_accountcontroller -->|"reads and writes accounts"| node_mongo
node_api -->|"mounts captions"| node_contentcontroller
node_contentcontroller -->|"requests options"| node_ai
node_ai -->|"generates captions"| node_gemini
node_scheduler -->|"runs publishing"| node_publisher
node_publisher -->|"claims and updates posts"| node_mongo
node_api -->|"mounts analytics"| node_analyticscontroller
node_analyticscontroller -.->|"reads engagement data"| node_mongo
node_scheduleui -.->|"manages posts"| node_poststate
node_dashboard -->|"reads post state"| node_poststate
node_analyticsui -.->|"requests analytics"| node_api

click node_app "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/auth/Login.jsx"
click node_authstate "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/AuthContext.jsx"
click node_authservice "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/services/authService.js"
click node_accountui "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/accounts/Accounts.jsx"
click node_accountstate "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/AccountsContext.jsx"
click node_editor "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/editor/PostEditor.jsx"
click node_poststate "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/PostsContext.jsx"
click node_postservice "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/services/postsService.js"
click node_scheduleui "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/schedule/Schedule.jsx"
click node_dashboard "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/dashboard/Dashboard.jsx"
click node_analyticsui "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/analytics/Analytics.jsx"
click node_api "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/app.js"
click node_authroutes "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/routes/auth.js"
click node_authcontroller "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/authController.js"
click node_authmiddleware "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/middleware/auth.js"
click node_postcontroller "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/postController.js"
click node_accountcontroller "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/accountController.js"
click node_contentcontroller "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/contentController.js"
click node_ai "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/services/openaiService.js"
click node_scheduler "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/jobs/scheduler.js"
click node_publisher "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/services/publisherService.js"
click node_analyticscontroller "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/analyticsController.js"
click node_mongo "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/models/Post.js"
click node_platforms "https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/constants/platforms.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_accountui,node_accountstate,node_accountcontroller,node_platforms,node_user toneBlue
class node_editor,node_poststate,node_postservice,node_postcontroller,node_contentcontroller,node_ai toneAmber
class node_authui,node_authstate,node_authservice,node_api,node_authroutes,node_authcontroller,node_authmiddleware toneMint
class node_scheduleui,node_dashboard,node_analyticsui,node_scheduler,node_publisher,node_analyticscontroller toneRose
class node_mongo,node_gemini toneIndigo
```

## Components

### React application

- [App routes](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Account manager](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/accounts/Accounts.jsx): `frontend/src/components/accounts/Accounts.jsx`
- [Account state](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/AccountsContext.jsx): `frontend/src/context/AccountsContext.jsx`
- [Account controller](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/accountController.js): `backend/src/controllers/accountController.js`
- [Platform definitions](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/constants/platforms.js): `frontend/src/constants/platforms.js`

### Content creation

- [Post editor](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/editor/PostEditor.jsx): `frontend/src/components/editor/PostEditor.jsx`
- [Post state](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/PostsContext.jsx): `frontend/src/context/PostsContext.jsx`
- [Post requests](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/services/postsService.js): `frontend/src/services/postsService.js`
- [Post controller](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/postController.js): `backend/src/controllers/postController.js`
- [Caption endpoint](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/contentController.js): `backend/src/controllers/contentController.js`
- [Gemini caption service](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/services/openaiService.js): `backend/src/services/openaiService.js`

### API and identity

- [Login and register](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/auth/Login.jsx): `frontend/src/components/auth/Login.jsx`
- [Auth state](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Auth requests](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/services/authService.js): `frontend/src/services/authService.js`
- [Express API](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/routes/auth.js): `backend/src/routes/auth.js`
- [Auth controller](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/authController.js): `backend/src/controllers/authController.js`
- [JWT protection](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/middleware/auth.js): `backend/src/middleware/auth.js`

### Publishing and insights

- [Schedule calendar](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/schedule/Schedule.jsx): `frontend/src/components/schedule/Schedule.jsx`
- [Dashboard](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/dashboard/Dashboard.jsx): `frontend/src/components/dashboard/Dashboard.jsx`
- [Analytics](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/frontend/src/components/analytics/Analytics.jsx): `frontend/src/components/analytics/Analytics.jsx`
- [Publishing scheduler](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/jobs/scheduler.js): `backend/src/jobs/scheduler.js`
- [Simulated publisher](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/services/publisherService.js): `backend/src/services/publisherService.js`
- [Analytics controller](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/controllers/analyticsController.js): `backend/src/controllers/analyticsController.js`

### Persistent data

- [MongoDB models](https://github.com/anurag-joshi-1403/social_sync_webapp/blob/main/backend/src/models/Post.js): `backend/src/models/Post.js`

### Other components

- **SocialSync user**
- **Google Gemini**

## Connections

- SocialSync user → App routes: uses
- App routes → Login and register: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Post editor: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Schedule calendar: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Dashboard: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Analytics: routes to (evidence: `frontend/src/App.jsx`)
- App routes → Account manager: routes to (evidence: `frontend/src/App.jsx`)
- Login and register → Auth state: uses
- Auth state → Auth requests: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Auth requests → Express API: sends requests (evidence: `frontend/src/services/authService.js`)
- Post editor → Post state: creates and edits (evidence: `frontend/src/components/editor/PostEditor.jsx`)
- Post editor → Caption endpoint: requests captions
- Post state → Post requests: calls (evidence: `frontend/src/context/PostsContext.jsx`)
- Post requests → Express API: sends requests (evidence: `frontend/src/services/postsService.js`)
- Account manager → Account state: uses (evidence: `frontend/src/components/accounts/Accounts.jsx`)
- Account state → Platform definitions: uses definitions (evidence: `frontend/src/components/accounts/Accounts.jsx`)
- SocialSync user → Express API: calls REST API
- Express API → Auth routes: mounts (evidence: `backend/src/app.js`)
- Auth routes → Auth controller: routes to (evidence: `backend/src/routes/auth.js`)
- Auth routes → JWT protection: protects routes (evidence: `backend/src/routes/auth.js`)
- Auth controller → MongoDB models: reads and writes users (evidence: `backend/src/controllers/authController.js`)
- JWT protection → MongoDB models: loads user (evidence: `backend/src/middleware/auth.js`)
- Express API → Post controller: mounts posts (evidence: `backend/src/app.js`)
- Post controller → MongoDB models: reads and writes posts (evidence: `backend/src/controllers/postController.js`)
- Express API → Account controller: mounts accounts (evidence: `backend/src/app.js`)
- Account controller → MongoDB models: reads and writes accounts (evidence: `backend/src/controllers/accountController.js`)
- Express API → Caption endpoint: mounts captions (evidence: `backend/src/app.js`)
- Caption endpoint → Gemini caption service: requests options (evidence: `backend/src/controllers/contentController.js`)
- Gemini caption service → Google Gemini: generates captions
- Publishing scheduler → Simulated publisher: runs publishing (evidence: `backend/src/jobs/scheduler.js`)
- Simulated publisher → MongoDB models: claims and updates posts (evidence: `backend/src/services/publisherService.js`)
- Express API → Analytics controller: mounts analytics (evidence: `backend/src/app.js`)
- Analytics controller → MongoDB models: reads engagement data
- Schedule calendar → Post state: manages posts
- Dashboard → Post state: reads post state (evidence: `frontend/src/components/dashboard/Dashboard.jsx`)
- Analytics → Express API: requests analytics
