Empowering Tourist Safety Through Technology 🌍✨
- 🎯 Overview
- ✨ Key Features
- 🏗️ System Architecture
- 🎨 Technology Stack
- 📸 Screenshots
- 🚀 Getting Started
- 📂 Project Structure
- 🎭 User Roles & Features
- 🔧 Configuration
- 🧪 Testing
- 📦 Build & Deployment
- 🤝 Contributing
- 📄 License
- 👥 Team
- 📞 Contact
SmartYatra is a revolutionary tourist safety and monitoring platform designed to protect and assist travelers throughout their journey. Built with cutting-edge web technologies, it provides real-time tracking, emergency response, QR-based identity verification, and comprehensive analytics for law enforcement and tourists alike.
In an era where tourist safety is paramount, SmartYatra bridges the gap between tourists and local authorities through:
- 🎯 Real-time Location Tracking - GPS-enabled safety monitoring
- 🚨 Instant Emergency Response - One-tap panic button with auto-location sharing
- 🔐 Blockchain Verification - Secure identity verification via QR codes
- 📊 Advanced Analytics - AI-powered insights for authorities
- 🗺️ Geo-fencing - Smart boundary alerts for restricted areas
- 🌐 Multi-language Support - Accessible to international tourists
|
|
|
|
|
|
|
|
- Self-service Registration - Quick tourist onboarding
- Document Verification - AI-powered ID scanning
- QR Code Generation - Instant digital tourist card
- Multi-language Interface - Support for 10+ languages
graph TB
A[Tourist Mobile App] --> B[React Frontend]
C[Kiosk Interface] --> B
D[Police Dashboard] --> B
B --> E[React Router]
E --> F[Context Providers]
F --> G[Mock Data Service]
F --> H[WebSocket Service]
B --> I[Leaflet Maps]
B --> J[Framer Motion]
B --> K[Chart.js]
style B fill:#61DAFB,stroke:#333,stroke-width:2px
style F fill:#FF6B6B,stroke:#333,stroke-width:2px
style I fill:#77DD77,stroke:#333,stroke-width:2px
- Frontend Layer - React 18 with TypeScript for type-safe development
- State Management - Context API for global state (Auth, Theme, Session, etc.)
- Routing - React Router v7 for seamless navigation
- UI/UX - Tailwind CSS + Framer Motion for stunning animations
- Maps Integration - Leaflet for interactive mapping
- Data Visualization - Chart.js for analytics dashboards
- Real-time Communication - WebSocket for live updates
| Category | Technologies |
|---|---|
| Frontend Framework | |
| Build Tool | |
| Styling | |
| Animations | |
| Maps | |
| Charts | |
| Icons | |
| Routing | |
| Code Quality | |
| QR Generation |
{
"dependencies": {
"react": "18.2.0",
"react-router-dom": "^7.8.2",
"framer-motion": "^11.0.0",
"leaflet": "^1.9.4",
"chart.js": "^4.4.0",
"lucide-react": "^0.344.0",
"qrcode": "^1.5.4",
"tailwind-merge": "^2.2.0"
}
}Before you begin, ensure you have the following installed:
|
Version 16.x or higher |
npm, pnpm, or yarn |
|
VS Code (recommended) |
Chrome, Firefox, Edge, or Safari |
Follow these steps to set up SmartYatra locally:
# Using HTTPS
git clone https://github.com/yourusername/smartyatra.git
# Or using SSH
git clone git@github.com:yourusername/smartyatra.git
# Navigate to project directory
cd smartyatraChoose your preferred package manager:
Using npm
npm installUsing pnpm (Recommended)
# Install pnpm globally if not installed
npm install -g pnpm
# Install project dependencies
pnpm installUsing yarn
yarn installCreate a .env file in the root directory:
# Application
VITE_APP_NAME=SmartYatra
VITE_APP_VERSION=1.0.0
# API Configuration (if using backend)
# VITE_API_URL=http://localhost:3000/api
# VITE_WS_URL=ws://localhost:3000
# Map Configuration
# VITE_MAP_API_KEY=your_mapbox_api_key
# Feature Flags
VITE_ENABLE_ANALYTICS=true
VITE_ENABLE_WEBSOCKET=falseStart the development server with hot-reload:
# Using npm
npm run dev
# Using pnpm
pnpm dev
# Using yarn
yarn devThe application will be available at:
- Local:
http://localhost:5173 - Network:
http://192.168.x.x:5173
Create an optimized production build:
# Build the application
npm run build
# Preview the production build
npm run previewCheck and fix code quality issues:
# Run ESLint
npm run lint
# Auto-fix issues
npm run lint -- --fixSmartYatra/
│
├── public/ # Static assets
│ └── manifest.json # PWA manifest
│
├── src/ # Source code
│ ├── components/ # React components
│ │ ├── common/ # Reusable components
│ │ │ ├── Button.tsx
│ │ │ ├── Card.tsx
│ │ │ ├── MapComponent.tsx
│ │ │ ├── PanicButton.tsx
│ │ │ └── ...
│ │ │
│ │ ├── tourist/ # Tourist app components
│ │ │ ├── TouristDashboard.tsx
│ │ │ ├── TouristSafety.tsx
│ │ │ ├── TouristProfile.tsx
│ │ │ └── ...
│ │ │
│ │ ├── police/ # Police dashboard components
│ │ │ ├── PoliceDashboard.tsx
│ │ │ ├── QRScanner.tsx
│ │ │ ├── EnhancedAnalytics.tsx
│ │ │ ├── PoliceMap.tsx
│ │ │ └── ...
│ │ │
│ │ ├── kiosk/ # Kiosk interface components
│ │ │ ├── KioskWelcome.tsx
│ │ │ ├── KioskRegistration.tsx
│ │ │ ├── DocumentVerification.tsx
│ │ │ └── ...
│ │ │
│ │ ├── emergency/ # Emergency system components
│ │ │ ├── EmergencyActive.tsx
│ │ │ ├── EmergencyResponse.tsx
│ │ │ ├── EvidenceVault.tsx
│ │ │ └── ...
│ │ │
│ │ ├── LandingPage.tsx # Main landing page
│ │ └── ...
│ │
│ ├── contexts/ # React Context providers
│ │ ├── AuthContext.tsx
│ │ ├── ThemeContext.tsx
│ │ ├── SessionContext.tsx
│ │ ├── MockDataContext.tsx
│ │ ├── WebSocketContext.tsx
│ │ └── ...
│ │
│ ├── hooks/ # Custom React hooks
│ │ ├── useAccessibility.ts
│ │ ├── useEmergencySystem.ts
│ │ ├── useKeyboardShortcuts.tsx
│ │ └── ...
│ │
│ ├── services/ # Business logic & API calls
│ │ ├── mockData.ts
│ │ ├── sessionManager.ts
│ │ └── ...
│ │
│ ├── types/ # TypeScript type definitions
│ │ ├── emergency.ts
│ │ ├── speech.d.ts
│ │ └── ...
│ │
│ ├── utils/ # Utility functions
│ │ ├── cn.ts
│ │ ├── emergencyUtils.ts
│ │ ├── i18n.ts
│ │ └── ...
│ │
│ ├── App.tsx # Root component
│ ├── main.tsx # Entry point
│ ├── index.css # Global styles
│ └── vite-env.d.ts # Vite type declarations
│
├── .gitignore # Git ignore rules
├── eslint.config.js # ESLint configuration
├── postcss.config.js # PostCSS configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite configuration
├── package.json # Project dependencies
├── pnpm-lock.yaml # Lock file (if using pnpm)
└── README.md # This file
Access Route: /tourist/*
| Feature | Description | Status |
|---|---|---|
| Dashboard | Personal safety dashboard with real-time metrics | ✅ Active |
| Onboarding | Multi-step registration with document upload | ✅ Active |
| Profile | Manage personal information & preferences | ✅ Active |
| Safety Features | Panic button, emergency contacts, safe zones | ✅ Active |
| Map Navigation | Interactive map with POIs and safe routes | ✅ Active |
| Weather Forecast | Real-time weather updates | ✅ Active |
| Destination Ratings | Review and rate tourist spots | ✅ Active |
Access Route: /police/*
| Feature | Description | Status |
|---|---|---|
| Command Dashboard | Real-time tourist monitoring & analytics | ✅ Active |
| QR Scanner | Blockchain-verified identity checking | ✅ Active |
| Analytics Suite | Advanced data visualization & insights | ✅ Active |
| Alert Management | Priority-based alert handling | ✅ Active |
| Tourist Registry | Search & manage tourist database | ✅ Active |
| Live Map | Real-time tourist location tracking | ✅ Active |
Access Route: /kiosk/*
| Feature | Description | Status |
|---|---|---|
| Welcome Screen | Multi-language greeting interface | ✅ Active |
| Self-Registration | Step-by-step tourist registration | ✅ Active |
| Document Verification | AI-powered ID scanning | ✅ Active |
| QR Generation | Digital tourist card creation | ✅ Active |
| Completion | Print/download confirmation | ✅ Active |
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
server: {
port: 5173,
host: true
},
build: {
outDir: 'dist',
sourcemap: true
}
})export default {
content: [
"./index.html",
"./src/**/*.{js,ts,jsx,tsx}",
],
theme: {
extend: {
// Custom theme extensions
},
},
plugins: [],
}Strict type checking enabled for production-ready code.
- Landing page loads correctly
- All routes are accessible
- Tourist onboarding flow works
- Police dashboard displays data
- QR scanner functionality
- Analytics charts render
- Responsive design on mobile
- Dark mode toggle (if implemented)
- Emergency panic button
- Map interactions
| Browser | Version | Status |
|---|---|---|
| Chrome | 90+ | ✅ Supported |
| Firefox | 88+ | ✅ Supported |
| Safari | 14+ | ✅ Supported |
| Edge | 90+ | ✅ Supported |
# Create optimized build
npm run build
# Output directory: dist/Deploy to Vercel
# Install Vercel CLI
npm i -g vercel
# Deploy
vercelDeploy to Netlify
# Install Netlify CLI
npm install -g netlify-cli
# Deploy
netlify deploy --prodDeploy to GitHub Pages
- Update
vite.config.ts:
export default defineConfig({
base: '/smartyatra/',
// ...
})- Build and deploy:
npm run build
git add dist -f
git commit -m "Deploy to GitHub Pages"
git subtree push --prefix dist origin gh-pagesWe welcome contributions from the community! Here's how you can help:
- 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
- Follow TypeScript best practices
- Use ESLint rules defined in the project
- Write meaningful commit messages
- Add comments for complex logic
- Update documentation for new features
Found a bug? Open an issue with:
- Clear description of the problem
- Steps to reproduce
- Expected vs actual behavior
- Screenshots (if applicable)
- Environment details
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 SmartYatra Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files...
© 2025 SmartYatra. All Rights Reserved.
Making Tourism Safer, One Journey at a Time 🌍✨

