A comprehensive emergency response management platform built with Next.js, TypeScript, Clerk authentication, and shadcn/ui components.
- Admin: Full system management including patients, hospitals, ambulances, drivers, users, and reports
- Emergency Response Team (ERT): Monitor SOS alerts, assign ambulances, track emergencies
- Transport Company: Manage fleet, drivers, and emergency assignments
- Patient Management: Comprehensive patient records with medical history and emergency contacts
- Hospital Network: Monitor capacity, specialties, and availability
- Fleet Management: Real-time ambulance tracking and driver management
- SOS Response: Emergency alert system with automated dispatch
- Real-time Analytics: Response time tracking and operational metrics
- Live Map Integration: Location-based emergency response coordination
- Frontend: Next.js 15 with TypeScript
- Styling: Tailwind CSS + shadcn/ui components
- Authentication: Clerk (role-based access control)
- Icons: Lucide React
- Charts: Recharts
- Date Handling: date-fns
- Node.js 18+
- npm, yarn, or pnpm
- Clone the repository:
git clone <repository-url>
cd emergency-response-app- Install dependencies:
npm install- Set up environment variables:
cp .env.local.example .env.local- Configure Clerk authentication:
- Sign up at Clerk.dev
- Create a new application
- Add your keys to
.env.local:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_your_key_here
CLERK_SECRET_KEY=sk_test_your_key_here- Run the development server:
npm run dev- Open http://localhost:3000 in your browser
Visit the live demo at /demo to explore all user roles and features without authentication.
src/
├── app/ # Next.js app router pages
│ ├── dashboard/ # Main dashboard
│ ├── patients/ # Patient management
│ ├── hospitals/ # Hospital management
│ ├── ambulances/ # Fleet management
│ ├── sos/ # Emergency response
│ ├── demo/ # Interactive demo
│ └── sign-in/ # Authentication pages
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── dashboards/ # Role-specific dashboards
│ └── navigation/ # Navigation components
├── hooks/ # Custom React hooks
├── lib/ # Utilities and mock data
└── types/ # TypeScript type definitions
- ✅ Manage patients, hospitals, ambulances, drivers
- ✅ User management and role assignment
- ✅ System-wide analytics and reporting
- ✅ Full access to all features
- ✅ Monitor active emergencies
- ✅ Dispatch ambulances
- ✅ Track response times
- ✅ Live map view
- ❌ User management
- ❌ System configuration
- ✅ Manage own fleet and drivers
- ✅ View assigned emergencies
- ✅ Track vehicle status
- ❌ Access to other companies' data
- ❌ System administration
- Create a Clerk application
- Configure social providers (optional)
- Set up user metadata for roles
- Update middleware for route protection
Roles are currently assigned based on email patterns (demo):
- Emails containing "admin" → Admin role
- Emails containing "ert" → ERT role
- Emails containing "transport" → Transport Company role
- Default → Admin role
The application includes comprehensive mock data for demonstration:
- 3 Patients with medical history
- 3 Hospitals with capacity tracking
- 3 Ambulances with real-time status
- 3 Drivers with availability
- 2 Transport companies
- 3 SOS cases with different statuses
- Push to GitHub
- Connect to Vercel
- Add environment variables
- Deploy
The app can be deployed to any platform supporting Next.js:
- Netlify
- Railway
- AWS Amplify
- Docker containers
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue on GitHub
- Check the documentation
- Review the demo at
/demo
Built with ❤️ using Next.js, Clerk, and shadcn/ui