You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CHRIST Faculty App is a faculty productivity and academic management platform that centralizes deadlines, notifications, scheduling, and administrative oversight for CHRIST University. The system serves Faculty, HOD, and Admin roles with role-based access controls, real-time notifications, and integrations for institutional workflows.
Project Overview
The platform addresses fragmented academic workflows by offering a single source of truth for deadlines, department coordination, and institutional communications. It provides a Flutter-based faculty experience, a Next.js backend API, and an embedded admin console for governance and analytics. The project goal is to streamline faculty operations, improve accountability, and enable secure integrations with university systems.
System Architecture
flowchart LR
subgraph Client["Client Applications"]
Flutter["Flutter Mobile App"]
AdminUI["Admin Web Console (Next.js /admin)"]
end
subgraph Backend["Backend API (Next.js App Router)"]
API["/api routes"]
Services["Services + Validators + Middleware"]
end
subgraph Data["Data Layer"]
Supabase["Supabase Postgres"]
Prisma["Prisma ORM"]
end
subgraph External["External Services"]
FCM["Firebase Cloud Messaging"]
Resend["Resend Email"]
GoogleOAuth["Google OAuth"]
Gmail["Gmail API"]
GCal["Google Calendar API"]
end
Flutter --> API
AdminUI --> API
API --> Services
Services --> Prisma
Prisma --> Supabase
Services --> FCM
Services --> Resend
Services --> GoogleOAuth
GoogleOAuth --> Gmail
GoogleOAuth --> GCal
Loading
Component Summary
Component
Purpose
Key Files
Flutter app
Faculty-facing client experience
lib/
Next.js API
REST APIs and admin console
server/src/app/api, server/src/app/admin
Prisma ORM
Data access and schema
server/prisma/schema.prisma
Supabase Postgres
Primary database
Supabase project
FCM
Push notifications
server/src/lib/firebase.ts
Resend
Email dispatch
server/src/lib/resend.ts
Google OAuth
OAuth for Gmail/Calendar
server/src/lib/google.ts
Authentication Architecture
Current JWT Flow (Implemented)
sequenceDiagram
participant User
participant Flutter
participant API as Next.js API
participant Auth as AuthService
participant DB as Prisma/Supabase
User->>Flutter: Enter email/password
Flutter->>API: POST /api/auth/login
API->>Auth: Validate credentials
Auth->>DB: Load or create user
DB-->>Auth: User profile
Auth->>API: Issue JWT
API-->>Flutter: accessToken + user profile
Flutter->>API: Bearer JWT on protected APIs
API->>API: verifyAuth() + requireRoles()
Loading
Supabase Auth Flow (Target Architecture)
This flow is part of the target architecture described in the project context. The current implementation uses local JWT issuance; Supabase Auth integration can replace the local JWT issuer when enabled.
sequenceDiagram
participant User
participant Flutter
participant SupabaseAuth as Supabase Auth
participant API as Next.js API
User->>Flutter: Login
Flutter->>SupabaseAuth: Authenticate
SupabaseAuth-->>Flutter: Supabase JWT
Flutter->>API: Bearer Supabase JWT
API->>API: Verify token + role
API-->>Flutter: Protected data
Loading
Database Architecture
erDiagram
Department ||--o{ User : has
Department ||--o{ Deadline : has
User ||--o{ Deadline : creates
User ||--o{ Notification : receives
User ||--o{ PushToken : owns
User ||--o{ Reminder : schedules
User ||--o{ CalendarEvent : owns
User ||--|| GoogleAccount : connects
User ||--o{ AuditLog : performs
Deadline ||--o{ Notification : relates
Department {
UUID id
string name
string code
datetime createdAt
datetime updatedAt
}
User {
UUID id
UUID authUserId
string email
string passwordHash
string fullName
string employeeId
enum role
boolean isSuspended
UUID departmentId
string avatarUrl
datetime createdAt
datetime updatedAt
}
Deadline {
UUID id
string title
string description
datetime dueDate
enum priority
UUID createdById
UUID departmentId
boolean isCompleted
datetime createdAt
datetime updatedAt
}
Notification {
UUID id
UUID userId
string title
string body
string type
boolean isRead
UUID relatedDeadlineId
datetime createdAt
}
PushToken {
UUID id
UUID userId
string fcmToken
string platform
datetime updatedAt
}
GoogleAccount {
UUID id
UUID userId
string googleId
string accessToken
string refreshToken
boolean syncGmail
boolean syncCalendar
datetime connectedAt
datetime updatedAt
}
CalendarEvent {
UUID id
UUID userId
string googleEventId
string title
datetime startTime
datetime endTime
string source
datetime createdAt
datetime updatedAt
}
Reminder {
UUID id
UUID userId
string title
string description
datetime reminderTime
string status
datetime createdAt
datetime updatedAt
}
AuditLog {
UUID id
UUID adminId
string action
string targetUser
datetime timestamp
}
The backend is a Next.js App Router project providing REST APIs and an admin console. It uses Prisma to access Supabase Postgres and exposes API routes under /api/*.
Layer
Responsibility
Key Files
API Routes
HTTP entry points and response formatting
server/src/app/api/**/route.ts
Middleware
Authentication and role enforcement
server/src/middleware/*.ts
Services
Core business logic
server/src/services/*.ts
Validators
Input validation (Zod)
server/src/validators/*.ts
Utils
Error handling and branding constants
server/src/utils/*.ts
Data Access
Prisma client
server/src/lib/prisma.ts
Frontend Architecture
The Flutter app is modularized by feature, using Riverpod for state management, GoRouter for navigation, and Dio for API calls.
Concern
Implementation
Key Files
State Management
Riverpod + StateNotifier
lib/features/auth/presentation/auth_notifier.dart
Routing
GoRouter + ShellRoute
lib/core/router/app_router.dart
API Client
Dio + secure token injection
lib/core/network/api_client.dart
Secure Storage
Flutter Secure Storage
lib/core/network/api_client.dart
Theming
Central theme tokens
lib/core/theme/app_theme.dart
Authentication and Authorization
Authentication
Mechanism
Description
Status
Email/Password
Local credential validation with JWT issuance
Implemented
Google OAuth
OAuth flow with token exchange and account linking