A full-stack application for managing hackathon attendees and sending email credits to checked-in participants.
- 📊 Upload attendee CSV data
- ✅ Track checked-in attendees
- 🎟️ Assign redemption codes to attendees
- 📧 Send automated emails with credits
- 📈 View email statistics and history
- 🗄️ PostgreSQL database with Drizzle ORM
- Frontend: React + TypeScript + Vite + Tailwind CSS
- Backend: Hono (Node.js) + TypeScript
- Database: PostgreSQL with Drizzle ORM
- Email: Resend API
- Package Manager: pnpm
Before you begin, ensure you have the following installed:
git clone <repository-url>
cd send-hackathon-codeInstall dependencies for both frontend and backend:
# Install frontend dependencies
pnpm install
# Install backend dependencies
cd backend
pnpm install
cd ..Create environment files based on the example:
cp .env.example .env.localEdit .env.local with your actual values:
# Database Configuration
DATABASE_URL=postgres://postgres:postgres@localhost:54320/send_hackathon
# Resend Email Service
RESEND_API_KEY=re_your_actual_resend_api_key_here
MAIL_FROM=your-email@yourdomain.com
# Server Configuration
PORT=8787
CORS_ORIGIN=http://localhost:5173Required Environment Variables:
DATABASE_URL: PostgreSQL connection stringRESEND_API_KEY: Get from Resend.com - refer to latest Resend docs for API key setupMAIL_FROM: Verified sender email address in Resend - refer to latest Resend docs for custom domain setupPORT: Backend server port (default: 8787)CORS_ORIGIN: Frontend URL for CORS (default: http://localhost:5173)
Using Docker Compose:
docker-compose up -dThis will start a PostgreSQL database on localhost:54320.
Navigate to the backend directory and run the database migrations:
cd backend
pnpm db:push
cd ..This creates the necessary tables (attendees and sent_emails).
From the root directory, run both frontend and backend servers in parallel:
pnpm devThis will automatically start:
- Backend server on
http://localhost:8787 - Frontend server on
http://localhost:5173(opens in browser automatically)
Alternative - Run Servers Separately:
If you prefer to run them separately for debugging:
# Terminal 1 - Backend only
pnpm dev:backend
# Terminal 2 - Frontend only
pnpm dev:frontendBefore uploading data to the app, you need to export your attendee list from Luma:
-
Access Your Event in Luma:
- Go to Luma and navigate to your event
- Go to the event management dashboard
-
Filter for Checked-in Attendees:
- In the attendees section, apply filters to show only checked-in attendees
- This ensures you only process people who actually attended the event
-
Export the Data:
- Look for an "Export" or "Download" option
- Export the attendee list as a CSV file
- The exported CSV should include:
email,first_name,last_name, andchecked_in_atcolumns
-
Verify CSV Format:
- Ensure your CSV has the required columns:
email: Attendee email addressfirst_name: First namelast_name: Last namechecked_in_at: Check-in timestamp
- Ensure your CSV has the required columns:
- Navigate to
http://localhost:5173 - Upload a CSV file with attendee data
- Required CSV columns:
email: Attendee email addressfirst_name: First namelast_name: Last namechecked_in_at: Check-in timestamp (empty string for not checked in)
- Paste redemption codes (one per line) in the "Assign Codes" section
- Click "Assign Codes" to distribute them to checked-in attendees
- Set a custom hackathon event name
- Preview the email template
- Click "Send Emails" to send credits to all checked-in attendees with assigned codes
- Monitor the progress and view sent email history
The dashboard shows:
- Total attendees uploaded
- Number of checked-in attendees
- Attendees with assigned codes
- Emails sent successfully
The backend provides the following REST API endpoints:
POST /api/attendees/upload- Upload CSV attendee dataGET /api/attendees/checked-in- Get checked-in attendeesPOST /api/attendees/assign-codes- Assign redemption codesGET /api/attendees/assignment-preview- Preview code assignmentsPOST /api/emails/send- Send emails to attendeesGET /api/sent-emails- Get sent email historyGET /api/stats- Get system statisticsPOST /api/attendees/delete-all- Delete all attendeesDELETE /api/attendees/:id- Delete specific attendee
id: Primary keyemail: Email addressfirstName: First namelastName: Last namecheckedInAt: Check-in timestampassignedCode: Redemption codeemailSent: Boolean flagcreatedAt: Creation timestamp
id: Primary keyemail: Recipient emailfirstName: First namelastName: Last nameredemptionLink: Redemption code/linkeventName: Event namecheckedInAt: Original check-in timesentAt: Email sent timestamp
Database Connection Error:
- Ensure PostgreSQL is running:
docker-compose ps - Check the
DATABASE_URLin.env.local - Restart the database:
docker-compose restart
Email Sending Fails:
- Verify your Resend API key is valid
- Ensure
MAIL_FROMis a verified domain in Resend - Check Resend dashboard for error logs
Frontend Can't Connect to Backend:
- Ensure backend is running on port 8787
- Check
CORS_ORIGINmatches frontend URL - Verify no firewall blocking the connection
Environment Variables Not Loading:
- Ensure
.env.localexists in the root directory - Check file permissions
- Restart the development servers
Backend Logs:
cd backend
pnpm dev
# Watch server logs for errorsDatabase Logs:
docker-compose logs postgresFrontend Logs: Open browser developer console (F12) to see client-side errors.
