# samarvishwakarma2006/bug-life architecture

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

- Interactive diagram: https://gitdiagram.com/samarvishwakarma2006/bug-life
- Repository: https://github.com/samarvishwakarma2006/bug-life

## Overview

BugLife is a real-time, multi-tenant bug tracker for collaborative teams. Users authenticate, work in projects, move bugs through a permission-checked lifecycle, and collaborate through comments, notifications, and live updates; resolving bugs can award XP and achievements. The client also provides analytics, team connections, attachments, and a public feedback landing page. The graph combines sampled calls, the source index, and documented capabilities; unsampled feature links are shown only where the README supports them.

Main entry points: [`client/src/App.tsx`](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/App.tsx) (Application routes), [`server/src/services/bugService.ts`](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/bugService.ts) (Bug lifecycle), [`server/src/config/db.ts`](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/config/db.ts) (PostgreSQL database), [`client/src/pages/Connections.tsx`](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Connections.tsx) (Connections view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_web["Application routes<br/>[App.tsx]"]
  node_authui["Authentication UI<br/>[AuthPage.tsx]"]
  node_projectsui["Projects workspace<br/>[Project.tsx]"]
  node_board["Kanban board<br/>[Board.tsx]"]
  node_bugdetail["Bug details<br/>[BugDetail.tsx]"]
  node_connectionsui["Connections view<br/>[Connections.tsx]"]
  node_feedbackui["Landing feedback<br/>[PostcardForm.tsx]"]
end

subgraph group_api["API and domain"]
  node_authroutes["Authentication routes<br/>[auth.ts]"]
  node_authcontroller["Authentication handlers<br/>[authController.ts]"]
  node_authservice["Account authentication<br/>[authService.ts]"]
  node_projectapi["Project management<br/>[projects.ts]"]
  node_projectservice["Project domain<br/>[projectService.ts]"]
  node_bugapi["Bug endpoints<br/>[bugController.ts]"]
  node_bugservice["Bug lifecycle<br/>[bugService.ts]"]
  node_database[("PostgreSQL database<br/>[db.ts]")]
  node_attachments["File attachments<br/>[attachments.ts]"]
  node_feedbackapi["Feedback endpoint<br/>[feedback.ts]"]
end

subgraph group_collaboration["Collaboration and rewards"]
  node_realtime["Live event transport<br/>[index.ts]"]
  node_notifications["Notifications"]
  node_rewards["XP and achievements<br/>[xpService.ts]"]
end

subgraph group_insights["Insights and engagement"]
  node_connectionsapi["Connections graph data"]
  node_analytics["Analytics dashboard"]
  node_leaderboard["Leaderboard<br/>[Leaderboard.tsx]"]
end

node_user(("Team member"))

node_user -->|"uses"| node_web
node_web -->|"routes to"| node_authui
node_web -->|"routes to"| node_projectsui
node_web -.->|"hosts"| node_board
node_web -->|"routes to"| node_bugdetail
node_web -->|"routes to"| node_connectionsui
node_user -->|"authenticates"| node_authroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"calls"| node_authservice
node_authservice -->|"reads and writes"| node_database
node_projectsui -.->|"manages projects"| node_projectapi
node_projectapi -->|"dispatches"| node_projectservice
node_projectservice -->|"reads and writes"| node_database
node_board -->|"moves bugs"| node_bugapi
node_bugdetail -.->|"manages bug details"| node_bugapi
node_bugapi -->|"calls"| node_bugservice
node_bugservice -->|"updates lifecycle"| node_database
node_bugservice -->|"notifies members"| node_notifications
node_bugservice -->|"awards XP"| node_rewards
node_bugservice -->|"queues events"| node_realtime
node_bugservice -.->|"supports uploads"| node_attachments
node_user -->|"submits feedback"| node_feedbackui
node_feedbackui -->|"posts feedback"| node_feedbackapi
node_connectionsui -->|"loads graph"| node_connectionsapi
node_connectionsapi -->|"queries scoped data"| node_database
node_user -.->|"views metrics"| node_analytics
node_user -.->|"views rankings"| node_leaderboard
node_realtime -->|"updates fixes"| node_connectionsui

click node_web "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/App.tsx"
click node_authui "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/AuthPage.tsx"
click node_projectsui "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Project.tsx"
click node_board "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/components/board/Board.tsx"
click node_bugdetail "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/BugDetail.tsx"
click node_connectionsui "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Connections.tsx"
click node_feedbackui "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/components/landing/PostcardForm.tsx"
click node_authroutes "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/auth.ts"
click node_authcontroller "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/controllers/authController.ts"
click node_authservice "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/authService.ts"
click node_projectapi "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/projects.ts"
click node_projectservice "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/projectService.ts"
click node_bugapi "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/controllers/bugController.ts"
click node_bugservice "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/bugService.ts"
click node_database "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/config/db.ts"
click node_attachments "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/attachments.ts"
click node_feedbackapi "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/feedback.ts"
click node_realtime "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/sockets/index.ts"
click node_notifications "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/notificationService.ts"
click node_rewards "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/xpService.ts"
click node_connectionsapi "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/connectionsService.ts"
click node_analytics "https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/dashboardService.ts"
click node_leaderboard "https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Leaderboard.tsx"

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,node_authui,node_projectsui,node_board,node_bugdetail,node_connectionsui,node_feedbackui toneBlue
class node_authroutes,node_authcontroller,node_authservice,node_projectapi,node_projectservice,node_bugapi,node_bugservice,node_database,node_attachments,node_feedbackapi toneAmber
class node_realtime,node_notifications,node_rewards toneMint
class node_connectionsapi,node_analytics,node_leaderboard toneRose
class node_user toneIndigo
```

## Components

### Web client

- [Application routes](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [Authentication UI](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/AuthPage.tsx): `client/src/pages/AuthPage.tsx`
- [Projects workspace](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Project.tsx): `client/src/pages/Project.tsx`
- [Kanban board](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/components/board/Board.tsx): `client/src/components/board/Board.tsx`
- [Bug details](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/BugDetail.tsx): `client/src/pages/BugDetail.tsx`
- [Connections view](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Connections.tsx): `client/src/pages/Connections.tsx`
- [Landing feedback](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/components/landing/PostcardForm.tsx): `client/src/components/landing/PostcardForm.tsx`

### API and domain

- [Authentication routes](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/auth.ts): `server/src/routes/auth.ts`
- [Authentication handlers](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/controllers/authController.ts): `server/src/controllers/authController.ts`
- [Account authentication](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/authService.ts): `server/src/services/authService.ts`
- [Project management](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/projects.ts): `server/src/routes/projects.ts`
- [Project domain](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/projectService.ts): `server/src/services/projectService.ts`
- [Bug endpoints](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/controllers/bugController.ts): `server/src/controllers/bugController.ts`
- [Bug lifecycle](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/bugService.ts): `server/src/services/bugService.ts`
- [PostgreSQL database](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/config/db.ts): `server/src/config/db.ts`
- [File attachments](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/attachments.ts): `server/src/routes/attachments.ts`
- [Feedback endpoint](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/routes/feedback.ts): `server/src/routes/feedback.ts`

### Collaboration and rewards

- [Live event transport](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/sockets/index.ts): `server/src/sockets/index.ts`
- [Notifications](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/notificationService.ts): `server/src/services/notificationService.ts`
- [XP and achievements](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/xpService.ts): `server/src/services/xpService.ts`

### Insights and engagement

- [Connections graph data](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/connectionsService.ts): `server/src/services/connectionsService.ts`
- [Analytics dashboard](https://github.com/samarvishwakarma2006/bug-life/blob/main/server/src/services/dashboardService.ts): `server/src/services/dashboardService.ts`
- [Leaderboard](https://github.com/samarvishwakarma2006/bug-life/blob/main/client/src/pages/Leaderboard.tsx): `client/src/pages/Leaderboard.tsx`

### Other components

- **Team member**

## Connections

- Team member → Application routes: uses (evidence: `client/src/App.tsx`)
- Application routes → Authentication UI: routes to (evidence: `client/src/App.tsx`)
- Application routes → Projects workspace: routes to (evidence: `client/src/App.tsx`)
- Application routes → Kanban board: hosts
- Application routes → Bug details: routes to (evidence: `client/src/App.tsx`)
- Application routes → Connections view: routes to (evidence: `client/src/App.tsx`)
- Team member → Authentication routes: authenticates (evidence: `README.md`)
- Authentication routes → Authentication handlers: dispatches (evidence: `server/src/routes/auth.ts`)
- Authentication handlers → Account authentication: calls (evidence: `server/src/controllers/authController.ts`)
- Account authentication → PostgreSQL database: reads and writes (evidence: `server/src/services/authService.ts`)
- Projects workspace → Project management: manages projects
- Project management → Project domain: dispatches
- Project domain → PostgreSQL database: reads and writes (evidence: `server/src/services/projectService.ts`)
- Kanban board → Bug endpoints: moves bugs (evidence: `README.md`)
- Bug details → Bug endpoints: manages bug details
- Bug endpoints → Bug lifecycle: calls (evidence: `server/src/controllers/bugController.ts`)
- Bug lifecycle → PostgreSQL database: updates lifecycle (evidence: `server/src/services/bugService.ts`)
- Bug lifecycle → Notifications: notifies members (evidence: `server/src/services/bugService.ts`)
- Bug lifecycle → XP and achievements: awards XP (evidence: `server/src/services/bugService.ts`)
- Bug lifecycle → Live event transport: queues events (evidence: `server/src/services/bugService.ts`)
- Bug lifecycle → File attachments: supports uploads
- Team member → Landing feedback: submits feedback (evidence: `README.md`)
- Landing feedback → Feedback endpoint: posts feedback (evidence: `README.md`)
- Connections view → Connections graph data: loads graph (evidence: `README.md`)
- Connections graph data → PostgreSQL database: queries scoped data (evidence: `server/src/services/connectionsService.ts`)
- Team member → Analytics dashboard: views metrics
- Team member → Leaderboard: views rankings
- Live event transport → Connections view: updates fixes (evidence: `README.md`)
