Create a dedicated Gmail account for your Before We Go application, e.g., beforewego.app@gmail.com
- Go to your Google Account settings
- Navigate to "Security"
- Enable "2-Step Verification"
- In Google Account settings, go to "Security"
- Under "2-Step Verification", click "App passwords"
- Select "Mail" as the app and generate a password
- Copy the 16-character app password (remove spaces)
Update your .env file with your Gmail credentials:
# Gmail SMTP Configuration
GMAIL_USER=your-email@gmail.com
GMAIL_APP_PASSWORD=your-16-character-app-password
# Email Configuration
FROM_EMAIL=your-email@gmail.com
FROM_NAME="Before We Go"# Gmail SMTP Configuration
GMAIL_USER=beforewego.app@gmail.com
GMAIL_APP_PASSWORD=abcd efgh ijkl mnop
# Email Configuration
FROM_EMAIL=beforewego.app@gmail.com
FROM_NAME="Before We Go - Time Capsule Letters"- Sends HTML-formatted verification emails
- 6-digit verification codes
- 15-minute code expiration
- Professional email templates
- Maximum 3 verification emails per hour per email address
- Prevents spam and abuse
- All verification codes are stored in database
- Codes are marked as verified when used
- Expired codes are automatically cleaned up
- Users can request new codes if not received
- Subject to same rate limiting rules
- Codes expire after 15 minutes
- Used codes cannot be reused
- Automatic cleanup of expired codes
- Email-specific verification
- Set up Gmail credentials in
.envfile - Start the development server:
pnpm dev - Navigate to registration:
http://localhost:5173/register - Complete the flow:
- Enter name and graduation year
- Enter school email (real email address)
- Check your email for verification code
- Enter the 6-digit code
- Repeat for personal email
- Create password and complete registration
The system sends beautifully formatted HTML emails with:
- Professional branding
- Large, easy-to-read verification codes
- Clear instructions
- Branded header and footer
- Mobile-friendly design
- Invalid Gmail credentials: Clear error message
- Rate limiting: User-friendly rate limit messages
- Email sending failures: Graceful fallback with helpful error messages
- Invalid codes: Clear validation messages
- Use a dedicated Gmail account for the application
- Monitor email sending limits (Gmail has daily sending limits)
- Consider upgrading to Gmail API for higher volume
- Set up proper DNS/SPF records if using custom domain
- Monitor delivery rates and spam folder placement
- "Authentication failed": Check app password is correct
- "Rate limited": Wait an hour or check rate limiting logic
- Emails in spam: Check email content and sender reputation
- Codes not working: Verify database connection and code expiration
Set NODE_ENV=development to see verification codes logged to console for testing.