# krish-cybersec/teamsync architecture

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

- Interactive diagram: https://gitdiagram.com/krish-cybersec/teamsync
- Repository: https://github.com/krish-cybersec/teamsync

## Overview

TeamSync is intended as a multi-workspace collaboration and personal productivity platform, but the repository currently implements only a starter frontend and a partial Express backend. The visible user workflow is a public register/login request through auth routes, validation and service logic to a MongoDB-backed user record, followed by a safe user response; login does not issue a token. Workspace, project, task, chat and notification areas are scaffolded, not implemented. Edges reflect shown calls or README statements; scaffolded capabilities are shown without inferred runtime connections.

Main entry points: [`backend/src/app.js`](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/app.js) (Express app), [`backend/src/server.js`](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/server.js) (HTTP server), [`backend/src/modules/auth/auth.controller.js`](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.controller.js) (Auth controller), [`backend/src/modules/auth/auth.routes.js`](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.routes.js) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend starter"]
  node_web_app["Starter screen<br/>[App.jsx]"]
end

subgraph group_backend["Backend runtime"]
  node_server["HTTP server<br/>[server.js]"]
  node_app["Express app<br/>[app.js]"]
  node_configuration["Environment config<br/>[env.js]"]
  node_database_connection["DB connection<br/>[connection.js]"]
  node_health_routes["Health routes<br/>[health.routes.js]"]
  node_health_controller["Health handler"]
  node_error_handler["Error handler"]
end

subgraph group_identity["Identity and users"]
  node_auth_routes["Auth routes<br/>[auth.routes.js]"]
  node_auth_controller["Auth controller<br/>[auth.controller.js]"]
  node_auth_validation["Auth validation<br/>[auth.validation.js]"]
  node_auth_service["Auth service<br/>[auth.service.js]"]
  node_user_model["User model<br/>[user.model.js]"]
  node_session_model["Session model<br/>[session.model.js]"]
  node_token_helpers["JWT helpers<br/>[token.js]"]
end

subgraph group_product["Collaboration capabilities"]
  node_workspaces["Workspaces"]
  node_projects["Projects"]
  node_tasks["Tasks"]
  node_chat["Chat"]
  node_notifications["Notifications"]
end

node_person(("User"))
node_mongo[("MongoDB")]

node_person -->|"opens"| node_web_app
node_person -->|"requests auth"| node_auth_routes
node_server -->|"reads config"| node_configuration
node_server -->|"connects database"| node_database_connection
node_server -->|"starts"| node_app
node_app -->|"reads config"| node_configuration
node_app -->|"mounts"| node_health_routes
node_app -->|"mounts"| node_auth_routes
node_app -->|"handles errors"| node_error_handler
node_health_routes -->|"dispatches"| node_health_controller
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"validates input"| node_auth_validation
node_auth_controller -->|"runs auth"| node_auth_service
node_auth_service -->|"queries and saves"| node_user_model
node_user_model -->|"persists records"| node_mongo

click node_web_app "https://github.com/krish-cybersec/teamsync/blob/main/frontend/src/App.jsx"
click node_server "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/server.js"
click node_app "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/app.js"
click node_configuration "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/config/env.js"
click node_database_connection "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/database/connection.js"
click node_health_routes "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/health/health.routes.js"
click node_health_controller "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/health/health.controller.js"
click node_error_handler "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/middleware/error.middleware.js"
click node_auth_routes "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.routes.js"
click node_auth_controller "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.controller.js"
click node_auth_validation "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.validation.js"
click node_auth_service "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.service.js"
click node_user_model "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/users/user.model.js"
click node_session_model "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/session.model.js"
click node_token_helpers "https://github.com/krish-cybersec/teamsync/blob/main/backend/src/utils/token.js"
click node_workspaces "https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/workspaces"
click node_projects "https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/projects"
click node_tasks "https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/tasks"
click node_chat "https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/chat"
click node_notifications "https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/notifications"

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_web_app,node_person toneBlue
class node_server,node_app,node_configuration,node_database_connection,node_health_routes,node_health_controller,node_error_handler,node_mongo toneAmber
class node_auth_routes,node_auth_controller,node_auth_validation,node_auth_service,node_user_model,node_session_model,node_token_helpers toneMint
class node_workspaces,node_projects,node_tasks,node_chat,node_notifications toneRose
```

## Components

### Frontend starter

- [Starter screen](https://github.com/krish-cybersec/teamsync/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### Backend runtime

- [HTTP server](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/server.js): `backend/src/server.js`
- [Express app](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/app.js): `backend/src/app.js`
- [Environment config](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/config/env.js): `backend/src/config/env.js`
- [DB connection](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/database/connection.js): `backend/src/database/connection.js`
- [Health routes](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/health/health.routes.js): `backend/src/modules/health/health.routes.js`
- [Health handler](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/health/health.controller.js): `backend/src/modules/health/health.controller.js`
- [Error handler](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/middleware/error.middleware.js): `backend/src/middleware/error.middleware.js`

### Identity and users

- [Auth routes](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.routes.js): `backend/src/modules/auth/auth.routes.js`
- [Auth controller](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.controller.js): `backend/src/modules/auth/auth.controller.js`
- [Auth validation](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.validation.js): `backend/src/modules/auth/auth.validation.js`
- [Auth service](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/auth.service.js): `backend/src/modules/auth/auth.service.js`
- [User model](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/users/user.model.js): `backend/src/modules/users/user.model.js`
- [Session model](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/modules/auth/session.model.js): `backend/src/modules/auth/session.model.js`
- [JWT helpers](https://github.com/krish-cybersec/teamsync/blob/main/backend/src/utils/token.js): `backend/src/utils/token.js`

### Collaboration capabilities

- [Workspaces](https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/workspaces): `backend/src/modules/workspaces`
- [Projects](https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/projects): `backend/src/modules/projects`
- [Tasks](https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/tasks): `backend/src/modules/tasks`
- [Chat](https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/chat): `backend/src/modules/chat`
- [Notifications](https://github.com/krish-cybersec/teamsync/tree/main/backend/src/modules/notifications): `backend/src/modules/notifications`

### Other components

- **User**
- **MongoDB**

## Connections

- User → Starter screen: opens (evidence: `README.md`)
- User → Auth routes: requests auth (evidence: `README.md`)
- HTTP server → Environment config: reads config (evidence: `backend/src/server.js`)
- HTTP server → DB connection: connects database (evidence: `backend/src/server.js`)
- HTTP server → Express app: starts (evidence: `backend/src/server.js`)
- Express app → Environment config: reads config (evidence: `backend/src/app.js`)
- Express app → Health routes: mounts (evidence: `backend/src/app.js`)
- Express app → Auth routes: mounts (evidence: `backend/src/app.js`)
- Express app → Error handler: handles errors (evidence: `backend/src/app.js`)
- Health routes → Health handler: dispatches (evidence: `backend/src/modules/health/health.routes.js`)
- Auth routes → Auth controller: dispatches (evidence: `backend/src/modules/auth/auth.routes.js`)
- Auth controller → Auth validation: validates input (evidence: `backend/src/modules/auth/auth.controller.js`)
- Auth controller → Auth service: runs auth (evidence: `backend/src/modules/auth/auth.controller.js`)
- Auth service → User model: queries and saves (evidence: `backend/src/modules/auth/auth.service.js`)
- User model → MongoDB: persists records (evidence: `backend/src/modules/users/user.model.js`)
