A comprehensive QR code-based emergency medical information system built with Next.js, Supabase, and TypeScript.
- User Authentication - Secure email/password authentication with Supabase
- Emergency Data Dashboard - Manage personal profile, emergency contacts, and medical information
- QR Code Generation - Generate unique QR codes linking to emergency data pages
- Public Emergency Pages - First responder-optimized pages displaying critical information
- Scan Tracking - Monitor when and where your QR code is accessed
- Two-Factor Authentication (2FA) - TOTP-based 2FA with authenticator apps
- Password-Protected Personal Data - Additional encryption layer for sensitive documents
- Row Level Security (RLS) - Database-level security ensuring data privacy
- Activity Logging - Comprehensive audit trail of all system actions
- Admin Panel - User management, analytics, and system monitoring
- Multi-Language Support - English, Spanish, French, and German
- Data Export - Export emergency data as HTML or CSV
- Responsive Design - Optimized for mobile and desktop devices
The system uses the following main tables:
profiles- User profiles and preferencesemergency_contacts- Emergency contact informationmedical_info- Critical health data (blood type, allergies, medications)personal_data- Password-protected sensitive informationqr_codes- QR code records with scan trackingqr_scans- Individual scan eventspassword_protection- Encrypted passwords for personal dataactivity_log- System-wide audit trail
All tables have Row Level Security (RLS) enabled.
- Node.js 18+
- Supabase account
- npm or yarn
-
Run the database migration scripts in order:
001_create_schema.sql- Create tables and RLS policies002_create_profile_trigger.sql- Auto-create profiles on signup003_qr_scan_function.sql- QR scan tracking function004_create_first_admin.sql- Make first user an admin
-
Environment variables are already configured via Supabase integration
-
Start the development server and navigate to the app
- Create an account at
/auth/sign-up - Confirm your email address
- Run the admin script to make yourself an admin (optional)
- Complete your profile and emergency information
- Generate your QR code
- Download and print your QR code for wallet/keychain
- Dashboard - Access at
/dashboardto manage all information - QR Code - Generate and download from dashboard
- Security - Enable 2FA at
/dashboard/security - Personal Data - Access password-protected data at
/dashboard/personal-data - Export - Download your data from security settings
- Scan the QR code to access
/public/[userId] - View critical medical information without login
- Contact listed emergency contacts
- Information is optimized for high-stress situations
- Admin Panel - Access at
/admin - View all users and their data
- Monitor system activity
- Track QR code scans across the platform
- Enable 2FA - Adds critical extra security layer
- Strong Passwords - Use unique passwords for both account and personal data
- Regular Updates - Keep emergency contacts and medical info current
- Print QR Code - Keep physical copy in wallet
- Regular Exports - Download backups periodically
- Framework - Next.js 16 (App Router)
- Database - Supabase (PostgreSQL)
- Authentication - Supabase Auth with 2FA
- Styling - Tailwind CSS v4
- UI Components - shadcn/ui
- QR Codes - qrcode library
- 2FA - otplib
- Password Hashing - bcryptjs
POST /api/qr/generate- Generate QR codePOST /api/qr/scan- Record QR scanPOST /api/2fa/setup- Setup 2FAPOST /api/2fa/verify- Verify 2FA codePOST /api/2fa/disable- Disable 2FAPOST /api/personal-data/set-password- Set protection passwordPOST /api/personal-data/verify-password- Verify protection passwordGET /api/personal-data/get-hint- Get password hintGET /api/export/pdf- Export as HTMLGET /api/export/csv- Export as CSVPOST /api/admin/make-admin- Grant admin role
MIT
For issues or questions, open a support ticket at vercel.com/help