A modern, full-stack student registration and management system for Codezela Career Accelerator programs.
Features β’ Tech Stack β’ Architecture β’ Getting Started β’ Deployment
- Overview
- Features
- Tech Stack
- Architecture
- Project Structure
- Getting Started
- Environment Variables
- Database Schema
- API Routes
- Scripts
- Deployment
- Security
- License
The Codezela Career Accelerator Student Onboarding Platform is a comprehensive web application designed to streamline the student registration process for career accelerator programs. It features a beautiful, animated public-facing registration form and a powerful admin dashboard for managing registrations, programs, payments, and user accounts.
- π¨ Stunning UI/UX β Glassmorphism design with Three.js animated backgrounds
- π Secure Authentication β Supabase Auth with Row Level Security (RLS)
- π Document Management β Secure file uploads to Cloudflare R2
- π Admin Dashboard β Comprehensive management tools with activity logging
- π International Support β Multi-country support with localized fields
- βΏ Accessibility First β WCAG compliant components
- β‘ Performance Optimized β Next.js 16 with streaming and edge capabilities
| Feature | Description |
|---|---|
| π Multi-Step Registration | Comprehensive form with program selection, personal info, contact details, qualifications, and document uploads |
| π¨ 3D Animated Homepage | Interactive Three.js geometric shapes with mouse-responsive animations |
| π Secure File Uploads | Direct-to-cloud uploads with presigned URLs (academic docs, ID proof, photo, payment slip) |
| π‘οΈ Spam Protection | Cloudflare Turnstile integration |
| π± Responsive Design | Mobile-first approach with Tailwind CSS |
| π International Support | Country selection with dynamic Sri Lankan province/district fields |
| Feature | Description |
|---|---|
| π Analytics Overview | Real-time statistics on registrations, programs, and payments |
| π₯ Registration Management | View, search, filter, edit, and soft-delete student registrations |
| π Program Management | Create, edit, and manage accelerator programs and intake windows |
| π° Finance & Payments | Track payments, generate financial reports, manage payment status |
| π€ User Accounts | Admin user management with role-based access |
| π Activity Logging | Comprehensive audit trail for all admin actions |
| π Advanced Filtering | Multi-criteria search and filtering capabilities |
| π₯ CSV Export | Export registrations and payment data to CSV |
| πΌοΈ Document Viewer | Built-in image/PDF viewer with zoom and pan capabilities |
| π³ Payment Recording | Record new payments and void existing ones |
| π Toast Notifications | Real-time feedback for all user actions |
- Next.js 16 β React framework with App Router
- React 19 β UI library with latest features
- TypeScript β Type-safe development
- PostgreSQL β Primary database via Supabase
- Prisma ORM β Type-safe database client
- Supabase β Auth, database, and storage
- Cloudflare R2 β S3-compatible object storage
- AWS SDK v3 β File operations with presigned URLs
- Tailwind CSS 4 β Latest version with
@import "tailwindcss"syntax - shadcn/ui β Beautiful, accessible components (30+ components)
- Radix UI β Unstyled, accessible primitives
- CSS Variables β Custom theming with HSL color system
- Glassmorphism β Backdrop blur and transparency effects throughout
- Framer Motion β Smooth animations
- Three.js β 3D graphics and animations
- Lucide React β Icon library
- React Hook Form β Performant form handling
- Zod β Schema validation
- Framer Motion β Page transitions and micro-interactions
- Three.js β 3D animated background on homepage
- Tailwind CSS Animations β Blob animations, hover effects, transitions
- Cloudflare Turnstile β Bot protection
- Supabase Auth β Authentication and authorization
- Row Level Security (RLS) β Database-level access control
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββββββ β
β β Public Pages β β Admin Pages β β API Routes β β
β β β β β β β β
β β / (Homepage) β β /admin β β /api/registrations β β
β β /cca-register β β /admin/programsβ β /api/upload/presign β β
β β β β /admin/finance β β β β
β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ βββββββββββββ¬ββββββββββββββ β
βββββββββββββΌβββββββββββββββββββββΌββββββββββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Server Layer (Next.js) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββββββ β
β β Server Actions β β Prisma Client β β File Upload Service β β
β β β β β β β β
β β Dashboard β β Database β β Cloudflare R2 β β
β β Actions β β Queries β β (S3-Compatible) β β
β ββββββββββ¬βββββββββ ββββββββββ¬βββββββββ βββββββββββββ¬ββββββββββββββ β
βββββββββββββΌβββββββββββββββββββββΌββββββββββββββββββββββββΌβββββββββββββββββ
β β β
βΌ βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β External Services β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββββββ β
β β Supabase β β Cloudflare R2 β β Cloudflare Turnstile β β
β β β β β β β β
β β PostgreSQL β β Object Storage β β Bot Protection β β
β β Auth β β CDN β β β β
β βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
app/
βββ (public)/ # Public routes (no auth required)
β βββ page.tsx # Homepage with 3D animation
β βββ register/ # Registration form
β
βββ (admin)/ # Admin routes (auth required)
β βββ admin/
β βββ login/ # Admin login
β βββ (dashboard)/
β βββ page.tsx # Dashboard home
β βββ programs/ # Program management
β βββ registrations/ # Registration management
β βββ finance/ # Payment tracking
β βββ accounts/ # User management
β βββ activity/ # Activity logs
β
βββ api/ # API routes
βββ registrations/ # Registration CRUD
βββ upload/ # File upload handlers
cca-student-onboarding-next/
βββ π app/ # Next.js App Router
β βββ (admin)/ # Admin route group
β β βββ admin/
β β βββ (dashboard)/ # Dashboard layout
β β β βββ accounts/ # User management
β β β βββ activity/ # Activity logs
β β β βββ finance/ # Finance dashboard
β β β βββ programs/ # Program CRUD
β β β βββ registrations/ # Registration management
β β β βββ dashboard-actions.ts
β β β βββ page.tsx
β β βββ login/ # Admin login page
β βββ (public)/ # Public route group
β β βββ page.tsx # Homepage
β β βββ register/ # Registration form
β βββ api/ # API routes
β β βββ registrations/ # Registration API
β β βββ upload/ # File upload API
β βββ globals.css
β βββ layout.tsx
β
βββ π components/ # React components
β βββ admin/ # Admin-specific components
β βββ layout/ # Layout components
β βββ ui/ # shadcn/ui components
β
βββ π lib/ # Utility libraries
β βββ data/ # Static data (countries, districts)
β βββ hooks/ # Custom React hooks
β βββ services/ # Business logic services
β βββ supabase/ # Supabase clients
β βββ validations/ # Zod schemas
β βββ prisma.ts # Prisma client
β βββ utils.ts # Utility functions
β
βββ π hooks/ # Global hooks
β
βββ π prisma/ # Database schema
β βββ schema.prisma
β
βββ π scripts/ # Utility scripts
β βββ enable-rls.ts # Enable Row Level Security
β βββ seed-admin.ts # Seed admin user
β βββ seed-programs.ts # Seed program data
β βββ test-db.ts # Database connection test
β
βββ π public/ # Static assets
β βββ images/
β
βββ .env.example # Environment template
βββ .gitignore
βββ LICENSE # Proprietary license
βββ next.config.ts
βββ package.json
βββ postcss.config.mjs
βββ prisma.config.ts
βββ README.md
βββ tsconfig.json
- Node.js 20.x or later
- npm 10.x or later
- PostgreSQL database (Supabase recommended)
- Cloudflare R2 bucket (for file storage)
- Supabase project (for auth and database)
git clone <repository-url>
cd cca-student-onboarding-nextnpm installcp .env.example .envEdit .env with your credentials. See Environment Variables for details.
# Generate Prisma client
npx prisma generate
# Run database migrations
npx prisma migrate dev --name init
# (Optional) Seed programs
npx tsx scripts/seed-programs.ts
# (Optional) Create admin user
npx tsx scripts/seed-admin.ts
# (Optional) Enable RLS
npx tsx scripts/enable-rls.tsnpm run devOpen http://localhost:3000 in your browser.
| Variable | Description | Source |
|---|---|---|
NEXT_PUBLIC_SUPABASE_URL |
Supabase project URL | Supabase Dashboard |
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY |
Supabase anon key | Supabase Dashboard |
SUPABASE_SECRET_KEY |
Supabase service role key | Supabase Dashboard |
DATABASE_URL |
PostgreSQL connection URL (with PgBouncer) | Supabase Dashboard |
DIRECT_URL |
Direct PostgreSQL connection URL | Supabase Dashboard |
AUTH_SECRET |
NextAuth.js secret | Generate with openssl rand -base64 32 |
| Variable | Description | Source |
|---|---|---|
NEXT_PUBLIC_TURNSTILE_SITE_KEY |
Turnstile site key | Cloudflare Dashboard |
TURNSTILE_SECRET_KEY |
Turnstile secret key | Cloudflare Dashboard |
TURNSTILE_ALLOWED_HOSTNAME |
Optional hostname pin for server validation | Your deployment hostname |
| Variable | Description | Source |
|---|---|---|
R2_ACCESS_KEY_ID |
R2 access key ID | Cloudflare R2 Dashboard |
R2_SECRET_ACCESS_KEY |
R2 secret key | Cloudflare R2 Dashboard |
R2_BUCKET |
Bucket name | Cloudflare R2 Dashboard |
R2_ENDPOINT |
R2 endpoint URL | Cloudflare R2 Dashboard |
R2_PUBLIC_URL |
Public access URL | Cloudflare R2 Dashboard |
| Variable | Description | Example |
|---|---|---|
SEED_ADMIN_EMAIL |
Initial admin email | admin@example.com |
SEED_ADMIN_PASSWORD |
Initial admin password | ChangeMe123! |
SEED_ADMIN_NAME |
Initial admin name | Admin User |
| Variable | Description | Default |
|---|---|---|
NEXT_PUBLIC_APP_URL |
Public app URL | http://localhost:3000 |
βββββββββββββββββββ βββββββββββββββββββββββ βββββββββββββββββββ
β User β β ProgramIntakeWindowβ β Program β
βββββββββββββββββββ€ βββββββββββββββββββββββ€ βββββββββββββββββββ€
β id (PK) β β id (PK) β β id (PK) β
β name β β programId (FK) ββββββΆβ code (Unique) β
β email (Unique) β β windowName β β name β
β password β β opensAt β β yearLabel β
β role β β closesAt β β durationLabel β
β createdAt β β priceOverride β β basePrice β
β updatedAt β β isActive β β currency β
βββββββββββββββββββ β createdAt β β isActive β
β β updatedAt β β createdBy (FK) βββββ
β βββββββββββββββββββββββ β updatedBy (FK) βββββ€
β β createdAt β β
β β updatedAt β β
β βββββββββββββββββββ β
β β
β βββββββββββββββββββββββ β
β β CCARegistration β β
β βββββββββββββββββββββββ€ β
β β id (PK) β β
β β registerId (Unique) β β
β β programId (FK) ββββββββββββββββββββββββββββ
β β fullName β
β β emailAddress β
β β ... β
β βββββββββββββββββββββββ
β β
β β
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββ
β RegistrationPayment β
βββββββββββββββββββββββββββββββββββββββββ€
β id (PK) β
β ccaRegistrationId (FK) β
β paymentNo β
β amount β
β paymentMethod β
β status (active/void) β
β createdAt β
βββββββββββββββββββββββββββββββββββββββββ
Core registration model storing student application data:
- Personal information (name, DOB, gender)
- Contact details (address, email, phone)
- Identification (NIC/Passport)
- Qualifications and documents
- Payment information
- Document URLs (stored as JSON)
Career accelerator programs:
- Program code, name, and metadata
- Pricing and currency
- Active/inactive status
- Display ordering
Enrollment periods for programs:
- Opening and closing dates
- Price overrides for specific windows
- Active status
Payment tracking for registrations:
- Payment history with sequential numbers
- Void capability with audit trail
- Receipt reference tracking
Comprehensive audit logging:
- Actor identification (user snapshots)
- Action categorization
- Before/after data storage
- IP address and user agent tracking
The application uses Next.js Server Actions for all data mutations:
| Action | Description |
|---|---|
getDashboardStats() |
Get registration statistics (active, trashed, total, by tags) |
getRegistrations() |
Fetch registrations with filtering and search |
getActivePrograms() |
List all programs for filters |
toggleRegistrationTrash() |
Soft-delete or restore a registration |
purgeRegistration() |
Permanently delete a registration |
getRegistrationById() |
Fetch single registration with payments |
updateRegistration() |
Update registration details |
| Action | Description |
|---|---|
getAllPrograms() |
List all programs with counts |
getProgramById() |
Fetch program with intake windows |
toggleProgramStatus() |
Activate/deactivate a program |
upsertProgram() |
Create or update a program |
deleteProgram() |
Delete program (if no registrations) |
getProgramIntakes() |
List intake windows for a program |
upsertIntakeWindow() |
Create or update intake window |
toggleIntakeStatus() |
Activate/deactivate intake window |
deleteIntakeWindow() |
Delete an intake window |
| Action | Description |
|---|---|
getFinanceStats() |
Get total revenue and payment counts |
getPaymentLedger() |
List all payment transactions |
addPayment() |
Record a new payment |
voidPayment() |
Void a payment with reason |
| Action | Description |
|---|---|
loginAction() |
Authenticate admin user with Turnstile |
logoutAction() |
Sign out current user |
getAdminUsers() |
List all admin users |
createAdminUser() |
Create new admin account |
deleteAdminUser() |
Delete an admin account |
| Method | Endpoint | Description |
|---|---|---|
POST |
/api/registrations |
Create new registration |
Request Body:
{
turnstile_token: string;
program_id: string;
full_name: string;
name_with_initials: string;
gender: "male" | "female";
date_of_birth: string;
// ... other fields
academic_urls: string; // JSON string of URLs
nic_urls: string; // JSON string of URLs
passport_urls: string; // JSON string of URLs
photo_url: string;
payment_url: string;
}| Method | Endpoint | Description |
|---|---|---|
POST |
/api/upload/presign |
Get presigned URL for file upload |
Request Body:
{
filename: string;
contentType: string;
directory: "documents" | "receipts" | "avatars";
}Response:
{
success: true;
data: {
url: string; // Presigned upload URL
key: string; // Storage key
publicUrl: string; // Public access URL
}
}# Test database connection
npx tsx scripts/test-db.ts
# Enable Row Level Security on all tables
npx tsx scripts/enable-rls.ts
# Seed programs data
npx tsx scripts/seed-programs.ts
# Create initial admin user
npx tsx scripts/seed-admin.ts
| Script | Purpose |
|---|---|
test-db.ts |
Verify database connectivity |
enable-rls.ts |
Enable RLS policies on all tables |
seed-programs.ts |
Seed 30+ career programs |
seed-admin.ts |
Create initial admin user |
-
Push to GitHub
git push origin main
-
Connect to Vercel
- Import project from GitHub
- Framework preset: Next.js
-
Configure Environment Variables
- Add all variables from
.env.example
- Add all variables from
-
Deploy
- Vercel will build and deploy automatically
# Dockerfile
FROM node:20-alpine AS base
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package*.json ./
RUN npm ci
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npx prisma generate
RUN npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
ENV PORT 3000
CMD ["node", "server.js"]| Feature | Implementation |
|---|---|
| Row Level Security (RLS) | PostgreSQL RLS policies on all tables |
| Authentication | Supabase Auth with session management |
| File Upload Security | Presigned URLs with 5-minute expiration |
| Bot Protection | Cloudflare Turnstile on public submissions |
| Input Validation | Zod schema validation on all inputs |
| SQL Injection Prevention | Prisma ORM with parameterized queries |
| XSS Protection | React's built-in escaping + CSP headers |
| CSRF Protection | SameSite cookies + origin validation |
- Never commit
.envfiles β Always use.env.exampleas template - Rotate credentials regularly β Especially service account keys
- Enable RLS β Run
scripts/enable-rls.tsafter migrations - Validate file types β Server-side validation on uploads
- Rate limiting β Implement on API routes for production
This project is proprietary software owned by Codezela Technologies (Pvt) Ltd.
Copyright (c) 2026 Codezela Technologies (Pvt) Ltd
All Rights Reserved.
Unauthorized copying, distribution, modification, public display, or public
performance of this Software is strictly prohibited.
For licensing inquiries, please contact Codezela Technologies (Pvt) Ltd.
See LICENSE for full terms.
- π§ Email: ca@codezela.com | shamal@codezela.com
- π± WhatsApp: +94 76 677 2923 | +94 76 677 8438
- π Website: codezela.com
- π± Social: Facebook | LinkedIn
Built with β€οΈ by Codezela Technologies (Pvt) Ltd
Β© 2026 Codezela Technologies (Pvt) Ltd. All rights reserved.
