# arcendala-byte/cecmku architecture

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

- Interactive diagram: https://gitdiagram.com/arcendala-byte/cecmku
- Repository: https://github.com/arcendala-byte/cecmku

## Overview

This is a Next.js election portal for the MKU Congolese Students Community. Voters register or sign in, check election availability, and submit a ballot; administrators manage elections and candidates, review registrations, and calculate and publish results for public viewing. The source index and excerpts support several key calls and database reads, but many domain actions and admin pages were not sampled, so uncertain connections are omitted. The bilingual interface is a separate capability; the README provides no additional product documentation.

Main entry points: [`lib/database/prisma.ts`](https://github.com/arcendala-byte/cecmku/blob/main/lib/database/prisma.ts) (Application Database), [`lib/auth/session.ts`](https://github.com/arcendala-byte/cecmku/blob/main/lib/auth/session.ts) (Session Guards), [`app/(voter)/voting/[id]/page.tsx`](https://github.com/arcendala-byte/cecmku/blob/main/app/(voter)/voting/%5Bid%5D/page.tsx) (Voting Page), [`app/(voter)/dashboard/page.tsx`](https://github.com/arcendala-byte/cecmku/blob/main/app/(voter)/dashboard/page.tsx) (Voter Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and Voters"]
  node_login["Sign In<br/>[login-form.tsx]"]
  node_auth_actions["Auth Actions<br/>[actions.ts]"]
  node_auth_service["Auth Service<br/>[auth.ts]"]
  node_session["Session Guards<br/>[session.ts]"]
  node_registration["Voter Registration<br/>[page.tsx]"]
  node_voter_actions["Voter Actions<br/>[voter.actions.ts]"]
  node_dashboard["Voter Dashboard<br/>[page.tsx]"]
end

subgraph group_elections["Election Administration"]
  node_election_admin["Election Management"]
  node_election_actions["Election Actions"]
  node_candidate_apply["Candidate Applications"]
  node_registration_actions["Application Actions"]
  node_candidate_review["Application Review"]
  node_candidate_admin["Candidate Management"]
end

subgraph group_ballots["Voting and Results"]
  node_ballot_page["Voting Page<br/>[page.tsx]"]
  node_ballot_form["Ballot Form<br/>[ballot-form.tsx]"]
  node_vote_actions["Vote Actions<br/>[vote.actions.ts]"]
  node_results_admin["Result Manager<br/>[result-manager.tsx]"]
  node_result_actions["Result Actions<br/>[result.actions.ts]"]
  node_public_results["Published Results<br/>[page.tsx]"]
end

subgraph group_portal["Public Portal"]
  node_public_election["Election Information<br/>[page.tsx]"]
  node_language["Language Provider"]
end

node_voter(("Voter"))
node_database[("Application Database<br/>[prisma.ts]")]

node_voter -->|"signs in"| node_login
node_login -->|"submits credentials"| node_auth_actions
node_auth_service -->|"uses"| node_database
node_session -->|"gets session"| node_auth_service
node_session -->|"checks account"| node_database
node_voter -.->|"registers"| node_registration
node_registration -->|"submits registration"| node_voter_actions
node_dashboard -->|"requires sign-in"| node_session
node_dashboard -->|"reads voter and election"| node_database
node_dashboard -.->|"links to voting"| node_ballot_page
node_election_admin -.->|"manages elections"| node_election_actions
node_candidate_apply -.->|"submits application"| node_registration_actions
node_candidate_review -.->|"reviews application"| node_registration_actions
node_candidate_admin -.->|"persists candidates"| node_database
node_ballot_page -->|"requires sign-in"| node_session
node_ballot_page -->|"loads ballot data"| node_database
node_ballot_page -->|"renders"| node_ballot_form
node_ballot_form -->|"submits ballot"| node_vote_actions
node_results_admin -->|"calculates and publishes"| node_result_actions
node_result_actions -->|"checks permissions"| node_session
node_result_actions -->|"reads and writes results"| node_database
node_public_results -->|"reads results"| node_database
node_public_election -->|"reads election"| node_database

click node_login "https://github.com/arcendala-byte/cecmku/blob/main/app/(auth)/login/login-form.tsx"
click node_auth_actions "https://github.com/arcendala-byte/cecmku/blob/main/lib/auth/actions.ts"
click node_auth_service "https://github.com/arcendala-byte/cecmku/blob/main/auth.ts"
click node_session "https://github.com/arcendala-byte/cecmku/blob/main/lib/auth/session.ts"
click node_registration "https://github.com/arcendala-byte/cecmku/blob/main/app/(auth)/register/page.tsx"
click node_voter_actions "https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/voter.actions.ts"
click node_dashboard "https://github.com/arcendala-byte/cecmku/blob/main/app/(voter)/dashboard/page.tsx"
click node_election_admin "https://github.com/arcendala-byte/cecmku/tree/main/app/admin/elections"
click node_election_actions "https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/election.actions.ts"
click node_candidate_apply "https://github.com/arcendala-byte/cecmku/blob/main/components/public/candidate-registration-form.tsx"
click node_registration_actions "https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/candidate-registration.actions.ts"
click node_candidate_review "https://github.com/arcendala-byte/cecmku/blob/main/components/admin/candidate-registration-review.tsx"
click node_candidate_admin "https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/candidate.actions.ts"
click node_ballot_page "https://github.com/arcendala-byte/cecmku/blob/main/app/(voter)/voting/%5Bid%5D/page.tsx"
click node_ballot_form "https://github.com/arcendala-byte/cecmku/blob/main/components/voting/ballot-form.tsx"
click node_vote_actions "https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/vote.actions.ts"
click node_results_admin "https://github.com/arcendala-byte/cecmku/blob/main/components/admin/result-manager.tsx"
click node_result_actions "https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/result.actions.ts"
click node_public_results "https://github.com/arcendala-byte/cecmku/blob/main/app/(public)/results/page.tsx"
click node_public_election "https://github.com/arcendala-byte/cecmku/blob/main/app/(public)/page.tsx"
click node_language "https://github.com/arcendala-byte/cecmku/blob/main/components/language-provider.tsx"
click node_database "https://github.com/arcendala-byte/cecmku/blob/main/lib/database/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,node_auth_actions,node_auth_service,node_session,node_registration,node_voter_actions,node_dashboard toneBlue
class node_election_admin,node_election_actions,node_candidate_apply,node_registration_actions,node_candidate_review,node_candidate_admin,node_database toneAmber
class node_ballot_page,node_ballot_form,node_vote_actions,node_results_admin,node_result_actions,node_public_results toneMint
class node_public_election,node_language toneRose
class node_voter toneIndigo
```

## Components

### Identity and Voters

- [Sign In](https://github.com/arcendala-byte/cecmku/blob/main/app/(auth)/login/login-form.tsx): `app/(auth)/login/login-form.tsx`
- [Auth Actions](https://github.com/arcendala-byte/cecmku/blob/main/lib/auth/actions.ts): `lib/auth/actions.ts`
- [Auth Service](https://github.com/arcendala-byte/cecmku/blob/main/auth.ts): `auth.ts`
- [Session Guards](https://github.com/arcendala-byte/cecmku/blob/main/lib/auth/session.ts): `lib/auth/session.ts`
- [Voter Registration](https://github.com/arcendala-byte/cecmku/blob/main/app/(auth)/register/page.tsx): `app/(auth)/register/page.tsx`
- [Voter Actions](https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/voter.actions.ts): `lib/actions/voter.actions.ts`
- [Voter Dashboard](https://github.com/arcendala-byte/cecmku/blob/main/app/(voter)/dashboard/page.tsx): `app/(voter)/dashboard/page.tsx`

### Election Administration

- [Election Management](https://github.com/arcendala-byte/cecmku/tree/main/app/admin/elections): `app/admin/elections`
- [Election Actions](https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/election.actions.ts): `lib/actions/election.actions.ts`
- [Candidate Applications](https://github.com/arcendala-byte/cecmku/blob/main/components/public/candidate-registration-form.tsx): `components/public/candidate-registration-form.tsx`
- [Application Actions](https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/candidate-registration.actions.ts): `lib/actions/candidate-registration.actions.ts`
- [Application Review](https://github.com/arcendala-byte/cecmku/blob/main/components/admin/candidate-registration-review.tsx): `components/admin/candidate-registration-review.tsx`
- [Candidate Management](https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/candidate.actions.ts): `lib/actions/candidate.actions.ts`

### Voting and Results

- [Voting Page](https://github.com/arcendala-byte/cecmku/blob/main/app/(voter)/voting/%5Bid%5D/page.tsx): `app/(voter)/voting/[id]/page.tsx`
- [Ballot Form](https://github.com/arcendala-byte/cecmku/blob/main/components/voting/ballot-form.tsx): `components/voting/ballot-form.tsx`
- [Vote Actions](https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/vote.actions.ts): `lib/actions/vote.actions.ts`
- [Result Manager](https://github.com/arcendala-byte/cecmku/blob/main/components/admin/result-manager.tsx): `components/admin/result-manager.tsx`
- [Result Actions](https://github.com/arcendala-byte/cecmku/blob/main/lib/actions/result.actions.ts): `lib/actions/result.actions.ts`
- [Published Results](https://github.com/arcendala-byte/cecmku/blob/main/app/(public)/results/page.tsx): `app/(public)/results/page.tsx`

### Public Portal

- [Election Information](https://github.com/arcendala-byte/cecmku/blob/main/app/(public)/page.tsx): `app/(public)/page.tsx`
- [Language Provider](https://github.com/arcendala-byte/cecmku/blob/main/components/language-provider.tsx): `components/language-provider.tsx`

### Other components

- **Voter**
- [Application Database](https://github.com/arcendala-byte/cecmku/blob/main/lib/database/prisma.ts): `lib/database/prisma.ts`

## Connections

- Voter → Sign In: signs in
- Sign In → Auth Actions: submits credentials (evidence: `app/(auth)/login/login-form.tsx`)
- Auth Service → Application Database: uses (evidence: `auth.ts`)
- Session Guards → Auth Service: gets session (evidence: `lib/auth/session.ts`)
- Session Guards → Application Database: checks account (evidence: `lib/auth/session.ts`)
- Voter → Voter Registration: registers
- Voter Registration → Voter Actions: submits registration (evidence: `app/(auth)/register/page.tsx`)
- Voter Dashboard → Session Guards: requires sign-in (evidence: `app/(voter)/dashboard/page.tsx`)
- Voter Dashboard → Application Database: reads voter and election (evidence: `app/(voter)/dashboard/page.tsx`)
- Voter Dashboard → Voting Page: links to voting
- Election Management → Election Actions: manages elections
- Candidate Applications → Application Actions: submits application
- Application Review → Application Actions: reviews application
- Candidate Management → Application Database: persists candidates
- Voting Page → Session Guards: requires sign-in (evidence: `app/(voter)/voting/[id]/page.tsx`)
- Voting Page → Application Database: loads ballot data (evidence: `app/(voter)/voting/[id]/page.tsx`)
- Voting Page → Ballot Form: renders (evidence: `app/(voter)/voting/[id]/page.tsx`)
- Ballot Form → Vote Actions: submits ballot (evidence: `components/voting/ballot-form.tsx`)
- Result Manager → Result Actions: calculates and publishes (evidence: `components/admin/result-manager.tsx`)
- Result Actions → Session Guards: checks permissions (evidence: `lib/actions/result.actions.ts`)
- Result Actions → Application Database: reads and writes results (evidence: `lib/actions/result.actions.ts`)
- Published Results → Application Database: reads results (evidence: `app/(public)/results/page.tsx`)
- Election Information → Application Database: reads election (evidence: `app/(public)/page.tsx`)
