-
Notifications
You must be signed in to change notification settings - Fork 2
Fix/companyhackathons — Improve Hackathon Tracking & Add Registration Endpoints #339
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ndpoints - Update track-click endpoint to query hackathons by slug instead of id - Update track-view endpoint to query hackathons by slug instead of id - Clarify comments to indicate id param is actually the slug value - Fix incorrect database queries that were using wrong field for lookup
- Create new POST endpoint for hackathon registration with capacity and approval checks - Create new DELETE endpoint for hackathon unregistration with count decrement - Add registration state management and UI controls to hackathon detail page - Implement master_registrations table integration for tracking user registrations - Add validation for hackathon approval status and live/published state before registration - Update hackathon registered count on successful registration and unregistration - Add user profile data capture (name, email, phone) during registration - Implement duplicate registration prevention and capacity limit enforcement - Add toast notifications for registration success and error states - Change approved hackathon status from 'published' to 'live' for consistency
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Caution Review failedThe pull request is closed. WalkthroughThis PR implements hackathon registration functionality, adding backend endpoints for user registration and unregistration, updates analytics tracking to use slug-based lookups, refines the moderation approval status, and adds registration UI with state management to the hackathon detail page. Changes
Sequence DiagramsequenceDiagram
participant User as User<br/>(Client)
participant Page as Hackathon Page<br/>(app/hackathons/[id])
participant RegAPI as Registration API<br/>(/register)
participant DB as Database<br/>(Supabase)
rect rgba(100, 150, 200, 0.1)
Note over User,Page: User Registration Flow
User->>Page: Click "Register Now"
Page->>Page: Set registering = true
Page->>RegAPI: POST /api/hackathons/[id]/register
RegAPI->>DB: Verify user authenticated
RegAPI->>DB: Check hackathon status (live/published)
RegAPI->>DB: Verify capacity & no duplicate
RegAPI->>DB: Create master_registrations entry
RegAPI->>DB: Increment hackathon registered count
DB-->>RegAPI: Success
RegAPI-->>Page: 200 OK
Page->>Page: Set isRegistered = true
Page->>User: Show toast confirmation
Page->>Page: Refresh hackathon data
end
rect rgba(200, 100, 100, 0.1)
Note over User,Page: User Unregistration Flow
User->>Page: Click "Unregister"
Page->>Page: Set registering = true
Page->>RegAPI: DELETE /api/hackathons/[id]/register
RegAPI->>DB: Verify user authenticated
RegAPI->>DB: Delete master_registrations entry
RegAPI->>DB: Decrement hackathon registered count
DB-->>RegAPI: Success
RegAPI-->>Page: 200 OK
Page->>Page: Set isRegistered = false
Page->>User: Show toast confirmation
Page->>Page: Refresh hackathon data
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Key areas requiring extra attention:
Possibly related PRs
Poem
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (5)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. 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. Comment |
This PR introduces critical fixes and feature improvements to the hackathons module.
It resolves issues with event tracking, improves the reliability of click/view analytics, and adds full support for user registration and unregistration flows.
🔧 Key Fixes & Enhancements
1. Fix: Use
sluginstead ofidfor hackathon trackingslugrather than the internalid.2. Feature: Added user registration & unregistration endpoints
Introduced new API routes for:
Full validation and permission checks added.
Updates related counters/relations to ensure accurate tracking.
Prepares backend for upcoming UI integration in the dashboard.
📁 Files Updated
Includes updates in:
🧪 Testing & Validation
🚀 Impact
This update improves:
Authored by: @akshay0611
Summary by CodeRabbit