# aakarsh-2004/flowlens architecture

> Architecture diagram of the GitHub repository aakarsh-2004/flowlens, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aakarsh-2004/flowlens
- Repository: https://github.com/aakarsh-2004/flowlens

## Overview

FlowLens is a project-delivery dashboard backed by an Express API and PostgreSQL. Team members and admins sign in, manage organizations and projects, enter simulated Jira/GitHub/Calendar/Meet records, link related work, and manually sync to refresh delivery metrics, snapshots, and alerts shown in the dashboard. The graph preserves those distinct domain stages and the API’s service, authorization, and persistence layers. Provider integrations are simulated on the app database; live provider APIs are future work. Some subsystem details are represented by their exact source directories because their implementation was not excerpted.

Main entry points: [`api/src/lib/prisma.ts`](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/lib/prisma.ts) (Prisma database client), [`api/src/app.ts`](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/app.ts) (Express API), [`api/src/modules/auth/auth.service.ts`](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.service.ts) (Authentication service), [`api/src/modules/workspace/workspace.routes.ts`](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/workspace.routes.ts) (Workspace routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["React dashboard<br/>[App.tsx]"]
  node_api_client["HTTP client<br/>[api.ts]"]
end

subgraph group_identity["Identity"]
  node_api_app["Express API<br/>[app.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.route.ts]"]
  node_auth_controller["Authentication controller<br/>[auth.controller.ts]"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_auth_repository["Account repository<br/>[auth.repository.ts]"]
  node_auth_middleware["Token authentication<br/>[auth.ts]"]
  node_jwt["JWT utilities<br/>[jwt.ts]"]
end

subgraph group_planning["Organizations &amp; Projects"]
  node_organization_routes["Organization routes"]
  node_organization_service["Organization service"]
  node_organization_repository["Organization repository"]
  node_project_routes["Project routes<br/>[projects.routes.ts]"]
  node_project_controller["Project controller"]
  node_project_service["Project service"]
  node_project_repository["Project repository"]
end

subgraph group_delivery["Workspace &amp; Reporting"]
  node_workspace_routes["Workspace routes"]
  node_workspace_service["Workspace service"]
  node_metrics["Delivery metrics<br/>[metrics.ts]"]
end

subgraph group_persistence["Persistence"]
  node_postgres[("PostgreSQL database")]
  node_prisma["Prisma database client<br/>[prisma.ts]"]
end

node_member(("Team member / admin"))

node_member -->|"uses"| node_dashboard_ui
node_dashboard_ui -->|"calls"| node_api_client
node_api_client -->|"sends JSON"| node_api_app
node_api_app -->|"mounts"| node_auth_routes
node_api_app -->|"mounts"| node_organization_routes
node_api_app -->|"mounts"| node_project_routes
node_api_app -->|"mounts"| node_workspace_routes
node_auth_routes -->|"routes to"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"calls"| node_auth_repository
node_auth_service -->|"signs tokens"| node_jwt
node_auth_middleware -->|"verifies token"| node_jwt
node_organization_routes -->|"dispatches"| node_organization_service
node_organization_service -->|"calls"| node_organization_repository
node_project_routes -->|"routes to"| node_project_controller
node_project_controller -->|"calls"| node_project_service
node_project_service -->|"calls"| node_project_repository
node_workspace_routes -->|"dispatches"| node_workspace_service
node_workspace_service -->|"calculates"| node_metrics
node_auth_repository -->|"queries"| node_prisma
node_organization_repository -->|"queries"| node_prisma
node_project_repository -->|"queries"| node_prisma
node_workspace_service -->|"reads/writes"| node_prisma
node_workspace_routes -->|"reads/writes"| node_prisma
node_prisma -->|"queries"| node_postgres

click node_dashboard_ui "https://github.com/aakarsh-2004/flowlens/blob/main/client/src/App.tsx"
click node_api_client "https://github.com/aakarsh-2004/flowlens/blob/main/client/src/lib/api.ts"
click node_api_app "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/app.ts"
click node_auth_routes "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.route.ts"
click node_auth_controller "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.controller.ts"
click node_auth_service "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.service.ts"
click node_auth_repository "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.repository.ts"
click node_auth_middleware "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/middlewares/auth.ts"
click node_jwt "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/lib/jwt.ts"
click node_organization_routes "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/organizations/organizations.routes.ts"
click node_organization_service "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/organizations/organizations.service.ts"
click node_organization_repository "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/organizations/organizations.repository.ts"
click node_project_routes "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.routes.ts"
click node_project_controller "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.controller.ts"
click node_project_service "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.service.ts"
click node_project_repository "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.repository.ts"
click node_workspace_routes "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/workspace.routes.ts"
click node_workspace_service "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/workspace.service.ts"
click node_metrics "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/metrics.ts"
click node_prisma "https://github.com/aakarsh-2004/flowlens/blob/main/api/src/lib/prisma.ts"

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_dashboard_ui,node_api_client toneBlue
class node_api_app,node_auth_routes,node_auth_controller,node_auth_service,node_auth_repository,node_auth_middleware,node_jwt toneAmber
class node_organization_routes,node_organization_service,node_organization_repository,node_project_routes,node_project_controller,node_project_service,node_project_repository toneMint
class node_workspace_routes,node_workspace_service,node_metrics toneRose
class node_postgres,node_prisma,node_member toneIndigo
```

## Components

### Dashboard

- [React dashboard](https://github.com/aakarsh-2004/flowlens/blob/main/client/src/App.tsx): `client/src/App.tsx`
- [HTTP client](https://github.com/aakarsh-2004/flowlens/blob/main/client/src/lib/api.ts): `client/src/lib/api.ts`

### Identity

- [Express API](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/app.ts): `api/src/app.ts`
- [Authentication routes](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.route.ts): `api/src/modules/auth/auth.route.ts`
- [Authentication controller](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.controller.ts): `api/src/modules/auth/auth.controller.ts`
- [Authentication service](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.service.ts): `api/src/modules/auth/auth.service.ts`
- [Account repository](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/auth/auth.repository.ts): `api/src/modules/auth/auth.repository.ts`
- [Token authentication](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/middlewares/auth.ts): `api/src/middlewares/auth.ts`
- [JWT utilities](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/lib/jwt.ts): `api/src/lib/jwt.ts`

### Organizations & Projects

- [Organization routes](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/organizations/organizations.routes.ts): `api/src/modules/organizations/organizations.routes.ts`
- [Organization service](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/organizations/organizations.service.ts): `api/src/modules/organizations/organizations.service.ts`
- [Organization repository](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/organizations/organizations.repository.ts): `api/src/modules/organizations/organizations.repository.ts`
- [Project routes](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.routes.ts): `api/src/modules/projects/projects.routes.ts`
- [Project controller](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.controller.ts): `api/src/modules/projects/projects.controller.ts`
- [Project service](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.service.ts): `api/src/modules/projects/projects.service.ts`
- [Project repository](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/projects/projects.repository.ts): `api/src/modules/projects/projects.repository.ts`

### Workspace & Reporting

- [Workspace routes](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/workspace.routes.ts): `api/src/modules/workspace/workspace.routes.ts`
- [Workspace service](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/workspace.service.ts): `api/src/modules/workspace/workspace.service.ts`
- [Delivery metrics](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/modules/workspace/metrics.ts): `api/src/modules/workspace/metrics.ts`

### Persistence

- **PostgreSQL database**
- [Prisma database client](https://github.com/aakarsh-2004/flowlens/blob/main/api/src/lib/prisma.ts): `api/src/lib/prisma.ts`

### Other components

- **Team member / admin**

## Connections

- Team member / admin → React dashboard: uses
- React dashboard → HTTP client: calls (evidence: `client/src/App.tsx`)
- HTTP client → Express API: sends JSON
- Express API → Authentication routes: mounts (evidence: `api/src/app.ts`)
- Express API → Organization routes: mounts (evidence: `api/src/app.ts`)
- Express API → Project routes: mounts (evidence: `api/src/app.ts`)
- Express API → Workspace routes: mounts (evidence: `api/src/app.ts`)
- Authentication routes → Authentication controller: routes to (evidence: `api/src/modules/auth/auth.route.ts`)
- Authentication controller → Authentication service: calls (evidence: `api/src/modules/auth/auth.controller.ts`)
- Authentication service → Account repository: calls (evidence: `api/src/modules/auth/auth.service.ts`)
- Authentication service → JWT utilities: signs tokens (evidence: `api/src/modules/auth/auth.service.ts`)
- Token authentication → JWT utilities: verifies token (evidence: `api/src/middlewares/auth.ts`)
- Organization routes → Organization service: dispatches (evidence: `api/src/modules/organizations/organizations.routes.ts`)
- Organization service → Organization repository: calls (evidence: `api/src/modules/organizations/organizations.service.ts`)
- Project routes → Project controller: routes to (evidence: `api/src/modules/projects/projects.routes.ts`)
- Project controller → Project service: calls (evidence: `api/src/modules/projects/projects.controller.ts`)
- Project service → Project repository: calls (evidence: `api/src/modules/projects/projects.service.ts`)
- Workspace routes → Workspace service: dispatches (evidence: `api/src/modules/workspace/workspace.routes.ts`)
- Workspace service → Delivery metrics: calculates (evidence: `api/src/modules/workspace/workspace.service.ts`)
- Account repository → Prisma database client: queries (evidence: `api/src/modules/auth/auth.repository.ts`)
- Organization repository → Prisma database client: queries (evidence: `api/src/modules/organizations/organizations.repository.ts`)
- Project repository → Prisma database client: queries (evidence: `api/src/modules/projects/projects.repository.ts`)
- Workspace service → Prisma database client: reads/writes (evidence: `api/src/modules/workspace/workspace.service.ts`)
- Workspace routes → Prisma database client: reads/writes (evidence: `api/src/modules/workspace/workspace.routes.ts`)
- Prisma database client → PostgreSQL database: queries (evidence: `api/src/lib/prisma.ts`)
