Overview
The Incidents App is a monorepo containing two main applications:- Mobile App: React Native mobile application built with Expo for iOS and Android
- Web Dashboard: Next.js web dashboard for administrators
The entire system uses Supabase as the backend for authentication, database, and real-time features.
Prerequisites
Before you begin, ensure you have the following installed:- Node.js: v20 or higher
- npm or pnpm: Package manager
- Git: Version control
- Expo CLI: For mobile development
- Supabase Account: Free tier available at supabase.com
For mobile development, you’ll also need either:
- iOS Simulator (macOS only) with Xcode installed
- Android Emulator with Android Studio
- Expo Go app on your physical device
Installation
Set Up Supabase
Create a new project in your Supabase dashboard and note down:
- Project URL
- Anon/Public Key
Configure Mobile App
Navigate to the mobile directory and install dependencies:Create a
.env file in the mobile directory:mobile/.env
Running the Applications
Mobile App
The mobile app uses Expo for development and supports multiple platforms.Web Dashboard
The web dashboard is built with Next.js and runs on port 3000 by default.Key Features by App
Mobile App
Admin Users
- Full incident management
- User creation and management
- Session management
- Settings configuration
- View and update assigned incidents
- Track incident status
- Access incident details
- QR code scanning for incident reporting
- View own incidents
- Track incident resolution
Web Dashboard
Admin-Only Access
- Comprehensive incident analytics
- Data visualization with charts
- Advanced reporting
- User role management
- System-wide configuration
Authentication Flow
The app uses Supabase Authentication with role-based access control:mobile/app/index.tsx
Verifying Installation
Check Mobile App
After starting the mobile app, you should see the splash screen followed by the login screen.The app will automatically route users based on their role:
- Admins → Admin dashboard
- Employees → Employee interface
- Guests → Guest home with QR scanner option
Check Web Dashboard
Navigate to http://localhost:3000 and verify:
- Login page renders correctly
- Supabase connection is established
- No console errors appear
Common Issues
Next Steps
Now that you have the applications running:- Review the Architecture to understand the system structure
- Explore the mobile app’s file-based routing structure
- Check out the web dashboard’s admin features
- Configure your Supabase database tables and policies