A polished Next.js platform for graduates to find their convocation seats and request delivery of certificate packs.
| Public Search | Result Page |
|---|---|
![]() |
![]() |
| Mobile Home | Social Share Card |
|---|---|
![]() |
![]() |
| Certificate Request | Mobile Certificate Request |
|---|---|
![]() |
![]() |
- Public search flow with SITC logo, convocation hero image, Sinhala helper text, and a smooth reference ID popup.
- Private result pages at
/result/[referenceId]showing Session No, Student ID, Seat No, Stage Announcing Name, Ticket, and Balcony Visitors Seat No. - Ticket logic for visitor seats: Category A is graduate only, Category B allows one visitor seat, and Category C allows two visitor seats.
- Hidden admin area at
/hidden-adminwith seeded admin login, paginated dashboard, manual CRUD, Excel upload, validation preview, and sample workbook download. - Graduate Certificate Pack request form with all 25 Sri Lankan districts, strict phone and receipt validation, and a clear submission confirmation.
- Certificate administration at
/hidden-admin/certificatewith search, status filters, pagination, details, private receipt downloads, manual creation, editing, and deletion. - Private payment receipts stored in Backblaze B2 with server-side encryption and short-lived authenticated download links.
- Robust Excel header handling for real-world sheets, including typo-tolerant mapping such as
SEET NotoSeat No. - Dynamic Open Graph and Twitter card images for result links, generated as ticket-style PNGs with Sinhala font shaping.
- Public pages include SITC Campus, Privacy Policy, and Codezela Technologies footer links.
- 🔍 Seat Lookup — Graduates enter a Reference ID and instantly find their seating assignment.
- 🎟️ Social Share Cards — Dynamic OG/Twitter images render a branded ticket-style PNG with Sinhala text via Sharp.
- 🛡️ Hidden Admin Panel — Secure JWT-authenticated area for managing student records.
- 📊 Excel Import — Bulk-upload
.xlsxfiles with fuzzy header matching that handles typos and alternate column names. - 📱 Fully Responsive — Polished experience across desktop and mobile devices.
- 🌐 SEO Optimized — Public pages are indexed; admin, API, and result pages are excluded from search engines.
- 🏢 Ticket Categories — Enforces A/B/C rules with corresponding balcony visitor seat validation.
- 📦 Certificate Requests — Complete public intake and uncluttered admin management workflow.
- 🔒 Private Receipts — Binary-signature validation, encrypted private B2 objects, and 60-second admin-only download URLs.
| Route | Purpose | Indexing |
|---|---|---|
/ |
Public seat search page | Indexable |
/result/[referenceId] |
Shareable private seating result | noindex |
/certificate-request |
Graduate Certificate Pack delivery request | Indexable |
/hidden-admin |
Admin sign in | Blocked and noindex |
/hidden-admin/dashboard |
Admin import and CRUD dashboard | Blocked and noindex |
/hidden-admin/certificate |
Certificate request administration | Blocked and noindex |
/api/sample-format |
Downloads the Excel sample format | API noindex |
- Framework: Next.js 16 App Router
- Language: TypeScript 5
- Styling: Tailwind CSS 4 + shadcn-style UI components
- Animations: Motion (formerly Framer Motion)
- Database: Prisma 6 with local SQLite (dev) / MySQL (production)
- Authentication: JWT (HS256) via
jose+bcryptjs - Excel Parsing: ExcelJS for workbook reading and sample generation
- Image Generation: Sharp for correctly shaped Sinhala social-card PNGs
- Private File Storage: Backblaze B2 through its S3-compatible API
- Validation: Zod
- Testing: Vitest
npm install cp .env.example .env npm run db:setup npm run dev
Open:
- Public site:
http://localhost:3000 - Admin:
http://localhost:3000/hidden-admin
Admin credentials are read from .env and used only for local setup and seeding. Keep the real .env file private.
| Variable | Purpose |
|---|---|
DATABASE_URL |
SQLite locally; MySQL on the production VPS |
ADMIN_EMAIL |
Seeded administrator identity |
ADMIN_PASSWORD |
Bootstrap-only administrator password |
SESSION_SECRET |
JWT signing and source-HMAC secret, at least 32 characters |
NEXT_PUBLIC_SITE_URL |
Canonical public origin |
B2_S3_ENDPOINT |
Backblaze B2 S3-compatible regional endpoint |
B2_REGION |
B2 bucket region |
B2_BUCKET_NAME |
Private payment receipt bucket |
B2_KEY_ID |
Bucket-scoped B2 application key ID |
B2_APPLICATION_KEY |
Bucket-scoped B2 application key secret |
Before production, set NEXT_PUBLIC_SITE_URL to the final HTTPS domain. It controls canonical URLs, social image URLs, robots.txt, and sitemap.xml. The B2 bucket must remain private and the application key must be restricted to that bucket with only the file capabilities required by this app.
The public form requires a Student ID, certificate name, WhatsApp number, delivery contact number, full address, district, payment receipt, and confirmation. JPG, PNG, and PDF receipts are limited to 5 MB and validated from their binary signatures rather than trusting the browser-provided file name or MIME type.
Successful submissions upload the receipt to a private B2 object and then create the database record. If the database write fails, the uploaded object is removed. Admin deletion also removes both the request and its receipt. Receipt downloads require a valid admin session and redirect to a signed URL that expires after 60 seconds.
Certificate request statuses are Pending, Verified, Preparing, Dispatched, Completed, and Rejected. Courier references and private internal notes can be maintained from the admin detail dialog.
The admin dashboard accepts .xlsx files with these fields:
| Column | Required | Notes |
|---|---|---|
| Reference ID | Yes | Public lookup value used by the graduate |
| Session No | Yes | Convocation session number |
| Student ID | Yes | Graduate student ID |
| Seat No | Yes | Graduate seat number |
| Stage Announcing Name | Yes | Name shown on result and social card |
| Ticket | Yes | A, B, or C |
| Balcony Visitors Seat No | Based on ticket | Empty for A, one seat for B, two seats for C |
The sample file can be downloaded from the admin dashboard or directly from /api/sample-format.
The current database uses Prisma with SQLite for simple local operation:
- Schema:
prisma/schema.prisma - MySQL variant:
prisma/schema.mysql.prisma - Migrations:
prisma/migrations/000001_init/migration.sqlandprisma/migrations/000002_certificate_requests/migration.sql - Seed script:
prisma/seed.ts - Local database:
prisma/dev.db, ignored by Git
The existing MySQL deployment uses prisma/schema.mysql.prisma. The certificate migration is additive and does not alter existing seating or admin records.
The Vercel build uses prisma/postgres/schema.prisma and its separate PostgreSQL migration history. Configure DATABASE_URL_POOLED for runtime queries and use DATABASE_URL_DIRECT locally for migration and import. Apply the schema using npm run db:migrate:postgres before enabling production traffic. Keep .env.production out of Git and keep the direct database credential out of the Vercel runtime.
To import existing data, generate the PostgreSQL client and run node --env-file=.env.production --import tsx scripts/import-neon-snapshot.ts /path/to/private-snapshot.json. The snapshot contains seats and certificateRequests arrays with original Prisma column values, including exact timestamps in ISO 8601 and nullable fields. A legacy seat export can omit the two status columns if it predates seat archiving. The import verifies every field in the same transaction and accepts a rerun when the database already matches the snapshot.
- The homepage and certificate request page are included in
sitemap.xml. - Admin and API routes are blocked through
robots.txtandX-Robots-Tag. - Result pages are not blocked by
robots.txtso social platforms can fetch previews. - Result pages still send
noindex,nofollow, andnoarchiveheaders because they contain student seating data. - Result links generate detailed social preview cards without adding those private pages to search engines.
- Certificate administration and receipt download routes require authentication and are excluded from indexing.
npm run lint
npm test
npm run build
npm run startFor a MySQL-backed production host, generate the Prisma client from the MySQL schema before building:
npm run db:generate:mysql npm run db:push:mysql npm run build:mysql
Before publishing:
- Set a strong
SESSION_SECRET(minimum 32 characters). - Set final
ADMIN_EMAILandADMIN_PASSWORD, run the seed once, then remove the seed password from production secrets if your hosting flow allows it. - Set
NEXT_PUBLIC_SITE_URLto the final HTTPS domain before building. - Confirm the social card URL
/result/[referenceId]/opengraph-imagereturns a PNG. - Confirm
/robots.txtallows social preview crawling while admin/API routes remain blocked. - Verify the private B2 bucket is reachable with the configured application key.
- Submit, edit, download, and delete one certificate request, then confirm its B2 object is removed.
For Cloudflare R2, configure the R2_* variables with a credential scoped to a private bucket and set RECEIPT_STORAGE_PROVIDER=R2. Set a one-day expiration for the pending-certificate-receipts/ prefix only. The production form splits receipts above 4 MiB on Vercel to keep the existing 5 MB allowance. The application removes staged fragments after successful submissions, and the bucket rule removes fragments from interrupted attempts.
Before switching storage, run node --env-file=.env.production --import tsx scripts/copy-receipts-to-r2.ts. It copies the receipt keys, verifies the bytes and response metadata, and leaves the source objects in Backblaze. Before the final copy, pause writes to the old app, confirm both the record counts and the receipt keys, and retain the source until the new deployment passes the live checks.
This software is proprietary and confidential. See the LICENSE file for full terms.
Copyright © 2026 SITC Campus. All rights reserved.
- SITC Campus: sitc.lk
- Privacy Policy: sitc.lk/privacy-policy
- Developed by Codezela Technologies





