# sandesh1664/cms architecture

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

- Interactive diagram: https://gitdiagram.com/sandesh1664/cms
- Repository: https://github.com/sandesh1664/cms

## Overview

PlayerOps CMS is a staff-facing player operations system: staff sign in, enter an authenticated dashboard, and manage player records and call activity. The sampled routes show permission checks and persistence through Prisma, including creating callback tasks within a call-log transaction. Dashboard-to-API wiring and other unsampled capabilities are not asserted because the provided excerpts do not establish those connections.

Main entry points: [`playerops-cms/src/auth.ts`](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/auth.ts) (Credential authentication), [`playerops-cms/src/lib/prisma.ts`](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/lib/prisma.ts) (Prisma client), [`playerops-cms/src/app/page.tsx`](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/page.tsx) (Dashboard gate), [`playerops-cms/src/app/api/players/route.ts`](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/players/route.ts) (Player management API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Staff access"]
  node_login_page["Sign-in page<br/>[page.tsx]"]
  node_login_form["Credential form<br/>[login-form.tsx]"]
  node_auth_config["Credential authentication<br/>[auth.ts]"]
  node_auth_route["Auth endpoints<br/>[route.ts]"]
end

subgraph group_workspace["Operations workspace"]
  node_dashboard_page["Dashboard gate<br/>[page.tsx]"]
  node_dashboard["Player operations UI"]
end

subgraph group_services["Application services"]
  node_players_api["Player management API<br/>[route.ts]"]
  node_call_api["Call logs and callbacks<br/>[route.ts]"]
end

subgraph group_data["Persistence"]
  node_prisma_client["Prisma client<br/>[prisma.ts]"]
  node_database[("PostgreSQL")]
end

node_staff(("Staff user"))

node_staff -->|"opens"| node_login_page
node_login_page -->|"renders"| node_login_form
node_auth_route -->|"exports handlers"| node_auth_config
node_dashboard_page -->|"checks session"| node_auth_config
node_dashboard_page -->|"checks staff"| node_prisma_client
node_dashboard_page -->|"renders"| node_dashboard
node_players_api -->|"checks session"| node_auth_config
node_players_api -->|"reads and writes"| node_prisma_client
node_call_api -->|"checks session"| node_auth_config
node_call_api -->|"reads and writes"| node_prisma_client
node_auth_config -->|"loads staff"| node_prisma_client
node_prisma_client -.->|"queries"| node_database

click node_login_page "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/login/page.tsx"
click node_login_form "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/login/login-form.tsx"
click node_auth_config "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/auth.ts"
click node_auth_route "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_dashboard_page "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/page.tsx"
click node_dashboard "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/dashboard-client.tsx"
click node_players_api "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/players/route.ts"
click node_call_api "https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/call-logs/route.ts"
click node_prisma_client "https://github.com/sandesh1664/cms/blob/main/playerops-cms/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_login_page,node_login_form,node_auth_config,node_auth_route,node_staff toneBlue
class node_dashboard_page,node_dashboard toneAmber
class node_players_api,node_call_api toneMint
class node_prisma_client,node_database toneRose
```

## Components

### Staff access

- [Sign-in page](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/login/page.tsx): `playerops-cms/src/app/login/page.tsx`
- [Credential form](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/login/login-form.tsx): `playerops-cms/src/app/login/login-form.tsx`
- [Credential authentication](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/auth.ts): `playerops-cms/src/auth.ts`
- [Auth endpoints](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/auth/%5B...nextauth%5D/route.ts): `playerops-cms/src/app/api/auth/[...nextauth]/route.ts`

### Operations workspace

- [Dashboard gate](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/page.tsx): `playerops-cms/src/app/page.tsx`
- [Player operations UI](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/dashboard-client.tsx): `playerops-cms/src/app/dashboard-client.tsx`

### Application services

- [Player management API](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/players/route.ts): `playerops-cms/src/app/api/players/route.ts`
- [Call logs and callbacks](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/app/api/call-logs/route.ts): `playerops-cms/src/app/api/call-logs/route.ts`

### Persistence

- [Prisma client](https://github.com/sandesh1664/cms/blob/main/playerops-cms/src/lib/prisma.ts): `playerops-cms/src/lib/prisma.ts`
- **PostgreSQL**

### Other components

- **Staff user**

## Connections

- Staff user → Sign-in page: opens (evidence: `playerops-cms/src/app/login/page.tsx`)
- Sign-in page → Credential form: renders (evidence: `playerops-cms/src/app/login/page.tsx`)
- Auth endpoints → Credential authentication: exports handlers (evidence: `playerops-cms/src/app/api/auth/[...nextauth]/route.ts`)
- Dashboard gate → Credential authentication: checks session (evidence: `playerops-cms/src/app/page.tsx`)
- Dashboard gate → Prisma client: checks staff (evidence: `playerops-cms/src/app/page.tsx`)
- Dashboard gate → Player operations UI: renders (evidence: `playerops-cms/src/app/page.tsx`)
- Player management API → Credential authentication: checks session (evidence: `playerops-cms/src/app/api/players/route.ts`)
- Player management API → Prisma client: reads and writes (evidence: `playerops-cms/src/app/api/players/route.ts`)
- Call logs and callbacks → Credential authentication: checks session (evidence: `playerops-cms/src/app/api/call-logs/route.ts`)
- Call logs and callbacks → Prisma client: reads and writes (evidence: `playerops-cms/src/app/api/call-logs/route.ts`)
- Credential authentication → Prisma client: loads staff (evidence: `playerops-cms/src/auth.ts`)
- Prisma client → PostgreSQL: queries
