Your Personal Earthquake Early Warning System
ShakeGuard is an advanced earthquake detection and early warning mobile application built with React Native and Expo. It uses device sensors to monitor seismic activity and provides real-time alerts to help keep you and your community safe.
- Continuous accelerometer and gyroscope monitoring
- Advanced earthquake detection algorithms
- Automatic intensity calculation and classification
- Calculates seismic wave arrival times
- Push notifications to nearby users
- Urgent alerts for waves arriving in <10 seconds
- Community-based earthquake reporting
- Auto-activates for high-intensity earthquakes (>2.5)
- Reduces screen brightness to conserve battery
- Sends emergency location to database
- False alarm protection with 30-minute cooldown
- Create and join family groups with unique codes
- Share real-time safety status (Safe/Warning/Emergency)
- Location sharing during emergencies
- Emergency contact management
- Comprehensive emergency preparedness checklist
- Categories: Water, Food, Medical, Tools, Communication, Shelter, Documents
- Progress tracking with completion percentages
- Custom item addition and notes
- Real-time earthquake reports from community
- Interactive map with intensity visualization
- Report filtering by time range and intensity
- Submit earthquake reports with location
- Visualize earthquake activity patterns
- Risk assessment by region
- Activity clustering and analysis
- Historical data trends
- Dark/Light theme support with system preference
- Smooth animations and micro-interactions
- Responsive design for all screen sizes
- Intuitive navigation with tab-based layout
- Node.js (v16 or higher)
- npm or yarn
- Expo CLI
- iOS Simulator or Android Emulator (for testing)
-
Clone the repository
git clone https://github.com/yourusername/shakeguard.git cd shakeguard -
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:EXPO_PUBLIC_SUPABASE_URL=your_supabase_url EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
-
Start the development server
npm run dev
-
Run on device/simulator
- Scan QR code with Expo Go app (iOS/Android)
- Press
ifor iOS simulator - Press
afor Android emulator
- React Native - Cross-platform mobile development
- Expo SDK 53 - Development platform and tools
- Expo Router - File-based navigation
- TypeScript - Type safety and better DX
- React Native Reanimated - Smooth animations
- Expo Linear Gradient - Beautiful gradients
- Lucide React Native - Modern icon library
- Supabase - Backend-as-a-Service
- PostgreSQL - Relational database
- Real-time subscriptions - Live data updates
- Row Level Security (RLS) - Data security
- Expo Sensors - Accelerometer and gyroscope access
- Expo Location - GPS and location services
- Expo Notifications - Push notifications
- Expo Haptics - Tactile feedback
- AsyncStorage - Local data persistence
- Custom React Hooks - State management
- Real-time data sync - Supabase integration
app/
βββ (tabs)/ # Tab-based navigation
β βββ index.tsx # Monitor screen (main)
β βββ map.tsx # Live earthquake map
β βββ family.tsx # Family safety network
β βββ emergency-kit.tsx # Emergency preparedness
β βββ heatmap.tsx # Community heatmap
β βββ history.tsx # Event history
β βββ settings.tsx # App settings
β βββ about.tsx # About & info
βββ _layout.tsx # Root layout
βββ +not-found.tsx # 404 page
components/ # Reusable UI components
βββ AlertBanner.tsx # Earthquake alert display
βββ EmergencyDefenseButton.tsx
βββ EarthquakeWarningBanner.tsx
βββ LocationStatus.tsx # GPS status indicator
βββ MapView.tsx # Map visualization
βββ ReportModal.tsx # Report submission
βββ SensorCard.tsx # Sensor data display
βββ WaveDisplay.tsx # Seismic waveform
βββ ...
hooks/ # Custom React hooks
βββ useEarthquakeDetection.ts
βββ useEarthquakeWarning.ts
βββ useEmergencyDefense.ts
βββ useFamilyTracking.ts
βββ useEmergencyKit.ts
βββ useCommunityHeatmap.ts
βββ useLocation.ts
βββ useSettings.ts
βββ useTheme.ts
βββ ...
lib/ # Utilities and services
βββ supabase.ts # Database client
βββ earthquakeWarning.ts # Warning calculations
- user_locations - GPS coordinates and emergency reports
- earthquake_events - Detected earthquake data
- sensor_readings - Raw sensor data (optional storage)
- earthquake_reports - Community-submitted reports
- Row Level Security (RLS) enabled
- Real-time subscriptions for live updates
- Optimized indexes for location and time queries
- GMT+3 timezone support
- Sensitivity: Adjustable detection threshold (0.5x - 2.0x)
- Update Rate: 1-5 second intervals for battery optimization
- Detection Algorithm: Combined accelerometer + gyroscope analysis
- Push notifications for earthquake alerts
- Haptic feedback on detection
- Early warning system with arrival time calculations
- Auto-activation threshold: Intensity > 2.5
- Screen brightness reduction to 10%
- Emergency location transmission
- 30-minute false alarm protection
npm run build:web-
iOS App Store
eas build --platform ios eas submit --platform ios
-
Google Play Store
eas build --platform android eas submit --platform android
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
ShakeGuard is designed for educational and awareness purposes. It should not be used as a substitute for official earthquake monitoring systems or emergency alerts. Always follow official emergency protocols and evacuation procedures in your area.
- USGS - Earthquake data and research
- Expo Team - Amazing development platform
- Supabase - Excellent backend services
- React Native Community - Open source libraries
- π§ Email: support@shakeguard.app
- π Issues: GitHub Issues
- π¬ Discussions: GitHub Discussions
Built with β€οΈ for earthquake safety and community protection
Stay safe, stay prepared, stay connected.