Skip to content

Dev - #2

Merged
Shrxmy merged 6 commits into
mainfrom
dev
Aug 11, 2026
Merged

Dev#2
Shrxmy merged 6 commits into
mainfrom
dev

Conversation

@Shrxmy

@Shrxmy Shrxmy commented Aug 11, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several major updates across the codebase, including a significant database schema migration, dependency upgrades, new admin features, improved documentation, and build system enhancements. The most impactful changes are the normalization of application data in the Prisma schema, the addition of performance optimizations, and enhancements to the admin dashboard and email system.

Database Schema Refactor and Enhancements:

  • Major normalization of the application models in prisma/schema.prisma:
    • Introduced the Membership and MembershipCounter models to track member IDs and sequences per recruitment cycle.
    • All application models (MemberApplication, ExecutiveAssociateApplication, CommitteeApplication) now reference RecruitmentCycle, allowing multiple applications per user per cycle and enforcing appropriate uniqueness constraints.
    • Added optional fields to User (e.g., image, age, dateOfBirth, isOldCssMember) and new relationships for improved data modeling.
    • Updated EBProfile to associate with RecruitmentCycle.
    • Added new indexes and unique constraints for better query performance and data integrity. [1] [2] [3] [4] [5]

Dependency and Build System Updates:

  • Upgraded key dependencies to latest versions, including next, next-auth, @prisma/client, @prisma/adapter-pg, tailwindcss, postcss, uuid, and related dev dependencies, ensuring compatibility with Prisma 7.9 and Next.js 15.5. [1] [2]
  • Changed Next.js build output directory to .next-dev in development to avoid conflicts with production builds, and updated ESLint ignore patterns accordingly. [1] [2]

Admin and Application Features:

  • Expanded admin dashboard documentation and features:
    • Super Admin dashboard now includes user management, recruitment cycle configuration, and a test email system for verifying templates.
    • EB profile management now supports committee assignments, meeting links, and status toggling.
  • Added support for displaying a user's memberId in the admin applications page, using the new memberships relationship. [1] [2]

Performance and Email System Improvements:

  • Documented and implemented SWR-based client-side caching for improved performance, especially for EB profiles and schedules.
  • Added new environment variables for features like payment QR codes and sign-in domain restrictions.
  • Enhanced email system with a test email feature for Super Admins, and improved template branding and consistency. [1] [2] [3] [4]

Documentation and Project Structure:

  • Removed the AGENTS.md file, consolidating all project guidelines, structure, and code style documentation into README.md, which now includes build, lint, and Prisma command references. [1] [2]

These changes collectively improve the system's scalability, maintainability, and user experience, while ensuring the codebase is ready for future feature expansion and higher data integrity.

Shrxmy and others added 6 commits April 9, 2026 16:21
Update from Dev Fork to official Dev Branch
- Multiple dynamic updates
 - Every A.Y. there will be a renewal which can be triggered by super_admin
 - Uploadable QR code for payments
 - Updatable FB group links and can be triggered to show up or not.
- Better emails
 - Changed template to be more clean
