# sambit-d-swain07/ppsu-ems architecture

> Architecture diagram of the GitHub repository sambit-d-swain07/ppsu-ems, 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/sambit-d-swain07/ppsu-ems
- Repository: https://github.com/sambit-d-swain07/ppsu-ems

## Overview

This is a university event-management portal with student discovery and registration, organizer event management and analytics, and administrator oversight. The main user flow is role-based sign-in, followed by role-specific pages; students browse events and manage registrations, while organizers create and monitor events and administrators review events and manage venues and users. Source excerpts and the index establish several connections, but many action and feature implementations are unsampled, so their internal links are omitted rather than inferred.

Main entry points: [`src/lib/prisma.ts`](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/prisma.ts) (Prisma client), [`src/app/admin/page.tsx`](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/admin/page.tsx) (Admin dashboard), [`src/actions/auth.ts`](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/actions/auth.ts) (Authentication actions), [`src/app/organizer/page.tsx`](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/organizer/page.tsx) (Organizer dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and access"]
  node_login["Sign-in page<br/>[page.tsx]"]
  node_authaction["Authentication actions<br/>[auth.ts]"]
  node_auth["Credentials and sessions<br/>[auth.ts]"]
end

subgraph group_student["Student experience"]
  node_students["Event discovery<br/>[page.tsx]"]
  node_eventdetail["Event details<br/>[page.tsx]"]
  node_registrations["My registrations<br/>[page.tsx]"]
  node_registrationui["Registration controls"]
end

subgraph group_organizer["Event operations"]
  node_organizer["Organizer dashboard<br/>[page.tsx]"]
  node_eventtable["Organizer event table"]
  node_eventactions["Event actions<br/>[events.ts]"]
  node_attendance["Attendance tools"]
end

subgraph group_admin["Administration and reporting"]
  node_adminpage["Admin dashboard<br/>[page.tsx]"]
  node_approvals["Event approvals"]
  node_venues["Venue management<br/>[venues-manager.tsx]"]
  node_users["User management<br/>[page.tsx]"]
end

subgraph group_shared["Shared services"]
  node_analytics["Analytics calculations<br/>[analytics.ts]"]
  node_certificates["Certificate endpoint<br/>[route.ts]"]
  node_reminders["Reminder job endpoint<br/>[route.ts]"]
  node_mail["Email delivery<br/>[mail.ts]"]
  node_schemas["Input validation<br/>[schemas.ts]"]
  node_dbclient["Prisma client<br/>[prisma.ts]"]
end

node_visitor(("Portal user"))
node_database[("Application database")]

node_visitor -->|"opens"| node_login
node_login -->|"submits credentials"| node_authaction
node_authaction -->|"signs in"| node_auth
node_auth -->|"looks up users"| node_dbclient
node_authaction -->|"updates passwords"| node_dbclient
node_authaction -->|"validates input"| node_schemas
node_students -->|"reads events"| node_dbclient
node_students -.->|"opens event"| node_eventdetail
node_eventdetail -->|"reads event"| node_dbclient
node_eventdetail -->|"renders control"| node_registrationui
node_registrations -->|"reads registrations"| node_dbclient
node_organizer -->|"reads event data"| node_dbclient
node_organizer -->|"computes metrics"| node_analytics
node_organizer -->|"renders events"| node_eventtable
node_adminpage -->|"reads admin data"| node_dbclient
node_adminpage -->|"computes metrics"| node_analytics
node_adminpage -->|"renders approvals"| node_approvals
node_adminpage -->|"renders venues"| node_venues
node_venues -->|"requests venue changes"| node_dbclient
node_venues -->|"validates venue input"| node_schemas
node_users -.->|"reads user data"| node_dbclient
node_certificates -->|"loads registration"| node_dbclient
node_certificates -->|"checks session"| node_auth
node_reminders -->|"loads reminders"| node_dbclient
node_reminders -->|"sends reminders"| node_mail
node_eventactions -->|"persists event changes"| node_dbclient
node_eventactions -->|"validates event input"| node_schemas
node_dbclient -.->|"queries"| node_database

click node_login "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/login/page.tsx"
click node_authaction "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/actions/auth.ts"
click node_auth "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/auth.ts"
click node_students "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/student/events/page.tsx"
click node_eventdetail "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/student/events/%5Bid%5D/page.tsx"
click node_registrations "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/student/registrations/page.tsx"
click node_registrationui "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/registration-button.tsx"
click node_organizer "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/organizer/page.tsx"
click node_eventtable "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/organizer-events-table.tsx"
click node_eventactions "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/actions/events.ts"
click node_attendance "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/attendance-scanner.tsx"
click node_adminpage "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/admin/page.tsx"
click node_approvals "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/pending-approvals-table.tsx"
click node_venues "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/venues-manager.tsx"
click node_users "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/admin/users/page.tsx"
click node_analytics "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/analytics.ts"
click node_certificates "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/api/certificates/%5BregistrationId%5D/route.ts"
click node_reminders "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/api/cron/reminders/route.ts"
click node_mail "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/mail.ts"
click node_schemas "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/schemas.ts"
click node_dbclient "https://github.com/sambit-d-swain07/ppsu-ems/blob/main/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,node_authaction,node_auth,node_visitor toneBlue
class node_students,node_eventdetail,node_registrations,node_registrationui,node_database toneAmber
class node_organizer,node_eventtable,node_eventactions,node_attendance toneMint
class node_adminpage,node_approvals,node_venues,node_users toneRose
class node_analytics,node_certificates,node_reminders,node_mail,node_schemas,node_dbclient toneIndigo
```

## Components

### Identity and access

- [Sign-in page](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Authentication actions](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/actions/auth.ts): `src/actions/auth.ts`
- [Credentials and sessions](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/auth.ts): `src/auth.ts`

### Student experience

- [Event discovery](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/student/events/page.tsx): `src/app/student/events/page.tsx`
- [Event details](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/student/events/%5Bid%5D/page.tsx): `src/app/student/events/[id]/page.tsx`
- [My registrations](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/student/registrations/page.tsx): `src/app/student/registrations/page.tsx`
- [Registration controls](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/registration-button.tsx): `src/components/registration-button.tsx`

### Event operations

- [Organizer dashboard](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/organizer/page.tsx): `src/app/organizer/page.tsx`
- [Organizer event table](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/organizer-events-table.tsx): `src/components/organizer-events-table.tsx`
- [Event actions](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/actions/events.ts): `src/actions/events.ts`
- [Attendance tools](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/attendance-scanner.tsx): `src/components/attendance-scanner.tsx`

### Administration and reporting

- [Admin dashboard](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/admin/page.tsx): `src/app/admin/page.tsx`
- [Event approvals](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/pending-approvals-table.tsx): `src/components/pending-approvals-table.tsx`
- [Venue management](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/components/venues-manager.tsx): `src/components/venues-manager.tsx`
- [User management](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/admin/users/page.tsx): `src/app/admin/users/page.tsx`

### Shared services

- [Analytics calculations](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/analytics.ts): `src/lib/analytics.ts`
- [Certificate endpoint](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/api/certificates/%5BregistrationId%5D/route.ts): `src/app/api/certificates/[registrationId]/route.ts`
- [Reminder job endpoint](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/app/api/cron/reminders/route.ts): `src/app/api/cron/reminders/route.ts`
- [Email delivery](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/mail.ts): `src/lib/mail.ts`
- [Input validation](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/schemas.ts): `src/lib/schemas.ts`
- [Prisma client](https://github.com/sambit-d-swain07/ppsu-ems/blob/main/src/lib/prisma.ts): `src/lib/prisma.ts`

### Other components

- **Portal user**
- **Application database**

## Connections

- Portal user → Sign-in page: opens (evidence: `src/app/login/page.tsx`)
- Sign-in page → Authentication actions: submits credentials (evidence: `src/app/login/page.tsx`)
- Authentication actions → Credentials and sessions: signs in (evidence: `src/actions/auth.ts`)
- Credentials and sessions → Prisma client: looks up users (evidence: `src/auth.ts`)
- Authentication actions → Prisma client: updates passwords (evidence: `src/actions/auth.ts`)
- Authentication actions → Input validation: validates input (evidence: `src/actions/auth.ts`)
- Event discovery → Prisma client: reads events (evidence: `src/app/student/events/page.tsx`)
- Event discovery → Event details: opens event
- Event details → Prisma client: reads event (evidence: `src/app/student/events/[id]/page.tsx`)
- Event details → Registration controls: renders control (evidence: `src/app/student/events/[id]/page.tsx`)
- My registrations → Prisma client: reads registrations (evidence: `src/app/student/registrations/page.tsx`)
- Organizer dashboard → Prisma client: reads event data (evidence: `src/app/organizer/page.tsx`)
- Organizer dashboard → Analytics calculations: computes metrics (evidence: `src/app/organizer/page.tsx`)
- Organizer dashboard → Organizer event table: renders events (evidence: `src/app/organizer/page.tsx`)
- Admin dashboard → Prisma client: reads admin data (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Analytics calculations: computes metrics (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Event approvals: renders approvals (evidence: `src/app/admin/page.tsx`)
- Admin dashboard → Venue management: renders venues (evidence: `src/app/admin/page.tsx`)
- Venue management → Prisma client: requests venue changes (evidence: `src/components/venues-manager.tsx`)
- Venue management → Input validation: validates venue input (evidence: `src/components/venues-manager.tsx`)
- User management → Prisma client: reads user data
- Certificate endpoint → Prisma client: loads registration (evidence: `src/app/api/certificates/[registrationId]/route.ts`)
- Certificate endpoint → Credentials and sessions: checks session (evidence: `src/app/api/certificates/[registrationId]/route.ts`)
- Reminder job endpoint → Prisma client: loads reminders (evidence: `src/app/api/cron/reminders/route.ts`)
- Reminder job endpoint → Email delivery: sends reminders (evidence: `src/app/api/cron/reminders/route.ts`)
- Event actions → Prisma client: persists event changes (evidence: `src/actions/events.ts`)
- Event actions → Input validation: validates event input (evidence: `src/actions/events.ts`)
- Prisma client → Application database: queries
