Crisis Pilot is an advanced AI-powered crisis response management application built with React and TypeScript. This project leverages Google's Gemini API to provide intelligent crisis assessment, real-time response guidance, and comprehensive crisis template management. Crisis Pilot delivers an intuitive interface for managing emergency situations with AI-assisted decision-making, data parsing, and crisis response coordination.
- Key Features
- Getting Started
- Project Structure
- Usage Guide
- Core Features
- Technologies Used
- Performance & Troubleshooting
- Contributing
- License
- Author
- AI-Powered Crisis Assessment: Leverages Google's Gemini API to analyze crisis situations and provide intelligent recommendations.
- Crisis Template Management: Pre-built and customizable crisis response templates for various emergency scenarios.
- Real-Time Data Parsing: Efficiently parses and processes crisis data with robust error handling.
- Responsive User Interface: Modern, intuitive React-based UI with TypeScript for type safety and reliability.
- Quick Setup: Built with Vite for lightning-fast development and optimized production builds.
- Comprehensive Documentation: Detailed crisis response guides and configuration options for different scenarios.
Follow these instructions to set up and run Crisis Pilot on your local machine.
Make sure you have the following installed:
- Node.js (version 16.0.0 or higher)
- npm or yarn (Node Package Manager)
- Git for version control
- Google Gemini API Key (get one from AI Studio)
- A modern web browser (Chrome, Firefox, Safari, or Edge)
- Minimum 2 GB RAM for smooth operation
-
Clone the repository
git clone https://github.com/CodeMaster-D/crisispilot.git cd crisispilot -
Install dependencies
npm install
-
Set up environment variables
- Create a
.env.localfile in the root directory:VITE_GEMINI_API_KEY=your_gemini_api_key_here
- Replace
your_gemini_api_key_herewith your actual Gemini API key from AI Studio
- Create a
-
Verify Installation
npm run dev
The application should start on
http://localhost:5173(or the next available port)
-
Gemini API Configuration:
- Obtain your Gemini API key from Google AI Studio
- Add it to your
.env.localfile as shown in the Installation section - Ensure you have the appropriate API quota for your usage
-
Customize Crisis Templates (Optional):
- Edit
src/data/templates.tsto add or modify crisis response templates - Update template parameters to match your organization's protocols
- Edit
-
Adjust Application Parameters (Optional):
- Modify component configurations in
src/components/to customize the UI - Adjust timeout values and data processing parameters as needed for your environment
- Modify component configurations in
-
Optimize for Your Environment:
- For large datasets, ensure adequate browser memory allocation
- Consider adjusting API request timeouts based on your network conditions
Development Mode:
npm run devProduction Build:
npm run buildPreview Production Build:
npm run previewStart Server (if applicable):
npm run serverOnce running:
- The application will open in your default browser
- Load crisis templates from the crisis interface
- Use the AI assistant for real-time guidance
- Monitor and coordinate crisis response activities
- Press
Ctrl+Cin the terminal to stop the application
The project is organized for scalability and maintainability:
crisispilot/
├── src/
│ ├── components/
│ │ └── CrisisInterface.tsx # Main crisis management UI component
│ ├── data/
│ │ └── templates.ts # Crisis response templates
│ ├── utils/
│ │ └── parser.ts # Data parsing utilities
│ ├── types.ts # TypeScript type definitions
│ ├── App.tsx # Main application component
│ ├── main.tsx # Application entry point
│ └── index.css # Global styles
├── public/
│ └── assets/ # Static assets
├── .env.local # Environment variables (not committed)
├── .gitignore # Git ignore rules
├── package.json # Project dependencies
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite configuration
├── server.ts # Server configuration
├── README.md # Project documentation
├── CONTRIBUTING.md # Contribution guidelines
├── CODE_OF_CONDUCT.md # Community code of conduct
└── metadata.json # Application metadata
-
Launch the Application
- Start the development server with
npm run dev - Open the application in your browser
- Start the development server with
-
Access Crisis Templates
- Navigate to the Crisis Interface
- Select from pre-built templates or create a custom response plan
- Review the AI-generated recommendations
-
Use AI Assistant
- Input crisis parameters and situation details
- Get real-time AI analysis and suggested responses
- Refine recommendations based on your specific needs
-
Manage Response Coordination
- Track response status and updates
- Coordinate with team members
- Document decisions and actions taken
-
Review and Improve
- After crisis resolution, review the response effectiveness
- Update templates based on lessons learned
- Share insights with team members
- Crisis Assessment: Input situation details → AI analysis → Recommended actions
- Template Selection: Browse templates → Customize parameters → Deploy response plan
- Real-Time Coordination: Monitor updates → Adjust strategies → Track outcomes
- Data Management: Parse incident reports → Extract key information → Generate summaries
Crisis Pilot provides the following crisis management functionalities:
- Intelligent Crisis Assessment: Gemini AI analyzes situations and provides data-driven recommendations
- Template System: Pre-built response templates for common crisis scenarios with customization options
- Real-Time Data Processing: Efficient parsing and processing of crisis-related information
- Responsive Interface: Modern React UI with TypeScript for reliable, type-safe operations
- API Integration: Seamless integration with Google Gemini API for AI-powered insights
- Crisis Documentation: Comprehensive recording and tracking of all crisis response activities
Crisis Pilot is built with modern, production-ready technologies:
- React: Powerful JavaScript library for building interactive user interfaces with component-based architecture
- TypeScript: Superset of JavaScript providing strong typing and enhanced IDE support for reliable code
- Vite: Modern build tool delivering extremely fast development server and optimized production builds
- Google Gemini API: Advanced AI model providing intelligent crisis analysis and recommendations
- Node.js: JavaScript runtime for server-side development and tooling
- CSS3: Modern styling with responsive design for all screen sizes
- Build Size: Optimized with Vite for minimal bundle size
- Load Time: Application typically loads in under 2 seconds on modern networks
- Memory Usage: Efficient memory management with React optimization techniques
- API Calls: Batched Gemini API calls to minimize latency and costs
| Issue | Solution |
|---|---|
| Gemini API Key not recognized | Verify .env.local file exists and contains correct API key |
| Application won't start | Clear node_modules and reinstall: rm -rf node_modules && npm install |
| Slow performance | Check network connection, reduce data payload size, review browser console |
| Templates not loading | Verify src/data/templates.ts file exists and is properly formatted |
| API quota exceeded | Review API usage limits in AI Studio, consider optimizing request frequency |
| Build errors | Ensure Node.js version is 16.0.0 or higher: node --version |
| CSS not loading | Clear browser cache and restart development server |
- Development: Use
npm run devfor hot module reloading during development - Production: Use
npm run buildandnpm run previewto test production build locally - Debugging: Check browser console (F12) for TypeScript and React errors
- API Testing: Use the network tab in DevTools to monitor Gemini API requests
Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/ImprovesCrisisResponse) - Commit your Changes (
git commit -m 'Add improved crisis response feature') - Push to the Branch (
git push origin feature/ImprovesCrisisResponse) - Open a Pull Request
For detailed contribution guidelines, see CONTRIBUTING.md, review our CODE_OF_CONDUCT.md and don't forget to read NOTICE.md
This project is licensed under the Apache License 2.0—see the LICENSE file for the full terms.