Conversation
There was a problem hiding this comment.
Pull request overview
Implements an admin-facing dashboard and student management views in the Next.js app, adding supporting API routes to fetch student GPA/FGPA-derived metrics and recent upload activity.
Changes:
- Added admin JWT helper (
getAdminFromRequest) and new admin API routes for dashboard stats and student listing/detail. - Introduced admin UI pages for the dashboard, student list (search/filter/pagination), and per-student academic record drill-down.
- Added a responsive admin sidebar navigation component.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| lib/adminAuth.ts | Adds helper to authenticate/authorize admin requests via JWT cookie. |
| components/admin/AdminSidebar.tsx | Introduces responsive admin navigation sidebar with logout. |
| app/api/admin/students/route.ts | Adds admin endpoint to list students with computed FGPA/class/pass status and filtering. |
| app/api/admin/students/[index]/route.ts | Adds admin endpoint to fetch a student’s detailed academic record grouped by year/semester. |
| app/api/admin/dashboard/stats/route.ts | Adds admin endpoint to fetch dashboard aggregates + recent uploads + at-risk count. |
| app/admin/students/page.tsx | Adds students list UI with search, filtering, pagination, and drill-down. |
| app/admin/students/[index]/page.tsx | Adds student detail UI with FGPA breakdown and accordions for academic record. |
| app/admin/dashboard/page.tsx | Adds admin dashboard UI with stats cards and recent uploads table. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| `} | ||
| > | ||
| <Icon | ||
| className={`h-4.5 w-4.5 flex-shrink-0 transition-colors ${ |
Comment on lines
+245
to
+247
| <th className="px-5 py-3 text-left text-xs font-medium text-slate-400 uppercase tracking-wider"> | ||
| Subjects Done | ||
| </th> |
Comment on lines
+29
to
+33
| const page = Math.max(1, parseInt(searchParams.get("page") || "1", 10)); | ||
| const limit = Math.min( | ||
| 100, | ||
| Math.max(1, parseInt(searchParams.get("limit") || "20", 10)) | ||
| ); |
Comment on lines
+59
to
+63
| const allStudentRows = await studentQuery; | ||
|
|
||
| // ── 2. Fetch all results with subject + semester info ──────────────── | ||
| const allResults = await db | ||
| .select({ |
Comment on lines
+45
to
+49
| const allResults = await db | ||
| .select({ | ||
| studentIndex: results.studentIndex, | ||
| gradePoint: results.gradePoint, | ||
| creditPoints: subjects.creditPoints, |
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.
…outes