# luckydenki/gitshboard architecture

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

- Interactive diagram: https://gitdiagram.com/luckydenki/gitshboard
- Repository: https://github.com/luckydenki/gitshboard

## Overview

Gitshboard is a GitHub-connected dashboard that turns account and repository data into profile views, activity and technology analyses, project-health insights, and embeddable SVG summaries. Users browse the frontend, search public accounts or authenticate with GitHub, then request dashboard data; backend routes and controllers serve those requests, with services coordinating GitHub access and persistence. The README documents several product capabilities whose detailed frontend wiring was not sampled, so those links are shown only where supported or documented.

Main entry points: [`backend/src/app.ts`](https://github.com/luckydenki/gitshboard/blob/master/backend/src/app.ts) (REST application), [`backend/src/services/repo.services.ts`](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/repo.services.ts) (Repository analysis), [`frontend/app/routes.ts`](https://github.com/luckydenki/gitshboard/blob/master/frontend/app/routes.ts) (Application routes), [`backend/src/services/auth.services.ts`](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/auth.services.ts) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_frontend_routes["Application routes<br/>[routes.ts]"]
  node_home_search["Home and search<br/>[SearchBar.tsx]"]
  node_user_dashboard["User dashboard"]
  node_repo_dashboard["Repository dashboard<br/>[repo-dashboard.tsx]"]
  node_community["Community page<br/>[CommunityMain.tsx]"]
end

subgraph group_api["API and identity"]
  node_backend_app["REST application<br/>[app.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.ts]"]
  node_auth_controller["OAuth controller"]
  node_auth_service["Authentication service<br/>[auth.services.ts]"]
  node_auth_middleware["JWT middleware<br/>[auth.middleware.ts]"]
  node_user_routes["User routes<br/>[user.routes.ts]"]
  node_user_client["GitHub user client<br/>[user.client.ts]"]
  node_auth_client["OAuth token client<br/>[auth.client.ts]"]
end

subgraph group_analysis["GitHub analysis"]
  node_repo_routes["Repository routes<br/>[repo.routes.ts]"]
  node_repo_controller["Repository controller"]
  node_repo_service["Repository analysis<br/>[repo.services.ts]"]
  node_repo_client["GitHub repository client<br/>[repo.client.ts]"]
  node_search_routes["Search routes<br/>[search.routes.ts]"]
  node_search_service["Search service<br/>[search.services.ts]"]
  node_search_client["GitHub search client<br/>[search.client.ts]"]
  node_contrib_routes["Contribution routes"]
  node_contrib_service["Contribution analysis"]
  node_readme_routes["README image routes<br/>[readme.routes.ts]"]
  node_readme_controller["README image controller"]
  node_readme_service["SVG generation service<br/>[readme.services.ts]"]
  node_svg_renderers["SVG chart renderers"]
end

subgraph group_state["Persistence and cache"]
  node_user_repository["User repository<br/>[user.repository.ts]"]
  node_postgres[("PostgreSQL")]
  node_redis_repository["Redis repository"]
  node_redis_client["Redis client<br/>[redisClient.ts]"]
end

node_visitor(("Dashboard visitor"))
node_github{{"GitHub API"}}

node_visitor -->|"browses"| node_frontend_routes
node_frontend_routes -.->|"routes to"| node_home_search
node_frontend_routes -.->|"routes to"| node_user_dashboard
node_frontend_routes -.->|"routes to"| node_repo_dashboard
node_frontend_routes -.->|"routes to"| node_community
node_frontend_routes -->|"requests API"| node_backend_app
node_backend_app -->|"mounts"| node_auth_routes
node_backend_app -->|"mounts"| node_user_routes
node_backend_app -->|"mounts"| node_repo_routes
node_backend_app -->|"mounts"| node_search_routes
node_backend_app -->|"mounts"| node_contrib_routes
node_backend_app -->|"mounts"| node_readme_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_auth_controller -->|"calls"| node_auth_service
node_auth_service -->|"requests token"| node_auth_client
node_auth_service -->|"fetches profile"| node_user_client
node_auth_service -->|"upserts account"| node_user_repository
node_auth_service -->|"authenticates"| node_github
node_user_repository -->|"persists identity"| node_postgres
node_user_routes -->|"authenticates"| node_auth_middleware
node_user_routes -->|"fetches account data"| node_github
node_repo_routes -->|"authenticates"| node_auth_middleware
node_repo_routes -->|"dispatches"| node_repo_controller
node_repo_controller -->|"requests analyses"| node_repo_service
node_repo_service -->|"loads repository data"| node_repo_client
node_repo_client -->|"queries"| node_github
node_search_routes -->|"dispatches"| node_search_service
node_search_service -->|"searches"| node_search_client
node_search_client -->|"searches accounts"| node_github
node_contrib_routes -->|"authenticates"| node_auth_middleware
node_contrib_routes -.->|"serves contributions"| node_contrib_service
node_readme_routes -->|"dispatches"| node_readme_controller
node_readme_controller -->|"requests SVG"| node_readme_service
node_readme_service -->|"renders charts"| node_svg_renderers
node_readme_service -->|"reuses statistics"| node_repo_service
node_readme_service -->|"uses activity data"| node_contrib_service
node_repo_service -->|"reads and writes cache"| node_redis_repository
node_redis_repository -->|"operates cache"| node_redis_client
node_backend_app -->|"connects"| node_redis_client
node_repo_service -->|"analyzes GitHub data"| node_github
node_user_dashboard -.->|"shows profile insights"| node_repo_service
node_repo_dashboard -.->|"shows project insights"| node_repo_service

click node_frontend_routes "https://github.com/luckydenki/gitshboard/blob/master/frontend/app/routes.ts"
click node_home_search "https://github.com/luckydenki/gitshboard/blob/master/frontend/app/components/page/home/SearchBar.tsx"
click node_user_dashboard "https://github.com/luckydenki/gitshboard/blob/master/frontend/app/components/page/user-dashboard/UserDashboardLayout.tsx"
click node_repo_dashboard "https://github.com/luckydenki/gitshboard/blob/master/frontend/app/routes/repo-dashboard.tsx"
click node_community "https://github.com/luckydenki/gitshboard/blob/master/frontend/app/components/page/community/CommunityMain.tsx"
click node_backend_app "https://github.com/luckydenki/gitshboard/blob/master/backend/src/app.ts"
click node_auth_routes "https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/auth.routes.ts"
click node_auth_controller "https://github.com/luckydenki/gitshboard/blob/master/backend/src/controllers/auth.controllers.ts"
click node_auth_service "https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/auth.services.ts"
click node_auth_middleware "https://github.com/luckydenki/gitshboard/blob/master/backend/src/middlewares/auth.middleware.ts"
click node_user_routes "https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/user.routes.ts"
click node_repo_routes "https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/repo.routes.ts"
click node_repo_controller "https://github.com/luckydenki/gitshboard/blob/master/backend/src/controllers/repo.controllers.ts"
click node_repo_service "https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/repo.services.ts"
click node_repo_client "https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/repo.client.ts"
click node_search_routes "https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/search.routes.ts"
click node_search_service "https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/search.services.ts"
click node_search_client "https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/search.client.ts"
click node_contrib_routes "https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/contribute.routes.ts"
click node_contrib_service "https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/contribution.services.ts"
click node_readme_routes "https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/readme.routes.ts"
click node_readme_controller "https://github.com/luckydenki/gitshboard/blob/master/backend/src/controllers/readme.controllers.ts"
click node_readme_service "https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/readme.services.ts"
click node_svg_renderers "https://github.com/luckydenki/gitshboard/blob/master/backend/src/render/RenderCommitActivitySVG.tsx"
click node_user_client "https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/user.client.ts"
click node_auth_client "https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/auth.client.ts"
click node_user_repository "https://github.com/luckydenki/gitshboard/blob/master/backend/src/repository/user.repository.ts"
click node_redis_repository "https://github.com/luckydenki/gitshboard/blob/master/backend/src/repository/redis.repository.ts"
click node_redis_client "https://github.com/luckydenki/gitshboard/blob/master/backend/src/infra/redis/redisClient.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_frontend_routes,node_home_search,node_user_dashboard,node_repo_dashboard,node_community toneBlue
class node_backend_app,node_auth_routes,node_auth_controller,node_auth_service,node_auth_middleware,node_user_routes,node_user_client,node_auth_client toneAmber
class node_repo_routes,node_repo_controller,node_repo_service,node_repo_client,node_search_routes,node_search_service,node_search_client,node_contrib_routes,node_contrib_service,node_readme_routes,node_readme_controller,node_readme_service,node_svg_renderers,node_github toneMint
class node_user_repository,node_postgres,node_redis_repository,node_redis_client toneRose
class node_visitor toneIndigo
```

## Components

### Frontend experience

- [Application routes](https://github.com/luckydenki/gitshboard/blob/master/frontend/app/routes.ts): `frontend/app/routes.ts`
- [Home and search](https://github.com/luckydenki/gitshboard/blob/master/frontend/app/components/page/home/SearchBar.tsx): `frontend/app/components/page/home/SearchBar.tsx`
- [User dashboard](https://github.com/luckydenki/gitshboard/blob/master/frontend/app/components/page/user-dashboard/UserDashboardLayout.tsx): `frontend/app/components/page/user-dashboard/UserDashboardLayout.tsx`
- [Repository dashboard](https://github.com/luckydenki/gitshboard/blob/master/frontend/app/routes/repo-dashboard.tsx): `frontend/app/routes/repo-dashboard.tsx`
- [Community page](https://github.com/luckydenki/gitshboard/blob/master/frontend/app/components/page/community/CommunityMain.tsx): `frontend/app/components/page/community/CommunityMain.tsx`

### API and identity

- [REST application](https://github.com/luckydenki/gitshboard/blob/master/backend/src/app.ts): `backend/src/app.ts`
- [Authentication routes](https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/auth.routes.ts): `backend/src/routes/auth.routes.ts`
- [OAuth controller](https://github.com/luckydenki/gitshboard/blob/master/backend/src/controllers/auth.controllers.ts): `backend/src/controllers/auth.controllers.ts`
- [Authentication service](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/auth.services.ts): `backend/src/services/auth.services.ts`
- [JWT middleware](https://github.com/luckydenki/gitshboard/blob/master/backend/src/middlewares/auth.middleware.ts): `backend/src/middlewares/auth.middleware.ts`
- [User routes](https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/user.routes.ts): `backend/src/routes/user.routes.ts`
- [GitHub user client](https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/user.client.ts): `backend/src/client/user.client.ts`
- [OAuth token client](https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/auth.client.ts): `backend/src/client/auth.client.ts`

### GitHub analysis

- [Repository routes](https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/repo.routes.ts): `backend/src/routes/repo.routes.ts`
- [Repository controller](https://github.com/luckydenki/gitshboard/blob/master/backend/src/controllers/repo.controllers.ts): `backend/src/controllers/repo.controllers.ts`
- [Repository analysis](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/repo.services.ts): `backend/src/services/repo.services.ts`
- [GitHub repository client](https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/repo.client.ts): `backend/src/client/repo.client.ts`
- [Search routes](https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/search.routes.ts): `backend/src/routes/search.routes.ts`
- [Search service](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/search.services.ts): `backend/src/services/search.services.ts`
- [GitHub search client](https://github.com/luckydenki/gitshboard/blob/master/backend/src/client/search.client.ts): `backend/src/client/search.client.ts`
- [Contribution routes](https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/contribute.routes.ts): `backend/src/routes/contribute.routes.ts`
- [Contribution analysis](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/contribution.services.ts): `backend/src/services/contribution.services.ts`
- [README image routes](https://github.com/luckydenki/gitshboard/blob/master/backend/src/routes/readme.routes.ts): `backend/src/routes/readme.routes.ts`
- [README image controller](https://github.com/luckydenki/gitshboard/blob/master/backend/src/controllers/readme.controllers.ts): `backend/src/controllers/readme.controllers.ts`
- [SVG generation service](https://github.com/luckydenki/gitshboard/blob/master/backend/src/services/readme.services.ts): `backend/src/services/readme.services.ts`
- [SVG chart renderers](https://github.com/luckydenki/gitshboard/blob/master/backend/src/render/RenderCommitActivitySVG.tsx): `backend/src/render/RenderCommitActivitySVG.tsx`

### Persistence and cache

- [User repository](https://github.com/luckydenki/gitshboard/blob/master/backend/src/repository/user.repository.ts): `backend/src/repository/user.repository.ts`
- **PostgreSQL**
- [Redis repository](https://github.com/luckydenki/gitshboard/blob/master/backend/src/repository/redis.repository.ts): `backend/src/repository/redis.repository.ts`
- [Redis client](https://github.com/luckydenki/gitshboard/blob/master/backend/src/infra/redis/redisClient.ts): `backend/src/infra/redis/redisClient.ts`

### Other components

- **Dashboard visitor**
- **GitHub API**

## Connections

- Dashboard visitor → Application routes: browses
- Application routes → Home and search: routes to
- Application routes → User dashboard: routes to
- Application routes → Repository dashboard: routes to
- Application routes → Community page: routes to
- Application routes → REST application: requests API
- REST application → Authentication routes: mounts (evidence: `backend/src/app.ts`)
- REST application → User routes: mounts (evidence: `backend/src/app.ts`)
- REST application → Repository routes: mounts (evidence: `backend/src/app.ts`)
- REST application → Search routes: mounts (evidence: `backend/src/app.ts`)
- REST application → Contribution routes: mounts (evidence: `backend/src/app.ts`)
- REST application → README image routes: mounts (evidence: `backend/src/app.ts`)
- Authentication routes → OAuth controller: dispatches (evidence: `backend/src/routes/auth.routes.ts`)
- OAuth controller → Authentication service: calls (evidence: `backend/src/controllers/auth.controllers.ts`)
- Authentication service → OAuth token client: requests token (evidence: `backend/src/services/auth.services.ts`)
- Authentication service → GitHub user client: fetches profile (evidence: `backend/src/services/auth.services.ts`)
- Authentication service → User repository: upserts account (evidence: `backend/src/services/auth.services.ts`)
- Authentication service → GitHub API: authenticates
- User repository → PostgreSQL: persists identity
- User routes → JWT middleware: authenticates (evidence: `backend/src/routes/user.routes.ts`)
- User routes → GitHub API: fetches account data (evidence: `backend/src/routes/user.routes.ts`)
- Repository routes → JWT middleware: authenticates (evidence: `backend/src/routes/repo.routes.ts`)
- Repository routes → Repository controller: dispatches (evidence: `backend/src/routes/repo.routes.ts`)
- Repository controller → Repository analysis: requests analyses (evidence: `backend/src/controllers/repo.controllers.ts`)
- Repository analysis → GitHub repository client: loads repository data (evidence: `backend/src/services/repo.services.ts`)
- GitHub repository client → GitHub API: queries
- Search routes → Search service: dispatches (evidence: `backend/src/routes/search.routes.ts`)
- Search service → GitHub search client: searches (evidence: `backend/src/services/search.services.ts`)
- GitHub search client → GitHub API: searches accounts (evidence: `backend/src/client/search.client.ts`)
- Contribution routes → JWT middleware: authenticates (evidence: `backend/src/routes/contribute.routes.ts`)
- Contribution routes → Contribution analysis: serves contributions
- README image routes → README image controller: dispatches (evidence: `backend/src/routes/readme.routes.ts`)
- README image controller → SVG generation service: requests SVG (evidence: `backend/src/controllers/readme.controllers.ts`)
- SVG generation service → SVG chart renderers: renders charts (evidence: `backend/src/services/readme.services.ts`)
- SVG generation service → Repository analysis: reuses statistics (evidence: `backend/src/services/readme.services.ts`)
- SVG generation service → Contribution analysis: uses activity data (evidence: `backend/src/services/readme.services.ts`)
- Repository analysis → Redis repository: reads and writes cache (evidence: `backend/src/services/repo.services.ts`)
- Redis repository → Redis client: operates cache (evidence: `backend/src/repository/redis.repository.ts`)
- REST application → Redis client: connects (evidence: `backend/src/app.ts`)
- Repository analysis → GitHub API: analyzes GitHub data
- User dashboard → Repository analysis: shows profile insights
- Repository dashboard → Repository analysis: shows project insights
