This document outlines the new registration check-in feature added to the HackX 2.0 platform.
Users now have a registration check-in status displayed on their profile page. This allows:
- Registration Desk Admins: Scan user QR codes at registration to mark check-in
- Users: See their check-in status on their profile page
- System: Track who has checked in for the hackathon
- Table:
registration_logs - Fields:
id- UUID primary keyuser_id- References the user (UNIQUE - one check-in per user)checked_in_at- When they checked inscanned_by- Admin ID who processed the check-in
The user profile now displays two status sections:
Registration Check-In Status
- Shows if user has checked in at registration desk
- Displays checkmark (✓) when checked in
- Located above the food checklist
Food Checklist (Existing)
- Shows meals collected (unchanged)
app/providers/auth-provider.tsx - Profile type remains compatible
app/profile/page.tsx
- Added
registrationCheckedstate - Added
fetchingRegistrationstate - Fetches registration status on profile load
- Displays registration check-in card with status
- User logs in and goes to
/profile - Sees "Check-In Status" section
- If not checked in: Shows pending status
- If checked in: Shows "Checked In" confirmation
- Use
/scanpage to scan user QR codes - Select "registration" mode (to be implemented)
- Scan user QR codes to mark them as checked in
- System confirms check-in
Before deploying, you must apply these migrations in order:
-
Avatar Gender Migration (if not already applied)
- File:
scripts/add_avatar_gender_migration.sql
- File:
-
Registration Logs Table
- File:
scripts/add_registration_logs_table.sql - Creates the registration_logs table
- Sets up RLS policies
- File:
The scan page will need to be updated to support registration check-ins:
// Pseudo-code for scan page enhancement
const [scanType, setScanType] = useState<'food' | 'registration'>('food');
// If registration mode:
// - Insert into registration_logs instead of food_logs
// - Show different success message
// - Display check-in confirmation
const handleRegistrationScan = async (userId: string) => {
await supabase
.from('registration_logs')
.upsert({
user_id: userId,
checked_in_at: new Date().toISOString(),
scanned_by: user?.id
}, {
onConflict: 'user_id'
});
toast.success(`✓ ${participantName} checked in!`);
};-
scripts/setup_schema.sql
- Added registration_logs table definition
-
scripts/add_registration_logs_table.sql (NEW)
- Migration to create registration_logs table and policies
-
scripts/MIGRATION_README.md
- Updated with registration logs information
-
app/profile/page.tsx
- Added registration check-in display
- Added fetch for registration status
- Added state management for registration data
-
README.md
- Updated database setup instructions
- Apply all database migrations successfully
- Profile page loads without errors
- Registration check-in status displays correctly
- Food checklist still works
- Build compiles successfully
The /scan page will be enhanced to:
- Add a toggle for "Food" vs "Registration" mode
- Support registration desk check-ins
- Provide appropriate feedback for each scan type
- Track both food logs and registration logs
- Ensure database migrations are applied before deploying code
- All users will initially show "Not Checked In"
- Check-in status becomes available once scanned at registration desk
- Changes are backward compatible with existing food log functionality