# deepkumar7106/repolog architecture

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

- Interactive diagram: https://gitdiagram.com/deepkumar7106/repolog
- Repository: https://github.com/deepkumar7106/repolog

## Overview

RepoLog is a multi-tenant GitHub portfolio and development-timeline application. The main user journey is GitHub sign-in, onboarding, repository discovery and selection, historical commit backfill, then project/profile management; public profile and activity endpoints form a presentation branch. Tenant identity is derived from server-side sessions, and service-layer queries are user-scoped. The graph includes documented capabilities and core modules, but several route and service implementations were not sampled, so their internal call edges are left unverified or omitted.

Main entry points: [`src/app/api/auth/github/callback/route.ts`](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/auth/github/callback/route.ts) (GitHub OAuth), [`src/app/api/user/repositories/route.ts`](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/repositories/route.ts) (Repository API), [`src/server/services/repository-sync-service.ts`](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/repository-sync-service.ts) (Commit Backfill), [`src/lib/db/prisma.ts`](https://github.com/deepkumar7106/repolog/blob/main/src/lib/db/prisma.ts) (PostgreSQL)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Tenancy"]
  node_oauth["GitHub OAuth<br/>[route.ts]"]
  node_github_auth["GitHub Auth<br/>[github.ts]"]
  node_account["Identity Upsert<br/>[github-account.ts]"]
  node_session["Sessions<br/>[session.ts]"]
  node_session_store[("Session Store<br/>[session-store.ts]")]
  node_tenant["Tenant Context<br/>[tenant-context.ts]"]
  node_onboarding["Onboarding API<br/>[route.ts]"]
end

subgraph group_repositories["Repository Workflow"]
  node_discovery["Repository Discovery"]
  node_repository_api["Repository API<br/>[route.ts]"]
  node_repository_service["Repository Selection"]
  node_github_repos["GitHub Repositories<br/>[repositories.ts]"]
  node_sync_api["Sync Endpoints<br/>[route.ts]"]
  node_sync_service["Commit Backfill"]
  node_commit_client["Commit Client<br/>[commits.ts]"]
  node_author_match["Author Matching<br/>[author-matching.ts]"]
  node_sync_runs["Sync Run Service"]
end

subgraph group_projects["Projects and Profiles"]
  node_projects_api["Projects API<br/>[route.ts]"]
  node_project_service["Project Management<br/>[project-service.ts]"]
  node_profile_api["Profile API<br/>[route.ts]"]
  node_profile_service["Profile Service"]
  node_emails_api["Author Emails API<br/>[route.ts]"]
  node_email_service["Author Email Service"]
end

subgraph group_public["Public Experience"]
  node_public_pages["Public Profile Pages<br/>[page.tsx]"]
  node_public_api["Public Profile API"]
  node_activity_api["Activity API<br/>[route.ts]"]
end

subgraph group_platform["API and Data Layer"]
  node_database[("PostgreSQL<br/>[prisma.ts]")]
  node_dto["Repository DTO"]
end

node_visitor(("Visitor"))
node_github{{"GitHub"}}

node_visitor -->|"starts sign-in"| node_oauth
node_oauth -->|"exchanges code"| node_github_auth
node_oauth -->|"upserts identity"| node_account
node_oauth -->|"creates session"| node_session
node_session -->|"reads and writes"| node_session_store
node_session -->|"creates tenant"| node_tenant
node_visitor -->|"completes setup"| node_onboarding
node_onboarding -->|"requires tenant"| node_tenant
node_visitor -->|"selects repositories"| node_repository_api
node_repository_api -.->|"updates selection"| node_repository_service
node_repository_api -->|"ensures projects"| node_project_service
node_repository_api -->|"maps response"| node_dto
node_discovery -.->|"lists repositories"| node_github_repos
node_visitor -->|"requests sync"| node_sync_api
node_sync_api -.->|"starts backfill"| node_sync_service
node_sync_service -->|"lists commit pages"| node_commit_client
node_sync_service -->|"matches authors"| node_author_match
node_sync_service -->|"stores commits and activity"| node_database
node_visitor -->|"manages projects"| node_projects_api
node_projects_api -->|"ensures project"| node_project_service
node_visitor -->|"edits profile"| node_profile_api
node_profile_api -.->|"updates profile"| node_profile_service
node_visitor -->|"manages author emails"| node_emails_api
node_emails_api -.->|"adds email"| node_email_service
node_visitor -->|"views profile"| node_public_pages
node_public_pages -.->|"loads profile data"| node_public_api
node_visitor -.->|"requests activity"| node_activity_api
node_repository_service -->|"queries tenant data"| node_database
node_project_service -->|"queries projects"| node_database
node_email_service -->|"queries tenant emails"| node_database

click node_oauth "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/auth/github/callback/route.ts"
click node_github_auth "https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/github.ts"
click node_account "https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/github-account.ts"
click node_session "https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/session.ts"
click node_session_store "https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/session-store.ts"
click node_tenant "https://github.com/deepkumar7106/repolog/blob/main/src/lib/tenancy/tenant-context.ts"
click node_onboarding "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/onboarding/route.ts"
click node_discovery "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/repository-discovery-service.ts"
click node_repository_api "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/repositories/route.ts"
click node_repository_service "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/user-repository-service.ts"
click node_github_repos "https://github.com/deepkumar7106/repolog/blob/main/src/lib/github/repositories.ts"
click node_sync_api "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/repositories/%5Bid%5D/sync/route.ts"
click node_sync_service "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/repository-sync-service.ts"
click node_commit_client "https://github.com/deepkumar7106/repolog/blob/main/src/lib/github/commits.ts"
click node_author_match "https://github.com/deepkumar7106/repolog/blob/main/src/lib/github/author-matching.ts"
click node_sync_runs "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/sync-run-service.ts"
click node_projects_api "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/projects/route.ts"
click node_project_service "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/project-service.ts"
click node_profile_api "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/profile/route.ts"
click node_profile_service "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/user-profile-service.ts"
click node_emails_api "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/author-emails/route.ts"
click node_email_service "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/author-email-service.ts"
click node_public_pages "https://github.com/deepkumar7106/repolog/blob/main/src/app/(public)/u/%5Busername%5D/page.tsx"
click node_public_api "https://github.com/deepkumar7106/repolog/blob/main/src/server/services/public-profile-service.ts"
click node_activity_api "https://github.com/deepkumar7106/repolog/blob/main/src/app/api/public/users/%5Busername%5D/activity/route.ts"
click node_database "https://github.com/deepkumar7106/repolog/blob/main/src/lib/db/prisma.ts"
click node_dto "https://github.com/deepkumar7106/repolog/blob/main/src/server/dto/user-repository-dto.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_oauth,node_github_auth,node_account,node_session,node_session_store,node_tenant,node_onboarding toneBlue
class node_discovery,node_repository_api,node_repository_service,node_github_repos,node_sync_api,node_sync_service,node_commit_client,node_author_match,node_sync_runs toneAmber
class node_projects_api,node_project_service,node_profile_api,node_profile_service,node_emails_api,node_email_service toneMint
class node_public_pages,node_public_api,node_activity_api toneRose
class node_database,node_dto,node_visitor,node_github toneIndigo
```

## Components

### Access and Tenancy

- [GitHub OAuth](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/auth/github/callback/route.ts): `src/app/api/auth/github/callback/route.ts`
- [GitHub Auth](https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/github.ts): `src/lib/auth/github.ts`
- [Identity Upsert](https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/github-account.ts): `src/lib/auth/github-account.ts`
- [Sessions](https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/session.ts): `src/lib/auth/session.ts`
- [Session Store](https://github.com/deepkumar7106/repolog/blob/main/src/lib/auth/session-store.ts): `src/lib/auth/session-store.ts`
- [Tenant Context](https://github.com/deepkumar7106/repolog/blob/main/src/lib/tenancy/tenant-context.ts): `src/lib/tenancy/tenant-context.ts`
- [Onboarding API](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/onboarding/route.ts): `src/app/api/onboarding/route.ts`

### Repository Workflow

- [Repository Discovery](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/repository-discovery-service.ts): `src/server/services/repository-discovery-service.ts`
- [Repository API](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/repositories/route.ts): `src/app/api/user/repositories/route.ts`
- [Repository Selection](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/user-repository-service.ts): `src/server/services/user-repository-service.ts`
- [GitHub Repositories](https://github.com/deepkumar7106/repolog/blob/main/src/lib/github/repositories.ts): `src/lib/github/repositories.ts`
- [Sync Endpoints](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/repositories/%5Bid%5D/sync/route.ts): `src/app/api/user/repositories/[id]/sync/route.ts`
- [Commit Backfill](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/repository-sync-service.ts): `src/server/services/repository-sync-service.ts`
- [Commit Client](https://github.com/deepkumar7106/repolog/blob/main/src/lib/github/commits.ts): `src/lib/github/commits.ts`
- [Author Matching](https://github.com/deepkumar7106/repolog/blob/main/src/lib/github/author-matching.ts): `src/lib/github/author-matching.ts`
- [Sync Run Service](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/sync-run-service.ts): `src/server/services/sync-run-service.ts`

### Projects and Profiles

- [Projects API](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/projects/route.ts): `src/app/api/user/projects/route.ts`
- [Project Management](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/project-service.ts): `src/server/services/project-service.ts`
- [Profile API](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/profile/route.ts): `src/app/api/user/profile/route.ts`
- [Profile Service](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/user-profile-service.ts): `src/server/services/user-profile-service.ts`
- [Author Emails API](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/user/author-emails/route.ts): `src/app/api/user/author-emails/route.ts`
- [Author Email Service](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/author-email-service.ts): `src/server/services/author-email-service.ts`

### Public Experience

- [Public Profile Pages](https://github.com/deepkumar7106/repolog/blob/main/src/app/(public)/u/%5Busername%5D/page.tsx): `src/app/(public)/u/[username]/page.tsx`
- [Public Profile API](https://github.com/deepkumar7106/repolog/blob/main/src/server/services/public-profile-service.ts): `src/server/services/public-profile-service.ts`
- [Activity API](https://github.com/deepkumar7106/repolog/blob/main/src/app/api/public/users/%5Busername%5D/activity/route.ts): `src/app/api/public/users/[username]/activity/route.ts`

### API and Data Layer

- [PostgreSQL](https://github.com/deepkumar7106/repolog/blob/main/src/lib/db/prisma.ts): `src/lib/db/prisma.ts`
- [Repository DTO](https://github.com/deepkumar7106/repolog/blob/main/src/server/dto/user-repository-dto.ts): `src/server/dto/user-repository-dto.ts`

### Other components

- **Visitor**
- **GitHub**

## Connections

- Visitor → GitHub OAuth: starts sign-in (evidence: `README.md`)
- GitHub OAuth → GitHub Auth: exchanges code (evidence: `src/app/api/auth/github/callback/route.ts`)
- GitHub OAuth → Identity Upsert: upserts identity (evidence: `src/app/api/auth/github/callback/route.ts`)
- GitHub OAuth → Sessions: creates session (evidence: `src/app/api/auth/github/callback/route.ts`)
- Sessions → Session Store: reads and writes (evidence: `src/lib/auth/session.ts`)
- Sessions → Tenant Context: creates tenant (evidence: `src/lib/auth/session.ts`)
- Visitor → Onboarding API: completes setup (evidence: `README.md`)
- Onboarding API → Tenant Context: requires tenant (evidence: `src/app/api/onboarding/route.ts`)
- Visitor → Repository API: selects repositories (evidence: `README.md`)
- Repository API → Repository Selection: updates selection
- Repository API → Project Management: ensures projects (evidence: `src/app/api/user/repositories/route.ts`)
- Repository API → Repository DTO: maps response (evidence: `src/app/api/user/repositories/route.ts`)
- Repository Discovery → GitHub Repositories: lists repositories
- Visitor → Sync Endpoints: requests sync (evidence: `README.md`)
- Sync Endpoints → Commit Backfill: starts backfill
- Commit Backfill → Commit Client: lists commit pages (evidence: `src/server/services/repository-sync-service.ts`)
- Commit Backfill → Author Matching: matches authors (evidence: `src/server/services/repository-sync-service.ts`)
- Commit Backfill → PostgreSQL: stores commits and activity (evidence: `src/server/services/repository-sync-service.ts`)
- Visitor → Projects API: manages projects (evidence: `README.md`)
- Projects API → Project Management: ensures project (evidence: `src/app/api/user/projects/route.ts`)
- Visitor → Profile API: edits profile (evidence: `README.md`)
- Profile API → Profile Service: updates profile
- Visitor → Author Emails API: manages author emails (evidence: `README.md`)
- Author Emails API → Author Email Service: adds email
- Visitor → Public Profile Pages: views profile (evidence: `README.md`)
- Public Profile Pages → Public Profile API: loads profile data
- Visitor → Activity API: requests activity
- Repository Selection → PostgreSQL: queries tenant data (evidence: `src/server/services/user-repository-service.ts`)
- Project Management → PostgreSQL: queries projects (evidence: `src/server/services/project-service.ts`)
- Author Email Service → PostgreSQL: queries tenant emails (evidence: `src/server/services/author-email-service.ts`)
