Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a new UI layer for the app’s landing and authentication flows, adding student/admin login pages, a student change-password page, toast notifications, and corresponding Next.js API routes for authentication.
Changes:
- Added student/admin login pages plus a student “change password” page with client-side UX and toast feedback.
- Added auth API routes (student login, admin login, student change-password, logout) using Drizzle + JWT cookies.
- Introduced shadcn/radix-based UI primitives (button/input/card/label/toast) and globally mounted toaster in
app/layout.tsx.
Reviewed changes
Copilot reviewed 18 out of 23 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| package-lock.json | Lockfile updates reflecting dependency graph changes. |
| lib/db.ts | Switches DB initialization to lazy accessor and proxy export. |
| components/ui/use-toast.ts | Adds toast state/store utilities for client components. |
| components/ui/toaster.tsx | Renders queued toasts via Radix Toast provider. |
| components/ui/toast.tsx | Radix-based toast primitives and variants. |
| components/ui/label.tsx | Radix label wrapper component. |
| components/ui/input.tsx | Styled input component. |
| components/ui/card.tsx | Styled card components (header/content/footer/etc.). |
| components/ui/button.tsx | Styled button with variants and Radix Slot support. |
| components.json | Adds shadcn component configuration metadata. |
| app/student/login/page.tsx | Student login UI with toasts and redirect handling. |
| app/student/change-password/page.tsx | Student password-change UI with validation indicators. |
| app/page.tsx | Replaces home page with login-entry UI (student/admin). |
| app/layout.tsx | Mounts Toaster globally under the root layout. |
| app/api/auth/student/login/route.ts | Student login endpoint: validate, verify password, set JWT cookie, return redirect. |
| app/api/auth/student/change-password/route.ts | Student change-password endpoint gated by JWT cookie, updates hash + first-login flag. |
| app/api/auth/logout/route.ts | Logout endpoint clearing the auth cookie. |
| app/api/auth/admin/login/route.ts | Admin login endpoint: validate, verify password, set JWT cookie, return redirect. |
| app/admin/login/page.tsx | Admin login UI with toasts and redirect handling. |
| .idea/vcs.xml | Adds JetBrains VCS configuration file. |
| .idea/modules.xml | Adds JetBrains module mapping configuration. |
| .idea/CIS-GPACAL.iml | Adds JetBrains module file. |
| .idea/.gitignore | Adds JetBrains-local ignore rules (within .idea/). |
Files not reviewed (4)
- .idea/.gitignore: Language not supported
- .idea/CIS-GPACAL.iml: Language not supported
- .idea/modules.xml: Language not supported
- .idea/vcs.xml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+172
to
+180
| React.useEffect(() => { | ||
| listeners.push(setState) | ||
| return () => { | ||
| const index = listeners.indexOf(setState) | ||
| if (index > -1) { | ||
| listeners.splice(index, 1) | ||
| } | ||
| } | ||
| }, [state]) |
Comment on lines
+8
to
+10
| const TOAST_LIMIT = 1 | ||
| const TOAST_REMOVE_DELAY = 1000000 | ||
|
|
Comment on lines
+144
to
+150
| <button | ||
| type="button" | ||
| onClick={() => setShowPassword(!showPassword)} | ||
| className="absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-200 transition-colors" | ||
| tabIndex={-1} | ||
| aria-label={showPassword ? "Hide password" : "Show password"} | ||
| > |
Comment on lines
+163
to
+169
| <p className="text-xs text-emerald-300/90"> | ||
| <span className="font-medium">First-time login?</span> Your | ||
| default password is{" "} | ||
| <code className="px-1.5 py-0.5 rounded bg-emerald-500/15 text-emerald-200 font-mono text-[11px]"> | ||
| 123456789 | ||
| </code> | ||
| </p> |
Comment on lines
+142
to
+148
| <button | ||
| type="button" | ||
| onClick={() => setShowPassword(!showPassword)} | ||
| className="absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-200 transition-colors" | ||
| tabIndex={-1} | ||
| aria-label={showPassword ? "Hide password" : "Show password"} | ||
| > |
Comment on lines
+224
to
+230
| <button | ||
| type="button" | ||
| onClick={() => setShowConfirm(!showConfirm)} | ||
| className="absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-200 transition-colors" | ||
| tabIndex={-1} | ||
| aria-label={showConfirm ? "Hide password" : "Show password"} | ||
| > |
Comment on lines
+9
to
+10
| const body = await request.json(); | ||
| const { indexNumber, password } = body; |
Comment on lines
+9
to
+10
| const body = await request.json(); | ||
| const { username, password } = body; |
Comment on lines
+27
to
+28
| const body = await request.json(); | ||
| const { currentPassword, newPassword } = body; |
Comment on lines
+1
to
+6
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <project version="4"> | ||
| <component name="VcsDirectoryMappings"> | ||
| <mapping directory="" vcs="Git" /> | ||
| </component> | ||
| </project> No newline at end of file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.