A mobile app for emergency management that helps Boys and Girls Club staff quickly account for and manage student rosters during evacuations. EmergencyRelay provides real-time location tracking, roster management, and administrative oversight through an intuitive, role-based interface.
- Role-based Access: Separate interfaces for staff and administrators
- Real-time Roster Management: Track student locations and status during evacuations
- Location Tracking: WiFi-based positioning to identify which areas users are in
- User Management: Administrators can create and manage staff accounts
- Offline-ready: Works in areas with limited connectivity
- Node.js (v18+) and npm
- Expo Go app (for mobile testing on physical devices)
- WiFi access (for app and server communication)
# Install app dependencies
cd EmergencyRelay
npm install
# Install server dependencies
cd server && npm install && cd ..Terminal 1: Start the backend server
cd EmergencyRelay/server
npm startThe server runs on http://localhost:5000.
Terminal 2: Start the Expo app
cd EmergencyRelay
npm startChoose your platform:
- Press
wfor web (browser) - Press
afor Android Emulator - Press
ifor iOS Simulator - Scan the QR code with your phone for Physical Device
The app automatically configures the API URL based on your platform:
| Platform | API Base URL | Notes |
|---|---|---|
| Web/Browser | http://localhost:5000 |
Local development |
| Android Emulator | http://10.0.2.2:5000 |
Special emulator address |
| Physical Device | Your machine's LAN IP | Same WiFi network |
Linux:
hostname -I | awk '{print $1}'macOS:
ipconfig getifaddr en0Windows:
ipconfigIf you need to test on a different network, update EXPO_PUBLIC_API_BASE in the environment or use a tunneling service. The app includes tunnel support via npm start (default), which creates a secure connection without needing to know your IP.
Use these credentials to log in:
| Role | Password | Notes | |
|---|---|---|---|
| Staff | A |
A |
View rosters only |
| Admin | B |
B |
Full admin access |
# Terminal 1
cd EmergencyRelay/server && npm start
# Terminal 2
cd EmergencyRelay && npm run webOpens at http://localhost:8081.
# Terminal 1
cd EmergencyRelay/server && npm start
# Terminal 2
cd EmergencyRelay && npm start
# Press 'a'Your phone must be on the same WiFi as your computer.
# Terminal 1
cd EmergencyRelay/server && npm start
# Terminal 2
cd EmergencyRelay && npm start
# Scan the QR code with your phoneIf the app can't connect: The app will use Expo's tunnel by default. If you prefer a local IP connection, update your app.json configuration.
EmergencyRelay/
├── App.js # App entry point and navigation setup
├── app.json # Expo configuration
├── screens/ # UI screens (Login, Dashboard, Rosters, etc.)
├── contexts/ # React Context (AuthContext for auth state)
├── services/ # API client utilities and location tracking
├── models/ # TypeScript data models
├── components/ # Reusable UI components (FloorMap)
└── server/ # Backend API
├── src/index.js # Express server with auth endpoints
└── data/ # Data storage (users and rosters)
The backend provides the following key endpoints:
POST /auth/login— User login (email/password)GET /auth/me— Get current user info (requires Bearer token)POST /admin/users/create— Create new staff account (admin only)GET /admin/rosters— List all rosters (admin only)POST /rosters/{id}/update— Update roster status
All authenticated endpoints require the Authorization: Bearer <token> header.
- Verify the server is running:
cd server && npm start - Check that your phone is on the same WiFi network as your computer
- Verify the API base URL is correct for your device type
- Test connectivity by opening the API URL directly in your phone's browser
The Android emulator uses 10.0.2.2 to reach your computer's localhost. Ensure your configuration points to this address. The app should do this automatically.
Find and terminate the existing process:
kill -9 $(lsof -ti tcp:5000)Or use a different port:
PORT=5001 npm startClear the Expo cache when you make configuration changes:
npm start -- -cFrontend (Expo React Native):
- Manages user authentication via
AuthContext - Displays role-specific interfaces (Staff vs Admin)
- Communicates with backend via REST API in
services/api.js - Handles location tracking and roster management
Backend (Express + NeDB):
- JSON-file-based data store (development-friendly)
- Password hashing with scrypt
- Session token management
- REST API for user, roster, and location data
This is a development-ready application suitable for testing and integration. The backend uses NeDB, a file-based database stored in server/data/, making it easy to inspect and reset data during development.
For production deployment, consider:
- Migrating to a persistent database (PostgreSQL, MongoDB)
- Implementing secure session storage
- Adding HTTPS/TLS encryption
- Setting up automated backups
- Implementing rate limiting and security hardening
This project is licensed under the 0BSD License. See the LICENSE file for details.