Skip to content

feat(admin): Implement Admin Panel Dashboard and CRUD Operations#22

Merged
TKanX merged 169 commits intomainfrom
feature/21-implement-admin-panel-crud-operations
Feb 6, 2026
Merged

feat(admin): Implement Admin Panel Dashboard and CRUD Operations#22
TKanX merged 169 commits intomainfrom
feature/21-implement-admin-panel-crud-operations

Conversation

@TKanX
Copy link
Copy Markdown
Member

@TKanX TKanX commented Feb 6, 2026

Summary:

Implemented the complete Admin Panel functionality, providing a comprehensive interface for managing all site content. This includes a robust dashboard with real-time statistics and visualizations, along with full CRUD (Create, Read, Update, Delete) capabilities for Members, Publications (placeholder), Research Areas, Collaborators, Group Photos, and Administrators. The system features drag-and-drop reordering, image processing, and optimistic UI updates for a seamless user experience.

Changes:

  • Implemented Admin Dashboard (src/app/admin/(authenticated)/page.tsx):

    • Overview Stats: Created StatsGrid displaying key metrics for all content types.
    • Data Visualization: Integrated PublicationChart using recharts to show publication trends over time.
    • Activity Feed: Added RecentActivity to show the latest member additions and publications.
  • Developed CRUD Modules:

    • Members: MemberFormDialog with image cropping/upload, category assignment, and profile management.
    • Categories: CategoryList with reorderable interface for managing member groups.
    • Research Areas: ResearchList supporting hierarchical (parent/child) structure management.
    • Collaborators: CollaboratorFormDialog featuring an interactive LocationPicker map (Leaflet) for geocoding.
    • Photos: PhotoList with batch upload capability, drag-and-drop reordering, and year-based grouping.
    • Admins: Management interface for creating/editing admin accounts and role assignment.
  • Enhanced Admin UI/UX:

    • Layout: Implemented a responsive Sidebar navigation and mobile drawer.
    • Interactivity: Integrated @dnd-kit for drag-and-drop reordering across lists.
    • Forms: Used react-hook-form + zod for robust form validation.
    • Feedback: Added sonner for toast notifications and optimistic UI patterns (useOptimisticList) for instant feedback.
    • Shared Components: Created reusable admin components: ConfirmDialog, EmptyState, AvatarUpload (with cropping), and MarkdownEditor.
  • Backend Logic (src/lib/admin/actions/):

    • Implemented secure Server Actions for all data mutations.
    • Added image processing pipeline (src/lib/admin/image/) using sharp for resizing and format conversion.
    • Centralized Zod validation schemas in src/lib/admin/schemas/.
  • Refactored Date Handling (src/lib/date.ts):

    • Migrated from Date objects to ISO date strings (YYYY-MM-DD) across the schema and application for consistent timezone-agnostic handling.
    • Updated Prisma schema and seed data accordingly.
  • Authentication Improvements:

    • Added AuthKeepAlive component to handle silent token refreshing.
    • Refined middleware to support public assets and secure routes.
  • Dependencies:

    • Added: recharts, @dnd-kit/*, react-hook-form, zod, sharp, leaflet, react-image-crop, sonner, @uiw/react-md-editor, @radix-ui/*.

TKanX added 30 commits February 1, 2026 15:50
TKanX added 22 commits February 5, 2026 13:27
@TKanX TKanX self-assigned this Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 00:28
@TKanX TKanX added the enhancement ✨ New feature or request label Feb 6, 2026
@TKanX TKanX linked an issue Feb 6, 2026 that may be closed by this pull request
7 tasks
Copy link
Copy Markdown

Copilot AI left a comment

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 implements a comprehensive Admin Panel for the research group website with a complete dashboard, CRUD operations for all content types, and a major refactoring of date handling from JavaScript Date objects to ISO date strings (YYYY-MM-DD). The implementation includes drag-and-drop reordering, image processing with Sharp, real-time statistics visualization using Recharts, and optimistic UI updates for seamless user experience.

Changes:

  • Migrated date handling from Date objects to ISO date strings across schema, types, and application code
  • Built complete admin panel with dashboard, sidebar navigation, and CRUD interfaces for Members, Categories, Research Areas, Collaborators, Photos, and Administrators
  • Refactored authentication middleware to handle token refresh client-side via AuthKeepAlive component instead of middleware redirects

Reviewed changes

Copilot reviewed 142 out of 143 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/lib/date.ts New date utilities library with ISO string-based operations
src/lib/auth/middleware.ts Simplified to only check access tokens; refresh moved client-side
src/lib/admin/* Complete admin library with actions, hooks, schemas, and image processing
src/components/ui/* New UI components (dialog, form, checkbox, switch, etc.)
src/components/admin/* Admin panel components (dashboard, layout, shared utilities)
src/app/admin/(authenticated)/* Admin pages for dashboard and content management
src/app/api/auth/refresh/route.ts Changed from GET to POST with JSON response
prisma/schema.prisma Date fields changed from DateTime to String
package.json Added dependencies for admin features (dnd-kit, recharts, sharp, etc.)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/admin/layout/sidebar-footer.tsx
@TKanX TKanX merged commit f79c2af into main Feb 6, 2026
8 checks passed
@TKanX TKanX deleted the feature/21-implement-admin-panel-crud-operations branch February 6, 2026 00:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Admin Panel CRUD Operations

2 participants