Skip to content

feat(admin): Implement Advanced Publication Management System#24

Merged
TKanX merged 32 commits intomainfrom
feature/23-implement-publication-management-with-doi-lookup-and-drag-sort
Feb 6, 2026
Merged

feat(admin): Implement Advanced Publication Management System#24
TKanX merged 32 commits intomainfrom
feature/23-implement-publication-management-with-doi-lookup-and-drag-sort

Conversation

@TKanX
Copy link
Copy Markdown
Member

@TKanX TKanX commented Feb 6, 2026

Summary:

Implemented a robust publication management system within the admin panel, featuring drag-and-drop reordering, auto-fill metadata via DOI lookup (OpenAlex/Crossref), and comprehensive list/detail views. This update also refactors the publication data model to support manual ordering via an index field and introduces a unified citation generation utility.

Changes:

  • Refactored Publication Data Model (prisma/schema.prisma):

    • Added an index integer field for custom ordering (replacing simple date-based sorting).
    • Changed primary key to a CUID id field for better compatibility with ORM relationships, while keeping doi as a unique optional field.
    • Updated relationships in MemberPublication and PublicationResearchArea to use the new id.
    • Updated seeding logic to populate the new index field.
  • Implemented Admin Publication Management (src/app/admin/(authenticated)/publications/):

    • Sortable List: Created PublicationList using @dnd-kit to allow drag-and-drop reordering of publications.
    • Form Dialog: Developed PublicationFormDialog with a "DOI Lookup" feature that auto-fills metadata (Title, Authors, Abstract, Journal, etc.) by fetching from OpenAlex or Crossref APIs.
    • Server Actions: Implemented CRUD actions (createPublication, updatePublication, deletePublication, reorderPublications) with transactional integrity for index updates.
  • Enhanced Public Views:

    • Updated PublicationCard and PublicationRow to use the new data structure.
    • Refactored PublicationDetailPage ([doi] -> [index]) to route by index for stable URLs even if DOIs change/are missing.
    • Added PublicationsWithFilters component combining the filter UI with the grouped-by-year list view.
  • Developed Publication Utilities (src/lib/publications/):

    • Created doi-lookup.ts service that orchestrates fetching from openalex and crossref.
    • Implemented citation.ts to generate formatted citations (APA, MLA, BibTeX) from publication data.
  • UI Improvements:

    • Added TagInput for managing multi-value fields like Authors and Journals with autocomplete support.
    • Integrated MemberPortrait for consistent avatar display across the app.

TKanX added 30 commits February 5, 2026 20:36
@TKanX TKanX self-assigned this Feb 6, 2026
Copilot AI review requested due to automatic review settings February 6, 2026 22:25
@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
9 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

Implements a full admin publication management workflow (CRUD + drag-and-drop ordering) and adds DOI metadata lookup via OpenAlex/Crossref, while refactoring the Publication model to use a stable id primary key and an index ordering field.

Changes:

  • Added DOI lookup clients/services (OpenAlex + Crossref) with shared normalization/utilities.
  • Introduced admin publications UI (list, row, form dialog) and server actions including reorder + distinct-value helpers.
  • Refactored publication routing and related queries/utilities to use index and to allow nullable DOIs.

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/lib/publications/shared.ts Shared DOI client types/constants + normalization helper.
src/lib/publications/openalex.ts OpenAlex DOI metadata fetch + parsing.
src/lib/publications/index.ts Barrel exports for publication lookup utilities.
src/lib/publications/doi-lookup.ts Unified DOI lookup (OpenAlex first, Crossref fallback).
src/lib/publications/crossref.ts Crossref DOI metadata fetch + parsing.
src/lib/metadata.ts Publication metadata generation updated to use index path + optional DOI.
src/lib/db/queries/research.ts Research stats dedupe updated from DOI to publication ID.
src/lib/db/queries/publications.ts Static params + detail query refactored from DOI to index.
src/lib/citation.ts Citation formatting updated to support nullable DOI and cleaner BibTeX output.
src/lib/admin/schemas/index.ts Added publication + DOI lookup schemas with DOI normalization transforms.
src/lib/admin/actions/types.ts Added PublicationFormData type for admin forms/actions.
src/lib/admin/actions/publications.ts New publications server actions (CRUD, reorder, DOI lookup, distinct journals/authors).
src/lib/admin/actions/index.ts Exported publication actions/types from admin actions entrypoint.
src/lib/admin/actions/dashboard.ts Dashboard “recent publications” now includes id/index and nullable DOI.
src/components/publication/publications-by-year.tsx React key updated to publication id.
src/components/publication/publication-card.tsx Detail routing switched to index; DOI link made conditional; shows index in UI.
src/components/admin/shared/tag-input.tsx New TagInput component with suggestions + keyboard support.
src/components/admin/shared/skeletons.tsx Added publication list skeleton UI.
src/components/admin/shared/index.ts Re-exported TagInput + PublicationListSkeleton.
src/components/admin/layout/sidebar-nav.tsx Added “Publications” entry in admin sidebar nav.
src/app/admin/(authenticated)/publications/page.tsx Admin publications page wiring (fetch list + distinct values).
src/app/admin/(authenticated)/publications/loading.tsx Loading skeleton for admin publications page.
src/app/admin/(authenticated)/publications/_components/publication-row.tsx Sortable row UI for a single publication.
src/app/admin/(authenticated)/publications/_components/publication-list.tsx Main admin list UI with search, DnD reorder, CRUD dialogs.
src/app/admin/(authenticated)/publications/_components/publication-form-dialog.tsx Create/edit dialog with DOI lookup autofill.
src/app/admin/(authenticated)/publications/_components/index.ts Barrel exports for admin publications components.
src/app/admin/(authenticated)/_components/stats-grid.tsx Publications stat card links to /admin/publications.
src/app/(public)/publications/[index]/page.tsx Public publication detail route switched to [index] + static params by index.
src/app/(public)/page.tsx Home “recent publications” list updated to include index and route by index.
prisma/seed.ts Seed now populates index and uses publicationId in junction tables.
prisma/schema.prisma Publication PK changed to CUID id, added unique index, DOI optional unique, updated relations.
Comments suppressed due to low confidence (1)

src/app/(public)/publications/[index]/page.tsx:50

  • Routing publication detail pages by the mutable index (which is reassigned on reorder/delete) will make public URLs unstable and can break existing links/SEO. Consider routing by the stable Publication.id (or DOI when present) and treat index strictly as an ordering field; if you need backward compatibility, add redirects from the old pattern.

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

Comment thread src/lib/publications/shared.ts
Comment thread src/lib/admin/actions/publications.ts
Comment thread src/lib/admin/actions/publications.ts
Comment thread src/lib/db/queries/publications.ts
Comment thread src/lib/admin/schemas/index.ts
Comment thread src/lib/admin/schemas/index.ts
@TKanX TKanX merged commit 8d1494a into main Feb 6, 2026
8 checks passed
@TKanX TKanX deleted the feature/23-implement-publication-management-with-doi-lookup-and-drag-sort branch February 6, 2026 22:48
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 Publication Management with DOI Lookup and Drag-Sort

2 participants