Skip to content

UI added and Login page added#1

Merged
indubrolk merged 1 commit into
mainfrom
indu
Jun 2, 2026
Merged

UI added and Login page added#1
indubrolk merged 1 commit into
mainfrom
indu

Conversation

@indubrolk

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 2, 2026 11:12

@indubrolk indubrolk left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Done

@indubrolk indubrolk merged commit f87abfb into main Jun 2, 2026
1 check 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 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 thread app/admin/login/page.tsx
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 thread .idea/vcs.xml
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
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