# srinivas-batthula/coflow architecture

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

- Interactive diagram: https://gitdiagram.com/srinivas-batthula/coflow
- Repository: https://github.com/srinivas-batthula/coflow

## Overview

CoFlow is a web app for hackathon teams. Members authenticate, join or manage teams, collaborate on assigned tasks and chat in real time; the client communicates with Express endpoints and Socket.IO. A separate branch discovers and serves hackathon listings, while queued push notifications and the installable offline-capable PWA extend collaboration beyond active sessions. The graph uses README workflow descriptions and SOURCE INDEX references; unsampled team and chat implementation details are represented only where documented.

Main entry points: [`backend/services/scrapers/mainScraper.js`](https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/mainScraper.js) (Scraper coordinator), [`frontend/components/TaskSection.js`](https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskSection.js) (Task section), [`backend/routes/MainRouter.js`](https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/MainRouter.js) (API routes), [`backend/routes/authRouter.js`](https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/authRouter.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_webapp["Next.js application"]
  node_teamviews["Team views"]
  node_taskui["Task section<br/>[TaskSection.js]"]
  node_taskcreate["Task creation<br/>[CreateTask.js]"]
  node_taskmodal["Task details<br/>[TaskModal.js]"]
  node_chatui["Team chat<br/>[ChatSection.js]"]
  node_authstore["Auth state<br/>[useAuthStore.js]"]
  node_teamstore["Team state<br/>[useTeamStore.js]"]
  node_offlinepwa["Offline PWA<br/>[service-worker.js]"]
  node_hackathonui["Hackathon state"]
end

subgraph group_identity["Identity"]
  node_api["Express API<br/>[app.js]"]
  node_mainrouter["API routes<br/>[MainRouter.js]"]
  node_authroutes["Auth routes<br/>[authRouter.js]"]
  node_authcontroller["Auth controller<br/>[auth_controller.js]"]
  node_oauthroutes["OAuth routes"]
  node_oauthstrategies["OAuth strategies<br/>[githubStrategy.js]"]
  node_userstore[("User records<br/>[userModel.js]")]
end

subgraph group_teams["Team collaboration"]
  node_teamroutes["Team routes<br/>[teamRouter.js]"]
  node_teamcontroller["Team management"]
  node_teamstoredb[("Team records<br/>[TeamModel.js]")]
  node_taskuiwire["Task events<br/>[TaskSection.js]"]
  node_tasksocket["Task socket<br/>[taskSocket.js]"]
  node_taskmodel[("Task records<br/>[taskModel.js]")]
  node_chatmodel[("Chat messages")]
end

subgraph group_hackathons["Hackathon listings"]
  node_hackathonroutes["Hackathon endpoints"]
  node_hackathonmodel[("Hackathon records<br/>[hackathonsModel.js]")]
  node_scraper["Scraper coordinator<br/>[mainScraper.js]"]
  node_devpost["Devpost fetcher"]
  node_unstop["Unstop scraper<br/>[unstop_scraper.js]"]
  node_browser["Browser scraper<br/>[browser.js]"]
  node_syncjob["Scheduled sync"]
end

subgraph group_realtime["Realtime delivery"]
  node_server["Runtime server<br/>[server.js]"]
  node_socketindex["Socket dispatcher<br/>[index.js]"]
end

node_member(("Team member"))

node_member -->|"uses"| node_webapp
node_webapp -->|"opens"| node_teamviews
node_webapp -.->|"authenticates through"| node_authstore
node_teamviews -.->|"shows tasks"| node_taskui
node_taskui -->|"renders"| node_taskcreate
node_taskui -->|"renders"| node_taskmodal
node_taskui -->|"emits events"| node_taskuiwire
node_member -->|"chats with"| node_chatui
node_member -->|"signs in"| node_authstore
node_authstore -->|"requests auth"| node_authroutes
node_api -->|"mounts"| node_mainrouter
node_mainrouter -->|"routes to"| node_authroutes
node_mainrouter -->|"routes to"| node_teamroutes
node_mainrouter -->|"routes to"| node_hackathonroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"mounts"| node_oauthroutes
node_oauthroutes -.->|"authenticates with"| node_oauthstrategies
node_authcontroller -->|"reads and writes"| node_userstore
node_teamroutes -->|"dispatches"| node_teamcontroller
node_teamcontroller -->|"reads and writes"| node_teamstoredb
node_taskuiwire -.->|"exchanges task events"| node_tasksocket
node_tasksocket -->|"reads and writes"| node_taskmodel
node_member -->|"collaborates on tasks"| node_tasksocket
node_chatui -.->|"exchanges messages"| node_chatmodel
node_hackathonui -.->|"requests listings"| node_hackathonroutes
node_hackathonroutes -->|"reads and writes"| node_hackathonmodel
node_hackathonroutes -->|"starts refresh"| node_scraper
node_syncjob -->|"runs sync"| node_scraper
node_scraper -->|"uses"| node_browser
node_scraper -->|"fetches from"| node_devpost
node_scraper -->|"scrapes"| node_unstop
node_scraper -->|"stores listings"| node_hackathonmodel
node_server -->|"starts"| node_api
node_server -->|"starts"| node_syncjob
node_api -->|"initializes"| node_socketindex
node_socketindex -->|"registers"| node_tasksocket
node_socketindex -.->|"registers chat handler"| node_chatui
node_offlinepwa -->|"supports offline use"| node_member

click node_webapp "https://github.com/srinivas-batthula/coflow/tree/main/frontend/app"
click node_teamviews "https://github.com/srinivas-batthula/coflow/tree/main/frontend/app/teams"
click node_taskui "https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskSection.js"
click node_taskcreate "https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/CreateTask.js"
click node_taskmodal "https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskModal.js"
click node_chatui "https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/ChatSection.js"
click node_authstore "https://github.com/srinivas-batthula/coflow/blob/main/frontend/store/useAuthStore.js"
click node_teamstore "https://github.com/srinivas-batthula/coflow/blob/main/frontend/store/useTeamStore.js"
click node_offlinepwa "https://github.com/srinivas-batthula/coflow/blob/main/frontend/public/service-worker.js"
click node_api "https://github.com/srinivas-batthula/coflow/blob/main/backend/app.js"
click node_mainrouter "https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/MainRouter.js"
click node_authroutes "https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/authRouter.js"
click node_authcontroller "https://github.com/srinivas-batthula/coflow/blob/main/backend/controllers/auth_controller.js"
click node_oauthroutes "https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/googleOAuthRoutes.js"
click node_oauthstrategies "https://github.com/srinivas-batthula/coflow/blob/main/backend/strategies/githubStrategy.js"
click node_userstore "https://github.com/srinivas-batthula/coflow/blob/main/backend/models/userModel.js"
click node_teamroutes "https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/teamRouter.js"
click node_teamcontroller "https://github.com/srinivas-batthula/coflow/blob/main/backend/controllers/teams_controller.js"
click node_teamstoredb "https://github.com/srinivas-batthula/coflow/blob/main/backend/models/TeamModel.js"
click node_taskuiwire "https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskSection.js"
click node_tasksocket "https://github.com/srinivas-batthula/coflow/blob/main/backend/socket/taskSocket.js"
click node_taskmodel "https://github.com/srinivas-batthula/coflow/blob/main/backend/models/taskModel.js"
click node_chatmodel "https://github.com/srinivas-batthula/coflow/blob/main/backend/models/chatMessageModel.js"
click node_hackathonui "https://github.com/srinivas-batthula/coflow/blob/main/frontend/store/useHackathonStore.js"
click node_hackathonroutes "https://github.com/srinivas-batthula/coflow/blob/main/backend/controllers/hackathons_controller.js"
click node_hackathonmodel "https://github.com/srinivas-batthula/coflow/blob/main/backend/models/hackathonsModel.js"
click node_scraper "https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/mainScraper.js"
click node_devpost "https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/devpostapi_fetcher.js"
click node_unstop "https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/unstop_scraper.js"
click node_browser "https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/browser.js"
click node_syncjob "https://github.com/srinivas-batthula/coflow/blob/main/backend/services/cron_jobs/hackathonsUpdater.js"
click node_server "https://github.com/srinivas-batthula/coflow/blob/main/backend/server.js"
click node_socketindex "https://github.com/srinivas-batthula/coflow/blob/main/backend/socket/index.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_webapp,node_teamviews,node_taskui,node_taskcreate,node_taskmodal,node_chatui,node_authstore,node_teamstore,node_offlinepwa,node_hackathonui toneBlue
class node_api,node_mainrouter,node_authroutes,node_authcontroller,node_oauthroutes,node_oauthstrategies,node_userstore toneAmber
class node_teamroutes,node_teamcontroller,node_teamstoredb,node_taskuiwire,node_tasksocket,node_taskmodel,node_chatmodel toneMint
class node_hackathonroutes,node_hackathonmodel,node_scraper,node_devpost,node_unstop,node_browser,node_syncjob toneRose
class node_server,node_socketindex,node_member toneIndigo
```

## Components

### Web client

- [Next.js application](https://github.com/srinivas-batthula/coflow/tree/main/frontend/app): `frontend/app`
- [Team views](https://github.com/srinivas-batthula/coflow/tree/main/frontend/app/teams): `frontend/app/teams`
- [Task section](https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskSection.js): `frontend/components/TaskSection.js`
- [Task creation](https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/CreateTask.js): `frontend/components/CreateTask.js`
- [Task details](https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskModal.js): `frontend/components/TaskModal.js`
- [Team chat](https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/ChatSection.js): `frontend/components/ChatSection.js`
- [Auth state](https://github.com/srinivas-batthula/coflow/blob/main/frontend/store/useAuthStore.js): `frontend/store/useAuthStore.js`
- [Team state](https://github.com/srinivas-batthula/coflow/blob/main/frontend/store/useTeamStore.js): `frontend/store/useTeamStore.js`
- [Offline PWA](https://github.com/srinivas-batthula/coflow/blob/main/frontend/public/service-worker.js): `frontend/public/service-worker.js`
- [Hackathon state](https://github.com/srinivas-batthula/coflow/blob/main/frontend/store/useHackathonStore.js): `frontend/store/useHackathonStore.js`

### Identity

- [Express API](https://github.com/srinivas-batthula/coflow/blob/main/backend/app.js): `backend/app.js`
- [API routes](https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/MainRouter.js): `backend/routes/MainRouter.js`
- [Auth routes](https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/authRouter.js): `backend/routes/authRouter.js`
- [Auth controller](https://github.com/srinivas-batthula/coflow/blob/main/backend/controllers/auth_controller.js): `backend/controllers/auth_controller.js`
- [OAuth routes](https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/googleOAuthRoutes.js): `backend/routes/googleOAuthRoutes.js`
- [OAuth strategies](https://github.com/srinivas-batthula/coflow/blob/main/backend/strategies/githubStrategy.js): `backend/strategies/githubStrategy.js`
- [User records](https://github.com/srinivas-batthula/coflow/blob/main/backend/models/userModel.js): `backend/models/userModel.js`

### Team collaboration

- [Team routes](https://github.com/srinivas-batthula/coflow/blob/main/backend/routes/teamRouter.js): `backend/routes/teamRouter.js`
- [Team management](https://github.com/srinivas-batthula/coflow/blob/main/backend/controllers/teams_controller.js): `backend/controllers/teams_controller.js`
- [Team records](https://github.com/srinivas-batthula/coflow/blob/main/backend/models/TeamModel.js): `backend/models/TeamModel.js`
- [Task events](https://github.com/srinivas-batthula/coflow/blob/main/frontend/components/TaskSection.js): `frontend/components/TaskSection.js`
- [Task socket](https://github.com/srinivas-batthula/coflow/blob/main/backend/socket/taskSocket.js): `backend/socket/taskSocket.js`
- [Task records](https://github.com/srinivas-batthula/coflow/blob/main/backend/models/taskModel.js): `backend/models/taskModel.js`
- [Chat messages](https://github.com/srinivas-batthula/coflow/blob/main/backend/models/chatMessageModel.js): `backend/models/chatMessageModel.js`

### Hackathon listings

- [Hackathon endpoints](https://github.com/srinivas-batthula/coflow/blob/main/backend/controllers/hackathons_controller.js): `backend/controllers/hackathons_controller.js`
- [Hackathon records](https://github.com/srinivas-batthula/coflow/blob/main/backend/models/hackathonsModel.js): `backend/models/hackathonsModel.js`
- [Scraper coordinator](https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/mainScraper.js): `backend/services/scrapers/mainScraper.js`
- [Devpost fetcher](https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/devpostapi_fetcher.js): `backend/services/scrapers/devpostapi_fetcher.js`
- [Unstop scraper](https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/unstop_scraper.js): `backend/services/scrapers/unstop_scraper.js`
- [Browser scraper](https://github.com/srinivas-batthula/coflow/blob/main/backend/services/scrapers/browser.js): `backend/services/scrapers/browser.js`
- [Scheduled sync](https://github.com/srinivas-batthula/coflow/blob/main/backend/services/cron_jobs/hackathonsUpdater.js): `backend/services/cron_jobs/hackathonsUpdater.js`

### Realtime delivery

- [Runtime server](https://github.com/srinivas-batthula/coflow/blob/main/backend/server.js): `backend/server.js`
- [Socket dispatcher](https://github.com/srinivas-batthula/coflow/blob/main/backend/socket/index.js): `backend/socket/index.js`

### Other components

- **Team member**

## Connections

- Team member → Next.js application: uses (evidence: `README.md`)
- Next.js application → Team views: opens (evidence: `README.md`)
- Next.js application → Auth state: authenticates through
- Team views → Task section: shows tasks
- Task section → Task creation: renders (evidence: `frontend/components/TaskSection.js`)
- Task section → Task details: renders (evidence: `frontend/components/TaskSection.js`)
- Task section → Task events: emits events (evidence: `frontend/components/TaskSection.js`)
- Team member → Team chat: chats with (evidence: `README.md`)
- Team member → Auth state: signs in (evidence: `frontend/store/useAuthStore.js`)
- Auth state → Auth routes: requests auth (evidence: `frontend/store/useAuthStore.js`)
- Express API → API routes: mounts (evidence: `backend/app.js`)
- API routes → Auth routes: routes to (evidence: `backend/routes/MainRouter.js`)
- API routes → Team routes: routes to (evidence: `backend/routes/MainRouter.js`)
- API routes → Hackathon endpoints: routes to (evidence: `backend/routes/MainRouter.js`)
- Auth routes → Auth controller: dispatches (evidence: `backend/routes/authRouter.js`)
- Auth routes → OAuth routes: mounts (evidence: `backend/routes/authRouter.js`)
- OAuth routes → OAuth strategies: authenticates with
- Auth controller → User records: reads and writes (evidence: `backend/controllers/auth_controller.js`)
- Team routes → Team management: dispatches
- Team management → Team records: reads and writes (evidence: `backend/controllers/teams_controller.js`)
- Task events → Task socket: exchanges task events (evidence: `README.md`)
- Task socket → Task records: reads and writes (evidence: `backend/socket/taskSocket.js`)
- Team member → Task socket: collaborates on tasks (evidence: `README.md`)
- Team chat → Chat messages: exchanges messages (evidence: `README.md`)
- Hackathon state → Hackathon endpoints: requests listings
- Hackathon endpoints → Hackathon records: reads and writes (evidence: `backend/controllers/hackathons_controller.js`)
- Hackathon endpoints → Scraper coordinator: starts refresh (evidence: `backend/controllers/hackathons_controller.js`)
- Scheduled sync → Scraper coordinator: runs sync (evidence: `backend/services/cron_jobs/hackathonsUpdater.js`)
- Scraper coordinator → Browser scraper: uses (evidence: `backend/services/scrapers/mainScraper.js`)
- Scraper coordinator → Devpost fetcher: fetches from (evidence: `backend/services/scrapers/mainScraper.js`)
- Scraper coordinator → Unstop scraper: scrapes (evidence: `backend/services/scrapers/mainScraper.js`)
- Scraper coordinator → Hackathon records: stores listings (evidence: `backend/services/scrapers/mainScraper.js`)
- Runtime server → Express API: starts (evidence: `backend/server.js`)
- Runtime server → Scheduled sync: starts (evidence: `backend/server.js`)
- Express API → Socket dispatcher: initializes (evidence: `backend/app.js`)
- Socket dispatcher → Task socket: registers (evidence: `backend/socket/index.js`)
- Socket dispatcher → Team chat: registers chat handler
- Offline PWA → Team member: supports offline use (evidence: `README.md`)
