feat(admin): Implement Admin Panel Dashboard and CRUD Operations#22
Merged
feat(admin): Implement Admin Panel Dashboard and CRUD Operations#22
Conversation
…or year retrieval using getYear utility
…use date utilities for year handling
…y for consistency in publication stats
…lity for year filtering
…lity for year extraction
…r better organization
…ar utility for consistency
…ity for consistency
…ity for consistency
…y for consistency
…lity for consistency
…nd error handling
… accounts with CRUD operations
…dministrator accounts
…nd error handling
…ting functionality
…t activity section
…d cumulative publication counts
…added members and publications
…lications, and recent activity
7 tasks
There was a problem hiding this comment.
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
Dateobjects 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
AuthKeepAlivecomponent 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.
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.
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):StatsGriddisplaying key metrics for all content types.PublicationChartusingrechartsto show publication trends over time.RecentActivityto show the latest member additions and publications.Developed CRUD Modules:
MemberFormDialogwith image cropping/upload, category assignment, and profile management.CategoryListwith reorderable interface for managing member groups.ResearchListsupporting hierarchical (parent/child) structure management.CollaboratorFormDialogfeaturing an interactiveLocationPickermap (Leaflet) for geocoding.PhotoListwith batch upload capability, drag-and-drop reordering, and year-based grouping.Enhanced Admin UI/UX:
Sidebarnavigation and mobile drawer.@dnd-kitfor drag-and-drop reordering across lists.react-hook-form+zodfor robust form validation.sonnerfor toast notifications and optimistic UI patterns (useOptimisticList) for instant feedback.ConfirmDialog,EmptyState,AvatarUpload(with cropping), andMarkdownEditor.Backend Logic (
src/lib/admin/actions/):src/lib/admin/image/) usingsharpfor resizing and format conversion.src/lib/admin/schemas/.Refactored Date Handling (
src/lib/date.ts):Dateobjects to ISO date strings (YYYY-MM-DD) across the schema and application for consistent timezone-agnostic handling.Authentication Improvements:
AuthKeepAlivecomponent to handle silent token refreshing.Dependencies:
recharts,@dnd-kit/*,react-hook-form,zod,sharp,leaflet,react-image-crop,sonner,@uiw/react-md-editor,@radix-ui/*.