Skip to content

feat: implement admin dashboard with student metrics and management r…#4

Merged
indubrolk merged 1 commit into
indufrom
main
Jun 2, 2026
Merged

feat: implement admin dashboard with student metrics and management r…#4
indubrolk merged 1 commit into
indufrom
main

Conversation

@indubrolk

Copy link
Copy Markdown
Owner

…outes

Copilot AI review requested due to automatic review settings June 2, 2026 17:52

@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 63b205f into indu 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

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,
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.

3 participants