A comprehensive web application designed for hackathon demonstration that provides tourists with emergency SOS functionality, document verification, and safety features.
- User Registration & Login with phone number verification
- Phone Verification via Twilio OTP SMS (Account 1)
- Separate Admin Login for verification panel
- JWT-based authentication with security middleware
- Upload government-issued documents (ID, passport, etc.)
- Manual verification by admin team
- Admin dashboard for document approval/rejection
- Only verified users can access SOS features
- Emergency SOS Button with 3-second press-and-hold activation
- Instant SMS alerts via Twilio (Account 2) with Google Maps location
- Interactive OpenStreetMap with safe zones (green) and restricted zones (red)
- Emergency contact management (up to 5 contacts)
- Pre-populated emergency numbers (Police: 100, Ambulance: 108, Fire: 101, Tourist Helpline: 1363)
- Document verification management
- User management with verification status
- SOS alert monitoring and status updates
- Dashboard statistics and analytics
- Triple SMS alerts (3 messages sent 2 seconds apart for urgency)
- Real-time geolocation with Google Maps integration
- Offline map fallback system for network issues
- Emergency services location markers
- Safe zone and restricted area warnings
- Node.js with Express.js framework
- MongoDB with Mongoose ODM
- Twilio for SMS (2 separate accounts)
- Tesseract.js for OCR processing
- JWT for authentication
- bcryptjs for password hashing
- Multer for file uploads
- HTML5, CSS3, JavaScript (Vanilla JS)
- Leaflet.js for interactive maps
- Font Awesome for icons
- Responsive design with mobile-first approach
- Helmet.js for security headers
- Rate limiting for API protection
- CORS configuration
- Winston logging system
- Input validation and sanitization
- Node.js (v14 or higher)
- MongoDB (local or cloud)
- 2 Twilio accounts:
- Account 1: OTP verification
- Account 2: SOS alerts
git clone <repository-url>
cd tourist-safety-system
npm install
Copy .env.example
to .env
and configure:
# MongoDB
MONGODB_URI=mongodb://localhost:27017/tourist-safety
# JWT
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRES_IN=7d
# Twilio Account 1 - OTP Verification
TWILIO_ACCOUNT_SID_OTP=your-twilio-account-sid-for-otp
TWILIO_AUTH_TOKEN_OTP=your-twilio-auth-token-for-otp
TWILIO_VERIFY_SERVICE_SID=your-twilio-verify-service-sid
TWILIO_PHONE_NUMBER_OTP=your-twilio-phone-number-for-otp
# Twilio Account 2 - SOS Alerts
TWILIO_ACCOUNT_SID_SOS=your-twilio-account-sid-for-sos
TWILIO_AUTH_TOKEN_SOS=your-twilio-auth-token-for-sos
TWILIO_PHONE_NUMBER_SOS=your-twilio-phone-number-for-sos
# Server
PORT=3000
NODE_ENV=development
# Admin Credentials
ADMIN_USERNAME=admin
ADMIN_PASSWORD=admin123
# Development mode
npm run dev
# Production mode
npm start
- Main App: http://localhost:3000
- Admin Panel: http://localhost:3000/admin
- Register with email, phone, and tourist type (Indian/Foreign)
- Verify phone number via OTP SMS
- Upload document (Aadhar/Passport) for verification
- Wait for admin approval of documents
- Access dashboard with full SOS functionality
- Add emergency contacts (family, friends)
- Use SOS button in emergencies (sends location + alerts)
- Login with admin credentials
- Review pending documents
- Approve/reject documents with notes
- Monitor SOS alerts and update status
- Manage users and view statistics
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/admin/login
- Admin loginGET /api/auth/profile
- Get user profile
POST /api/phone/send-otp
- Send OTP via TwilioPOST /api/phone/verify-otp
- Verify OTP
POST /api/documents/upload
- Upload documentGET /api/documents/my-documents
- Get user documentsGET /api/documents/view/:id
- View document image
POST /api/emergency/sos
- Send SOS alertGET/POST/PUT/DELETE /api/emergency/contacts
- Manage contactsGET /api/emergency/sos-history
- Get SOS history
GET /api/admin/documents
- Get all documentsPOST /api/admin/documents/:id/verify
- Verify documentGET /api/admin/users
- Get all usersGET /api/admin/sos-alerts
- Get SOS alertsPOST /api/admin/sos-alerts/:id/update
- Update SOS statusGET /api/admin/dashboard/stats
- Get dashboard statistics
- Gradient backgrounds with professional color scheme
- Responsive layout optimized for mobile devices
- Interactive animations and hover effects
- Emergency-focused red design for SOS elements
- Progress indicators for multi-step processes
- Real-time notifications with auto-dismiss
- Modal dialogs for forms and confirmations
- Loading spinners for async operations
- Intuitive navigation with clear visual hierarchy
- Rate limiting (100 general, 5 auth, 3 OTP requests)
- JWT token authentication with expiration
- Password hashing with bcrypt (12 rounds)
- Input validation and sanitization
- CORS protection with configurable origins
- Helmet security headers for XSS protection
- File upload restrictions (5MB limit, specific formats)
- Winston logging with file persistence
- Request/response tracking with duration
- Error handling with stack traces
- Uncaught exception management
- Admin dashboard with real-time statistics
- 3-second press-and-hold activation to prevent accidental triggers
- Triple SMS delivery (3 messages, 2 seconds apart)
- Automatic location sharing via Google Maps links
- Police notification to dummy number for demo
- Contact priority system (High/Medium/Low)
- OpenStreetMap with Leaflet.js
- Offline fallback with SVG-based tiles
- Safe zones marked with green circles
- Restricted areas marked with red circles
- Emergency services with blue markers
- Real-time user location tracking
- User registration with phone verification
- Document upload with
- Admin document verification workflow
- SOS alert sending and SMS delivery
- Map functionality with markers
- Emergency contact management
- Admin panel statistics and management
- Tourist Registration: Show complete signup flow
- Document Verification: Upload sample ID and admin approval
- SOS Alert: Demonstrate emergency button and SMS alerts
- Admin Management: Show document review and user management
- Show the problem: Tourist safety concerns
- Demonstrate solution: Complete user journey
- Highlight technology: Twilio integration, real-time maps
- Emphasize security: Verification process, rate limiting
- Show scalability: Admin panel, monitoring, statistics
- Landing page overview (30 seconds)
- User registration and phone verification (1 minute)
- Document upload (1 minute)
- Admin approval process (1 minute)
- Dashboard tour with map and contacts (1.5 minutes)
- SOS demonstration (1 minute)
- Admin panel statistics and management (1 minute)
- Modular architecture with separate route files
- Reusable components and utility functions
- Consistent error handling across all endpoints
- Clean separation of concerns (auth, business logic, data)
- Database indexing for performance
- Caching strategies for frequent queries
- Load balancing support with stateless design
- Microservices ready architecture
This is a hackathon prototype. For production use, consider:
- Enhanced security auditing
- Comprehensive testing suite
- Performance optimization
- Advanced monitoring and alerting
- Multi-language support
- Advanced map features
MIT License - Built for hackathon demonstration purposes.
Built with β€οΈ for tourist safety and emergency response.