# enpassant-chess-forum-abesec/en-passant-client architecture

> Architecture diagram of the GitHub repository enpassant-chess-forum-abesec/en-passant-client, 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/enpassant-chess-forum-abesec/en-passant-client
- Repository: https://github.com/enpassant-chess-forum-abesec/en-passant-client

## Overview

En-Passant is a Next.js frontend for a chess club, combining public club content with account, recruitment, and administrative workflows. The principal user journey is authentication, recruitment application, task selection and submission; administrators manage applications, tasks, departments, users, and payments. Pages use a shared API helper for backend requests, which attaches Clerk tokens. Public event, leaderboard, and profile capabilities are also represented. Several routes and admin panels were not sampled, so their internal calls are shown only where the README or SOURCE INDEX supports them.

Main entry points: [`src/lib/api.js`](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/lib/api.js) (Authenticated API helper), [`src/app/admin/page.js`](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/admin/page.js) (Admin dashboard), [`src/app/auth/sign-in/[[...sign-in]]/page.js`](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/auth/sign-in/%5B%5B...sign-in%5D%5D/page.js) (Sign-in and signup), [`src/app/profile/page.js`](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/profile/page.js) (Account profile)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_public["Public site"]
  node_home["Club homepage<br/>[page.js]"]
  node_contact["Contact form<br/>[page.js]"]
  node_events["Event gallery<br/>[page.js]"]
  node_leaderboard["Chess leaderboard<br/>[page.js]"]
end

subgraph group_identity["Identity and profiles"]
  node_signin["Sign-in and signup<br/>[page.js]"]
  node_clerk["Clerk identity"]
  node_profile["Account profile<br/>[page.js]"]
  node_publicprofile["Public user profile<br/>[page.js]"]
end

subgraph group_recruit["Recruitment"]
  node_application["Recruitment application<br/>[page.js]"]
  node_recruitdash["Applicant dashboard<br/>[page.js]"]
  node_tasks["Task selection<br/>[page.js]"]
  node_submission["Task submission UI"]
end

subgraph group_admin["Administration"]
  node_adminhome["Admin dashboard<br/>[page.js]"]
  node_adminapps["Application management<br/>[ApplicationsTab.js]"]
  node_admintasks["Task management<br/>[TasksTab.js]"]
  node_adminreview["Submission review"]
  node_adminother["Other admin tools"]
end

subgraph group_shared["API and shared services"]
  node_api["Authenticated API helper<br/>[api.js]"]
  node_appearance["Clerk appearance<br/>[clerkAppearance.js]"]
end

node_visitor(("Visitor"))
node_backend["En-Passant backend"]

node_visitor -->|"visits"| node_home
node_visitor -->|"inquires"| node_contact
node_visitor -->|"views events"| node_events
node_visitor -->|"views rankings"| node_leaderboard
node_visitor -->|"authenticates"| node_signin
node_signin -->|"uses identity"| node_clerk
node_profile -->|"uses session"| node_clerk
node_profile -->|"requests profile data"| node_api
node_publicprofile -->|"requests profile data"| node_api
node_leaderboard -->|"fetches rankings"| node_api
node_contact -->|"sends inquiry"| node_api
node_visitor -->|"applies"| node_application
node_application -->|"submits application"| node_api
node_recruitdash -->|"loads application status"| node_api
node_visitor -->|"selects tasks"| node_tasks
node_tasks -->|"loads task data"| node_api
node_submission -->|"submits task"| node_api
node_adminhome -->|"loads admin data"| node_api
node_adminhome -.->|"presents applications"| node_adminapps
node_adminhome -.->|"presents tasks"| node_admintasks
node_adminapps -.->|"opens review"| node_adminreview
node_admintasks -->|"manages tasks"| node_api
node_adminreview -->|"loads submission details"| node_api
node_visitor -->|"administers"| node_adminhome
node_adminhome -.->|"routes to admin tools"| node_adminother
node_api -->|"gets session token"| node_clerk
node_api -->|"sends API requests"| node_backend
node_signin -.->|"styles Clerk UI"| node_appearance

