Skip to content

Conversation

@codeunia-dev
Copy link
Owner

@codeunia-dev codeunia-dev commented Nov 19, 2025

  • Create GET endpoint to fetch hackathon registrations with search, filtering, and pagination support
  • Implement CSV export functionality for hackathon registrations with proper authorization checks
  • Add registrations dashboard page for hackathon management
  • Support filtering by registration status and payment status
  • Include search capability across registration fields (name, email, phone, institution)
  • Implement proper authorization checks to ensure only company members can access registrations
  • Use service role client for master_registrations table to bypass RLS policies
  • Add pagination support with limit and offset parameters
  • Generate timestamped CSV exports with all registration details

Authored by: @akshay0611

Summary by CodeRabbit

  • New Features
    • Added a dedicated hackathon registration management dashboard with search and filtering capabilities by status and payment information.
    • Enabled inline status and payment updates for individual registrations with instant data refresh.
    • CSV export functionality for registration data.
    • Registration metrics display with participant contact information.

…dashboard page

- Create GET endpoint to fetch hackathon registrations with search, filtering, and pagination support
- Implement CSV export functionality for hackathon registrations with proper authorization checks
- Add registrations dashboard page for hackathon management
- Support filtering by registration status and payment status
- Include search capability across registration fields (name, email, phone, institution)
- Implement proper authorization checks to ensure only company members can access registrations
- Use service role client for master_registrations table to bypass RLS policies
- Add pagination support with limit and offset parameters
- Generate timestamped CSV exports with all registration details
@vercel
Copy link

vercel bot commented Nov 19, 2025

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

Project Deployment Preview Comments Updated (UTC)
codeunia Building Building Preview Comment Nov 19, 2025 6:45am

@codeunia-dev codeunia-dev merged commit df290ae into main Nov 19, 2025
2 of 4 checks passed
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 19, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This PR adds comprehensive hackathon registration management across three new files: a GET/PATCH API endpoint for retrieving and updating registrations with filtering, pagination, and user enrichment; a CSV export endpoint; and a dashboard UI page for viewing, filtering, and managing registrations with real-time status updates.

Changes

Cohort / File(s) Change Summary
API Registration Endpoints
app/api/hackathons/[id]/registrations/route.ts
Introduces GET handler to fetch registrations with search, status, and payment filtering, pagination, and profile enrichment; adds PATCH handler to update registration status/payment fields with role-based authorization checks.
API Export Endpoint
app/api/hackathons/[id]/registrations/export/route.ts
Implements GET handler to stream registrations as CSV with proper authentication, authorization, and content-disposition headers using hackathon slug and date in filename.
Dashboard UI
app/dashboard/company/[slug]/hackathons/[hackathonSlug]/registrations/page.tsx
Introduces client-side registrations management page with filtering (search, status, payment), stats display, sortable table with enriched participant data, status update controls, and CSV export button.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Dashboard
    participant API GET
    participant DB
    participant Supabase Auth

    User->>Dashboard: Load registrations page
    Dashboard->>API GET: GET /api/hackathons/[id]/registrations?search=X&status=Y
    API GET->>Supabase Auth: Verify session
    alt Not authenticated
        API GET-->>Dashboard: 401 Unauthorized
    else
        API GET->>DB: Query hackathon by slug
        alt Hackathon not found
            API GET-->>Dashboard: 404 Not Found
        else
            API GET->>DB: Verify user company membership
            alt Not authorized
                API GET-->>Dashboard: 403 Forbidden
            else
                API GET->>DB: Fetch master_registrations with filters & pagination
                API GET->>DB: Fetch user profiles for enrichment
                API GET->>API GET: Enrich registrations with profile data
                API GET-->>Dashboard: {registrations[], total, hackathon}
                Dashboard->>Dashboard: Render table with filters & stats
            end
        end
    end
Loading
sequenceDiagram
    participant User
    participant Dashboard
    participant API PATCH
    participant API Export
    participant DB
    participant Stream

    User->>Dashboard: Click update status dropdown
    Dashboard->>API PATCH: PATCH /api/hackathons/[id]/registrations {registration_id, status}
    API PATCH->>DB: Update master_registrations record
    alt Success
        API PATCH-->>Dashboard: {updated registration}
        Dashboard->>Dashboard: Refresh registrations list
    else Error
        API PATCH-->>Dashboard: 400/500 Error
    end

    User->>Dashboard: Click "Export to CSV"
    Dashboard->>API Export: GET /api/hackathons/[id]/registrations/export
    API Export->>DB: Fetch all registrations for hackathon
    API Export->>API Export: Build CSV with headers & rows
    API Export-->>Stream: Stream CSV file (text/csv)
    Stream-->>User: Download hackathon-slug-YYYY-MM-DD.csv
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • API GET endpoint: Multiple auth layers, service-role client usage, complex filtering/pagination logic, and profile enrichment requiring validation of query handling and DB queries
  • API PATCH endpoint: Authorization checks with RBAC (owner/admin/editor roles), update logic with conditional field application, and error scenarios
  • CSV export flow: Serialization logic, streaming headers, and filename generation edge cases
  • Dashboard integration: Client-side state management, filtering UI, real-time updates, and error handling across multiple API calls

Possibly related PRs

Poem

🐰 A hackathon's registrations bloom,
With filters, exports, and dashboard room—
Status updates hop and CSV streams flow,
User enrichment steals the show! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/hackathon

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8f72043 and 7ca79e9.

📒 Files selected for processing (3)
  • app/api/hackathons/[id]/registrations/export/route.ts (1 hunks)
  • app/api/hackathons/[id]/registrations/route.ts (1 hunks)
  • app/dashboard/company/[slug]/hackathons/[hackathonSlug]/registrations/page.tsx (1 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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