A Web3-powered tourist safety ecosystem combining real-time location tracking, emergency alerts, and immutable incident reporting on the blockchain.
The Tourist Safety Platform is a comprehensive solution that addresses tourist safety concerns through a decentralized, privacy-focused approach. By combining blockchain technology with real-time location sharing and emergency response systems, we create a transparent yet secure environment for tourists and authorities.
- Tourist Vulnerability: Tourists are often unfamiliar with local dangers and lack quick access to help
- Emergency Response Delays: Traditional systems can be slow and lack transparency
- Data Privacy vs Safety: Balancing personal privacy with the need for authorities to access information during emergencies
- Incident Documentation: Creating tamper-proof records of incidents and emergency responses
- Blockchain-based Registration: Secure identity creation with encrypted personal data
- Real-time Location Sharing: GPS tracking with privacy controls
- One-Touch SOS: Emergency alerts with automatic blockchain logging
- Disaster Reporting: Upload photos and descriptions of dangerous situations
- Danger Zone Warnings: Get notified when entering marked unsafe areas
- Encrypted Profile: Personal details accessible only to authorized authorities
- Responsive Design: Works seamlessly on mobile browsers and desktops
- Live Safety Dashboard: Real-time map showing active tourist locations (ID-only for privacy)
- SOS Management: View and respond to emergency alerts
- Danger Zone Control: Mark and manage dangerous areas on the map
- Disaster Reports: Review user-submitted safety reports with photos
- e-FIR System: File immutable First Information Reports (FIRs) on blockchain
- Selective Data Access: Decrypt user information only when legally authorized
- Identity Management: Blockchain-based user IDs mapped to encrypted data
- Immutable SOS Logging: All emergency alerts permanently recorded
- Transparent e-FIR: Tamper-proof incident reports for legal purposes
- Privacy by Design: Personal data encrypted, authorities hold decryption keys
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ Tourist Web โ โ Admin Portal โ โ Blockchain โ
โ App (React) โ โ (React.js) โ โ (Avalanche) โ
โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ โโโโโโโโโโโฌโโโโโโโโ
โ โ โ
โโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโโดโโโโโโโโโโโโ
โ Backend API โ
โ (Node.js + MongoDB) โ
โ + WebSocket Server โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโ
Frontend
- Tourist Web App: React.js + TypeScript + Vite + Tailwind CSS + Material-UI
- Admin Portal: React.js + Vite + Tailwind CSS + ShadCN UI
- Maps Integration: React Leaflet + Google Maps API
- Animations: Framer Motion
Backend
- API Server: Node.js + Express.js
- Database: MongoDB (user data, reports, SOS events)
- Real-time: WebSocket (Socket.io) for live location updates
- Security: JWT authentication + Node Forge encryption + Notistack notifications
Blockchain
- Network: Avalanche Fuji Testnet (fast, low fees)
- Smart Contracts: Solidity
- Integration: Ethers.js
tourist-safety-project/
โโโ user-webapp/ # React tourist web application
โ โโโ src/
โ โ โโโ components/ # Reusable UI components
โ โ โโโ pages/ # Auth, Dashboard, Profile, SOS pages
โ โ โโโ services/ # API, blockchain, location services
โ โ โโโ utils/ # Encryption, validation helpers
โ โ โโโ hooks/ # Custom React hooks
โโโ admin-portal/ # React admin dashboard
โ โโโ src/
โ โ โโโ components/ # MapView, AlertCard, UserCard
โ โ โโโ pages/ # Dashboard, SOS, Reports, e-FIR
โ โ โโโ services/ # API services for admin functions
โโโ backend/ # Node.js server
โ โโโ src/
โ โ โโโ models/ # User, SOS, Report, FIR schemas
โ โ โโโ routes/ # API endpoints
โ โ โโโ controllers/ # Business logic
โ โ โโโ utils/ # Blockchain integration, encryption
โโโ blockchain/ # Solidity smart contracts
โ โโโ contracts/ # Identity, SosAlert, EFIR contracts
โ โโโ scripts/ # Deployment scripts
โโโ docs/ # Project documentation
- Node.js (v18+)
- MongoDB
- TypeScript
- Hardhat
- Metamask or Web3 wallet
git clone https://github.com/your-username/tourist-safety-project.git
cd tourist-safety-projectcd backend
npm install
cp .env.example .env # Configure your environment variables
npm run devcd blockchain
npm install
npx hardhat compile
npx hardhat run scripts/deploy.js --network fujicd admin-portal
npm install
npm run devcd user-webapp
npm install
npm run devBackend (.env)
MONGODB_URI=mongodb://localhost:27017/tourist-safety
JWT_SECRET=your-jwt-secret
ENCRYPTION_KEY=your-32-byte-encryption-key
AVALANCHE_RPC_URL=https://api.avax-test.network/ext/bc/C/rpc
CONTRACT_ADDRESS_IDENTITY=0x...
CONTRACT_ADDRESS_SOS=0x...
CONTRACT_ADDRESS_EFIR=0x...
Admin Portal (.env)
VITE_API_BASE_URL=http://localhost:3000/api
VITE_WEBSOCKET_URL=ws://localhost:3000
VITE_BLOCKCHAIN_RPC=https://api.avax-test.network/ext/bc/C/rpc
Tourist Web App (.env)
VITE_API_BASE_URL=http://localhost:3000/api
VITE_WEBSOCKET_URL=ws://localhost:3000
VITE_BLOCKCHAIN_RPC=https://api.avax-test.network/ext/bc/C/rpc
VITE_GOOGLE_MAPS_API_KEY=your-google-maps-api-key
- Register: Create a blockchain-based identity with encrypted personal details
- Share Location: Enable location sharing to appear on the safety dashboard
- Report Dangers: Upload photos and descriptions of unsafe situations
- Emergency SOS: One-touch emergency alert with automatic blockchain logging
- Stay Informed: Receive warnings when entering marked danger zones
- Cross-Device Access: Access from any device with a modern web browser
- Monitor Safety: View live map with active tourist locations (privacy-protected)
- Respond to SOS: Receive real-time emergency alerts and coordinate response
- Mark Danger Zones: Add/remove dangerous areas based on reports and incidents
- Review Reports: Analyze user-submitted safety reports and photos
- File e-FIR: Create immutable incident reports with selective data access
- Encrypted Storage: All personal data encrypted before storage
- Selective Disclosure: Authorities only see blockchain IDs by default
- Emergency Access: Police can decrypt data only with proper authorization
- Blockchain Transparency: All SOS events and e-FIRs immutably logged
- JWT Authentication: Secure API access
- Node Forge Encryption: Military-grade data protection
- Smart Contract Auditing: Automated testing for blockchain components
- HTTPS/WSS: Encrypted communication channels
Identity.sol
- Maps blockchain wallet addresses to encrypted user data hashes
- Enables privacy-preserving identification
SosAlert.sol
- Immutably logs all SOS events with timestamps
- Provides transparency for emergency response auditing
EFIR.sol
- Stores First Information Reports (FIRs) on blockchain
- Creates tamper-proof legal documentation
- Fast Transactions: Sub-second finality
- Low Fees: Minimal gas costs for frequent updates
- EVM Compatible: Easy integration with existing tools
- Eco-Friendly: Proof-of-Stake consensus
- Backend: Deploy to AWS/Google Cloud with MongoDB Atlas
- Admin Portal: Build and deploy to Vercel/Netlify
- Tourist Web App: Build and deploy to Vercel/Netlify
- Blockchain: Deploy contracts to Avalanche Mainnet
This project was built for a hackathon, but contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Frontend Developer: Web app and admin portal development
- Backend Developer: API design and WebSocket implementation
- Blockchain Developer: Smart contract development and integration
- UI/UX Designer: User experience and interface design
- First-of-its-kind blockchain-based tourist safety platform
- Privacy-preserving emergency response system
- Immutable incident documentation for legal purposes
- Immediate Safety: Real-time emergency response for tourists
- Data Transparency: Blockchain-verified incident reporting
- Scalable Solution: Adaptable to smart cities and citizen safety
- Modern Web Stack: React + TypeScript + Vite for optimal performance
- Full-stack Web3 integration with practical use case
- Privacy by design architecture
- Production-ready codebase with comprehensive testing
- Progressive Web App capabilities for mobile-like experience
For questions, issues, or collaboration opportunities:
- Email: [email protected]
- Discord: Join our server
- Documentation: Full API docs
Built with โค๏ธ for safer travel experiences worldwide