click node_home "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/page.js"
click node_contact "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/contact/page.js"
click node_events "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/event-gallery/page.js"
click node_leaderboard "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/leaderboard/page.js"
click node_signin "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/auth/sign-in/%5B%5B...sign-in%5D%5D/page.js"
click node_profile "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/profile/page.js"
click node_publicprofile "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/u/%5BuserName%5D/page.js"
click node_application "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/recruitment/apply/page.js"
click node_recruitdash "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/recruitment/dashboard/page.js"
click node_tasks "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/tasks/page.js"
click node_submission "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/TaskSubmissionModal.jsx"
click node_adminhome "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/admin/page.js"
click node_adminapps "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/admin/ApplicationsTab.js"
click node_admintasks "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/admin/TasksTab.js"
click node_adminreview "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/admin/SubmissionReviewDrawer.js"
click node_adminother "https://github.com/enpassant-chess-forum-abesec/en-passant-client/tree/main/src/app/admin"
click node_api "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/lib/api.js"
click node_appearance "https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/lib/clerkAppearance.js"

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_home,node_contact,node_events,node_leaderboard toneBlue
class node_signin,node_clerk,node_profile,node_publicprofile toneAmber
class node_application,node_recruitdash,node_tasks,node_submission toneMint
class node_adminhome,node_adminapps,node_admintasks,node_adminreview,node_adminother toneRose
class node_api,node_appearance,node_visitor,node_backend toneIndigo
```

## Components

### Public site

- [Club homepage](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/page.js): `src/app/page.js`
- [Contact form](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/contact/page.js): `src/app/contact/page.js`
- [Event gallery](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/event-gallery/page.js): `src/app/event-gallery/page.js`
- [Chess leaderboard](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/leaderboard/page.js): `src/app/leaderboard/page.js`

### Identity and profiles

- [Sign-in and signup](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/auth/sign-in/%5B%5B...sign-in%5D%5D/page.js): `src/app/auth/sign-in/[[...sign-in]]/page.js`
- **Clerk identity**
- [Account profile](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/profile/page.js): `src/app/profile/page.js`
- [Public user profile](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/u/%5BuserName%5D/page.js): `src/app/u/[userName]/page.js`

### Recruitment

- [Recruitment application](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/recruitment/apply/page.js): `src/app/recruitment/apply/page.js`
- [Applicant dashboard](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/recruitment/dashboard/page.js): `src/app/recruitment/dashboard/page.js`
- [Task selection](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/tasks/page.js): `src/app/tasks/page.js`
- [Task submission UI](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/TaskSubmissionModal.jsx): `src/components/TaskSubmissionModal.jsx`

### Administration

- [Admin dashboard](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/app/admin/page.js): `src/app/admin/page.js`
- [Application management](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/admin/ApplicationsTab.js): `src/components/admin/ApplicationsTab.js`
- [Task management](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/admin/TasksTab.js): `src/components/admin/TasksTab.js`
- [Submission review](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/components/admin/SubmissionReviewDrawer.js): `src/components/admin/SubmissionReviewDrawer.js`
- [Other admin tools](https://github.com/enpassant-chess-forum-abesec/en-passant-client/tree/main/src/app/admin): `src/app/admin`

### API and shared services

- [Authenticated API helper](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/lib/api.js): `src/lib/api.js`
- [Clerk appearance](https://github.com/enpassant-chess-forum-abesec/en-passant-client/blob/main/src/lib/clerkAppearance.js): `src/lib/clerkAppearance.js`

### Other components

- **Visitor**
- **En-Passant backend**

## Connections

- Visitor → Club homepage: visits (evidence: `README.md`)
- Visitor → Contact form: inquires (evidence: `README.md`)
- Visitor → Event gallery: views events (evidence: `README.md`)
- Visitor → Chess leaderboard: views rankings (evidence: `README.md`)
- Visitor → Sign-in and signup: authenticates (evidence: `README.md`)
- Sign-in and signup → Clerk identity: uses identity (evidence: `README.md`)
- Account profile → Clerk identity: uses session (evidence: `README.md`)
- Account profile → Authenticated API helper: requests profile data (evidence: `src/app/profile/page.js`)
- Public user profile → Authenticated API helper: requests profile data (evidence: `src/app/u/[userName]/page.js`)
- Chess leaderboard → Authenticated API helper: fetches rankings (evidence: `src/app/leaderboard/page.js`)
- Contact form → Authenticated API helper: sends inquiry (evidence: `src/app/contact/page.js`)
- Visitor → Recruitment application: applies (evidence: `README.md`)
- Recruitment application → Authenticated API helper: submits application (evidence: `src/app/recruitment/apply/page.js`)
- Applicant dashboard → Authenticated API helper: loads application status (evidence: `src/app/recruitment/dashboard/page.js`)
- Visitor → Task selection: selects tasks (evidence: `README.md`)
- Task selection → Authenticated API helper: loads task data (evidence: `src/app/tasks/page.js`)
- Task submission UI → Authenticated API helper: submits task (evidence: `src/components/TaskSubmissionModal.jsx`)
- Admin dashboard → Authenticated API helper: loads admin data (evidence: `src/app/admin/page.js`)
- Admin dashboard → Application management: presents applications
- Admin dashboard → Task management: presents tasks
- Application management → Submission review: opens review
- Task management → Authenticated API helper: manages tasks (evidence: `src/components/admin/TasksTab.js`)
- Submission review → Authenticated API helper: loads submission details (evidence: `src/components/admin/SubmissionReviewDrawer.js`)
- Visitor → Admin dashboard: administers (evidence: `README.md`)
- Admin dashboard → Other admin tools: routes to admin tools
- Authenticated API helper → Clerk identity: gets session token (evidence: `src/lib/api.js`)
- Authenticated API helper → En-Passant backend: sends API requests (evidence: `src/lib/api.js`)
- Sign-in and signup → Clerk appearance: styles Clerk UI