- SVGs are not hardcoded anymore and reusable via /public/icons/*
- Fixes on the admin side
 - Changed some aspects on scheduling interview especially the dates
@Shrxmy
Shrxmy requested a lite review from Copilot August 11, 2026 02:30
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
css-apply-dev Ready Ready Preview Aug 11, 2026 2:30am

@Shrxmy
Shrxmy merged commit 22cac20 into main Aug 11, 2026
3 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a broad refactor and feature expansion for the CSSApply Next.js app, centered on normalizing recruitment/application data around RecruitmentCycle in Prisma, renaming the Executive Assistant flow to Executive Associate, and adding new admin/config + performance improvements (SWR hooks, new endpoints, and localized/static assets).

Changes:

  • Refactors Prisma schema to support multiple applications per cycle and introduces Membership/MembershipCounter for member ID generation.
  • Renames/updates the “Executive Assistant” application flow to “Executive Associate” across UI, API routes, session typing, and admin tooling.
  • Adds new API endpoints + SWR hooks for recruitment cycle, EB roles, community link, payment QR/template; replaces several inline SVGs/remote assets with local static assets; introduces standardized loading components.

Reviewed changes

Copilot reviewed 106 out of 201 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tsconfig.json Adds .next-dev types + reformats config for new dev distDir.
src/types/next-auth.d.ts Renames EA session flags/types to Executive Associate.
src/test/ApplicationGuard.test.tsx Updates test usage to new applicationType value.
src/personality-test/ResultsPage.tsx Adds attempt-scoped idempotency for quiz submissions.
src/personality-test/QuizApp.tsx Introduces per-attempt ID persisted in sessionStorage.
src/personality-test/quiz-styles.module.css Updates background icon styling to support CSS mask-based icons.
src/personality-test/HomePage.tsx Switches remote image to local static asset.
src/personality-test/data/quizData.ts Switches committee images to local static assets.
src/personality-test/BackgroundIcons.tsx Replaces inline SVG list with mask-based icon assets.
src/personality-test/AppHeader.tsx Switches logo source to local static asset + updates alt text.
src/lib/usePaymentReceiptTemplate.ts Adds SWR hook for receipt template URL.
src/lib/usePaymentQr.ts Adds SWR hook for payment QR URL.
src/lib/useEbRoles.ts Adds SWR hook for EB roles + active cycle data.
src/lib/useCommunityLink.ts Adds SWR hook for community link config.
src/lib/useApplicationStatus.ts Renames EA flag to Executive Associate for status aggregation.
src/lib/useApplicationsOpen.ts Adds stateful hook and date-only comparisons using active cycle endpoint.
src/lib/schemas.ts Expands/normalizes zod schemas (profile fields, schedule, payment proof, enums).
src/lib/prisma.ts Caches Prisma client and pg pool globally to reduce dev connection churn.
src/lib/payment-config.ts Adds optional fallback for public payment QR URL env var.
src/lib/member-id.ts Adds member ID generation + cycle-scoped membership helper.
src/lib/auth.ts Adds allowed-domain sign-in restriction + cycle-scoped application/session logic.
src/data/ebRoles.ts Updates copy to “Executive Associate”.
src/components/Modal.tsx Uses next/image + new LoadingSpinner and local warning icon.
src/components/LoadingSpinner.tsx Adds reusable accessible spinner component.
src/components/LoadingScreen.tsx Simplifies loading screen to use spinner + message prop.
src/components/Header.tsx Switches header logo to local static asset.
src/components/Footer.tsx Replaces inline social SVGs with local icon assets + updates logo asset.
src/components/ErrorPage.tsx Switches background and illustration to local static assets.
src/components/ApplicationGuard.tsx Updates supported applicationType union and checks Executive Associate status.
src/components/AdminMobileSB.tsx Replaces hamburger SVG with CSS mask icon.
src/app/user/apply/member/success/content.tsx Switches to local static background/illustrations.
src/app/user/apply/executive-associate/page.tsx Uses useEbRoles + updates routing/copy/assets for Executive Associate.
src/app/user/apply/executive-associate/[eb-role]/success/page.tsx Updates ApplicationGuard applicationType value.
src/app/user/apply/executive-associate/[eb-role]/success/content.tsx Uses useEbRoles + updates routing/copy/assets for Executive Associate.
src/app/user/apply/executive-associate/[eb-role]/schedule/page.tsx Updates ApplicationGuard applicationType value.
src/app/user/apply/executive-associate/[eb-role]/schedule/content.tsx Migrates API paths to Executive Associate + active cycle endpoint + local assets.
src/app/user/apply/executive-associate/[eb-role]/progress/page.tsx Updates ApplicationGuard applicationType value.
src/app/user/apply/committee-staff/page.tsx Updates redirects + switches images/backgrounds to local assets.
src/app/user/apply/committee-staff/[committee]/success/content.tsx Switches backgrounds/illustrations to local assets.
src/app/user/apply/committee-staff/[committee]/schedule/content.tsx Uses active cycle endpoint + local background assets.
src/app/loading.tsx Adds global app-router loading UI using LoadingScreen.
src/app/layout.tsx Updates metadata copy and OpenGraph/Twitter image/icon asset URLs.
src/app/globals.css Updates branding text (“CSSApply”).
src/app/auth/error/page.tsx Improves Suspense fallback with LoadingScreen.
src/app/api/recruitment-cycle/active/route.ts Adds public API for active recruitment cycle data.
src/app/api/quiz-submissions/route.ts Adds server-side short TTL idempotency cache and payload validation.
src/app/api/payment-receipt-template/route.ts Adds endpoint to resolve receipt template URL from system config.
src/app/api/payment-receipt-template/file/route.ts Adds endpoint to stream receipt template PDF from Supabase storage.
src/app/api/payment-qr/route.ts Adds endpoint for payment QR URL with env fallback.
src/app/api/payment-qr/image/route.ts Adds endpoint to stream payment QR image from Supabase storage.
src/app/api/files/upload/route.ts Updates allowed applicationType values for uploads.
src/app/api/files/access/route.ts Updates allowed applicationType values + queries for file access.
src/app/api/eb-roles/route.ts Adds endpoint to serve EB roles with cycle-aware profile data + availability config.
src/app/api/community-link/route.ts Adds public endpoint for community link config.
src/app/api/applications/payment-proof/route.ts Adds payment proof submission + member ID issuance + email notification.
src/app/api/applications/member/route.ts Refactors member application submission to use cycle rules + schemas + transactions.
src/app/api/applications/executive-associate/schedule/route.ts Adds Executive Associate schedule API with validations + notifications.
src/app/api/applications/executive-assistant/schedule/route.ts Removes legacy Executive Assistant schedule endpoint.
src/app/api/applications/executive-assistant/route.ts Removes legacy Executive Assistant application endpoint.
src/app/api/applications/committee-staff/eb/[committee]/route.ts Updates EB lookup to be cycle-aware and uses committee id directly.
src/app/api/applications/check-existing/route.ts Updates existing-application checks to be cycle-scoped and Executive Associate aware.
src/app/api/admin/users/search/route.ts Forces dynamic rendering + updates relations/counts for Executive Associate model.
src/app/api/admin/users/all/route.ts Forces dynamic rendering + includes user image and cycle member IDs.
src/app/api/admin/unavailable-slots/[id]/route.ts Tightens auth check + minor mapping refactor.
src/app/api/admin/test-email/route.ts Renames EA test template keys + adds new templates (member id/payment/community).
src/app/api/admin/resolve-conflict/route.ts Updates applicationType values + switches to updateMany for non-unique studentNumber.
src/app/api/admin/recruitment-cycle/route.ts Adds auth gating, date validation, and advisory-lock guarded activation changes.
src/app/api/admin/payment-receipt-template/route.ts Adds super-admin endpoint to upload/configure receipt template PDF.
src/app/api/admin/payment-qr/route.ts Adds super-admin endpoint to upload/configure payment QR image.
src/app/api/admin/interview-slots/[position]/route.ts Updates slot queries to be cycle-scoped and Executive Associate aware.
src/app/api/admin/files/cleanup-staged/route.ts Updates bucket names + model name for staged file cleanup.
src/app/api/admin/export/csv/route.ts Makes exports cycle-scoped and adds member ID + profile fields to CSV output.
src/app/api/admin/eb-profiles/route.ts Adds committee normalization + associates EB profiles to active cycle.
src/app/api/admin/download-pdf/route.ts Updates applicationType values + storage bucket name for downloads.
src/app/api/admin/cv-download/route.ts Updates applicationType values + storage bucket name for downloads.
src/app/api/admin/community-link/route.ts Adds super-admin endpoint to manage community link config.
src/app/api/admin/check-conflicts/route.ts Makes conflict checks cycle-scoped and Executive Associate aware.
src/app/api/admin/available-executive-associate-roles/route.ts Adds super-admin endpoint to configure available Executive Associate roles.
src/app/api/admin/applications/counts/route.ts Adds admin endpoint for application counts with committee access filtering.
src/app/admin/staffs/page.tsx Switches background asset + updates copy/labels to Executive Associate naming.
src/app/admin/members/page.tsx Uses cycle membership memberId in UI + updates branding copy/assets.
src/app/admin/executive-associates/page.tsx Renames EA admin page to Executive Associates + updates API params and copy.
README.md Consolidates documentation and updates commands, env vars, admin + performance sections.
public/window.svg Removes unused legacy asset.
public/vercel.svg Removes unused legacy asset.
public/next.svg Removes unused legacy asset.
public/globe.svg Removes unused legacy asset.
public/file.svg Removes unused legacy asset.
public/icons/warning.svg Adds local warning icon asset.
public/icons/users.svg Adds local icon asset.
public/icons/trash.svg Adds local icon asset.
public/icons/star.svg Adds local icon asset.
public/icons/send.svg Adds local icon asset.
public/icons/search.svg Adds local icon asset.
public/icons/refresh.svg Adds local icon asset.
public/icons/menu.svg Adds local icon asset.
public/icons/mail.svg Adds local icon asset.
public/icons/logout.svg Adds local icon asset.
public/icons/instagram.svg Adds local icon asset.
public/icons/file-text.svg Adds local icon asset.
public/icons/facebook.svg Adds local icon asset.
public/icons/email.svg Adds local icon asset.
public/icons/edit.svg Adds local icon asset.
public/icons/chevron-down.svg Adds local icon asset.
public/icons/chevron-down-dropdown.svg Adds local icon asset.
public/icons/check.svg Adds local icon asset.
public/icons/calendar.svg Adds local icon asset.
public/icons/briefcase.svg Adds local icon asset.
public/icons/bg-icon-9.svg Adds background icon asset for personality test page.
public/icons/bg-icon-8.svg Adds background icon asset for personality test page.
public/icons/bg-icon-7.svg Adds background icon asset for personality test page.
public/icons/bg-icon-6.svg Adds background icon asset for personality test page.
public/icons/bg-icon-5.svg Adds background icon asset for personality test page.
public/icons/bg-icon-4.svg Adds background icon asset for personality test page.
public/icons/bg-icon-3.svg Adds background icon asset for personality test page.
public/icons/bg-icon-2.svg Adds background icon asset for personality test page.
public/icons/bg-icon-11.svg Adds background icon asset for personality test page.
public/icons/bg-icon-10.svg Adds background icon asset for personality test page.
public/icons/bg-icon-1.svg Adds background icon asset for personality test page.
public/icons/bg-icon-0.svg Adds background icon asset for personality test page.
prisma/schema.prisma Normalizes schema around recruitment cycles + memberships + renames EA model mapping.
package.json Upgrades Next.js/Prisma and related dependencies.
next.config.ts Uses .next-dev distDir in development.
eslint.config.mjs Ignores .next-dev output.
docs/CSS_REMINDER_README.md Updates branding text.
docs/BREVO_SETUP.md Updates branding text.
AGENTS.md Removes separate agent guidelines file (moved into README).
.gitignore Adds .next-dev and backup folder.
Suppressed comments (5)

src/app/user/apply/executive-associate/[eb-role]/success/content.tsx:56

  • sm:w-50-[200px] is not a valid Tailwind class (it looks like a malformed attempt at an arbitrary value). This will prevent the illustration from being sized correctly.
    src/personality-test/ResultsPage.tsx:83
  • submissionStorageKey is set to "pending" before verifying sortedResults is valid. If sortedResults is missing/too short, the function returns without clearing the sessionStorage flag, permanently blocking submission for that attempt.

This issue also appears on line 115 of the same file.
src/personality-test/ResultsPage.tsx:118

  • On submission errors you remove the sessionStorage key, but didSubmitRef.current stays true, so the effect won’t retry even though you explicitly cleared the idempotency guard. This makes transient network failures unrecoverable without a full remount.
    src/app/api/files/access/route.ts:66
  • With the schema change allowing multiple applications per studentNumber, findFirst({ where: { studentNumber } }) can return an arbitrary cycle’s record (and currently has no orderBy). This can generate signed URLs for an older/incorrect CV/portfolio.
    src/app/user/apply/committee-staff/[committee]/success/content.tsx:53
  • sm:w-50 sm:h-50 are not valid Tailwind utilities by default, so the success illustration likely won’t scale as intended on sm screens.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines 15 to 19
const DEFAULT_REDIRECTS: Record<string, string> = {
member: "/user/apply/member",
committee: "/user/apply/committee-staff",
ea: "/user/apply/executive-assistant",
ea: "/user/apply/executive-associate",
};
Comment thread src/components/Header.tsx
Comment on lines 19 to 26
<Image
src="https://odjmlznlgvuslhceobtz.supabase.co/storage/v1/object/public/css-apply-static-images/assets/logos/Logo_CSS Apply.svg"
alt="CSS Apply logo"
src="/assets/css-apply-static-images/assets/logos/Logo_CSS%20Apply.svg"
alt="CSSApply logo"
width={110}
height={190}
sizes="(max-width: 640px) 64px, 110px"
className="w-20 h-auto sm:w-[110px] cursor-pointer"
className="w-20 h-auto sm:w-27.5 cursor-pointer"
/>
Comment on lines 60 to 66
<Image
src="https://odjmlznlgvuslhceobtz.supabase.co/storage/v1/object/public/css-apply-static-images/assets/pictures/CSAR_Sad.png"
src="/assets/css-apply-static-images/assets/pictures/CSAR_Sad.webp"
alt="Error"
width={150}
height={150}
className="object-contain drop-shadow-lg sm:w-[200px] sm:h-[200px] mx-auto"
className="object-contain drop-shadow-lg sm:w-50 sm:h-50 mx-auto"
/>
Comment on lines 106 to 111
// Determine the bucket and application type
const bucketName =
applicationType === "ea" ? "ea-applications" : "committee-applications";
applicationType === "executive-associate"
? "ea-applications"
: "committee-applications";

Comment on lines 19 to 24
const userRole = session.user.role;
const hasAdminAccess = userRole === "admin" || userRole === "super_admin";

if (!hasAdminAccess) {
return NextResponse.json(
{ error: "Forbidden - Admin access required" },
{ status: 403 },
);
}
const hasAdminAccess =
userRole === "admin" ||
userRole === "super_admin" ||
userRole === "super-admin";

Comment on lines +27 to +38
// Check if user has admin access
const userRole = session.user.role;
const hasAdminAccess = userRole === "admin" || userRole === "super_admin";

if (!hasAdminAccess) {
return NextResponse.json(
{ error: "Forbidden - Admin access required" },
{ status: 403 },
);
}

const isSuperAdmin = userRole === "super_admin";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants