Skip to content

Add admin project#1636

Merged
ErikaKK merged 42 commits into
masterfrom
add-admin-project
Sep 5, 2025
Merged

Add admin project#1636
ErikaKK merged 42 commits into
masterfrom
add-admin-project

Conversation

@ErikaKK

@ErikaKK ErikaKK commented Aug 16, 2025

Copy link
Copy Markdown
Contributor

Change Summary

[Briefly summarise the changes that you made. Just high-level stuff]

  • Added project table in db
  • Added project in admin dashboard
image image image image - Added dashboard for login users image - Added api in projects page to get data from database - users can apply project by visit google form link - image

Change Form

Fill this up (NA if not available). If a certain criteria is not met, can you please give a reason.

  • The pull request title has an issue number
  • The change works by "Smoke testing" or quick testing
  • The change has tests
  • The change has documentation

Other Information

[Is there anything in particular in the review that I should be aware of?]

@ErikaKK ErikaKK linked an issue Aug 16, 2025 that may be closed by this pull request
@vercel

vercel Bot commented Aug 16, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
website Ready Ready Preview Comment Sep 5, 2025 5:11pm

@ErikaKK ErikaKK requested a review from Julie-Salazar August 16, 2025 16:41

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

This PR adds a comprehensive project management system to the application, including database schema, admin interface, and user dashboard functionality.

  • Adds project table to database with comprehensive project information tracking
  • Implements admin dashboard for project CRUD operations with form-based management
  • Creates user dashboard showing project participation and application opportunities

Reviewed Changes

Copilot reviewed 50 out of 51 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/server/db/schema.ts Adds Project table schema with all necessary fields and enums
src/server/api/routers/projects/ Creates project API endpoints for public access and user queries
src/server/api/routers/admin/projects/ Implements admin-only project management endpoints
src/app/dashboard/admin/@projects/ Admin UI components for project creation, editing, and management
src/app/dashboard/(root)/ User dashboard showing project participation and applications
src/app/projects/ Updates project pages to support database-driven content

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

application_url: input.application_url?.trim() ?? null,
is_public: input.is_public ?? false,
})
.where(eq(Project.name, input.name))

Copilot AI Sep 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The update operation is filtering by input.name but should filter by input.id to ensure the correct project is updated. Using name could update the wrong project if names are changed.

Suggested change
.where(eq(Project.name, input.name))
.where(eq(Project.id, input.id))

Copilot uses AI. Check for mistakes.
Comment thread src/server/api/routers/admin/projects/update.ts Outdated
Comment thread src/app/projects/[id]/tech-list.tsx
Comment thread src/app/projects/[id]/tech-list.tsx
Comment thread src/server/api/routers/admin/projects/create.ts Outdated
Comment thread src/app/dashboard/admin/@projects/project-form.tsx Outdated

This comment was marked as outdated.

@ErikaKK ErikaKK requested a review from Copilot September 4, 2025 15:17

This comment was marked as outdated.

@SafetyInObscurity

Copy link
Copy Markdown

Looks good, but maybe we should check that the logo and images exist before accepting them? Otherwise we get broken image links when displaying them.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

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

This PR introduces a comprehensive project management system with database integration, admin dashboard functionality, and user-facing project discovery features.

Key changes:

  • Database schema extension with new Project table and related types/enums
  • Admin dashboard for project CRUD operations with form validation
  • Public project display and user dashboard for project discovery and applications

Reviewed Changes

Copilot reviewed 49 out of 50 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
Database files Added Project table schema, migrations, and type definitions
Admin router/API Created project management endpoints for CRUD operations
Public API Added endpoints for public project retrieval and user project queries
Admin dashboard Built comprehensive project management UI with forms and validation
User dashboard Added project discovery and application features
Project pages Enhanced to support both static and database-driven projects
UI components Updated dialog and command components for better UX

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

application_url: input.application_url?.trim() ?? null,
is_public: input.is_public ?? false,
})
.where(eq(Project.name, input.name))

Copilot AI Sep 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WHERE clause uses Project.name but should use Project.id since the input contains an id field and the function is updating by ID, not name. Using name could update the wrong project if names are changed.

Suggested change
.where(eq(Project.name, input.name))
.where(eq(Project.id, input.id))

Copilot uses AI. Check for mistakes.
is_public: values.is_public,
logo_path: values.logo_path.trim(),
img_path: values.img_path?.trim(),
id: formDefaultValues.id ?? "",

Copilot AI Sep 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty string is passed as fallback for ID, but the update mutation expects a valid UUID. This could cause database errors when trying to update without a proper ID.

Copilot uses AI. Check for mistakes.
ref={ref}
className={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
"fixed left-[50%] top-[50%] z-50 w-full max-w-5xl translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",

Copilot AI Sep 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The grid class was removed from this component. This could break layouts that depend on grid behavior in dialogs. Consider if this change affects other dialog usage throughout the application.

Suggested change
"fixed left-[50%] top-[50%] z-50 w-full max-w-5xl translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",
"fixed left-[50%] top-[50%] z-50 w-full max-w-5xl translate-x-[-50%] translate-y-[-50%] grid gap-4 border bg-background p-6 duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%]",

Copilot uses AI. Check for mistakes.
Comment thread src/server/db/types.ts
export type User = typeof User.$inferSelect

export type Payment = typeof User.$inferSelect
export type Payment = typeof Payment.$inferSelect

Copilot AI Sep 5, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line was corrected from using User to Payment, which fixes the incorrect type inference for the Payment type.

Suggested change
export type Payment = typeof Payment.$inferSelect
export type PaymentType = typeof Payment.$inferSelect

Copilot uses AI. Check for mistakes.
@ErikaKK ErikaKK merged commit 3e13a87 into master Sep 5, 2025
10 checks passed
@ErikaKK ErikaKK deleted the add-admin-project branch September 5, 2025 17:22
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.

Create work flow for project registration

3 participants