This project is a web application designed to assist in wildfire emergency situations by providing an AI-powered chat interface for different user roles: victims, citizens, responders, and helpers. The application uses a React frontend with a Node.js/Express backend connected to MongoDB for data storage.
FireAI serves as a communication platform during wildfire emergencies, offering tailored assistance based on user roles:
- Victims: Direct communication and assistance for those in immediate danger
- Citizens: General information and safety guidance
- Responders: Enhanced interface with interactive graphics for emergency responders
- Helpers: Resources and guidance for those providing assistance
The easiest way to run the application is using the provided startup scripts:
# Make the script executable (first time only)
chmod +x start.sh
# Run the application
./start.sh# Simply double-click start.bat file
# Or run from command prompt:
start.bat
The scripts will:
- Check for and start MongoDB if not running
- Install backend dependencies and start the backend server
- Install frontend dependencies and start the frontend server
- Open browser windows/tabs for both servers
Once running, access the application at http://localhost:3001
-
backend/: Node.js/Express backend
- config/: Configuration files including environment settings
- index.js: Main entry point for the Express application
- package.json: Backend dependencies and scripts
-
frontend/: React-based frontend application
- public/: Static assets and HTML entry point
- src/: Source code for the frontend
- Components/: React components organized by feature
- Chat/: Chat interface components including MessageInput and MessageList
- Home/: Home screen with role selection buttons
- InteractiveGraphic/: Interactive visual components for responders and helpers
- App.js: Main application component with routing logic
- Components/: React components organized by feature
-
presentation/: Project presentation materials
- initial_presentation.pptx: Project presentation slides
- Node.js with Express
- MongoDB for data storage
- Mongoose for database modeling
- Axios for HTTP requests
- dotenv for environment configuration
- React (v19.0.0)
- React DOM
- React Scripts
- Testing libraries (Jest, React Testing Library)
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install - Create a
.envfile in the backend directory with the following variables:NODE_ENV=development PORT=3000 MONGO_URL=mongodb://127.0.0.1:27017/test LOG_LEVEL=debug - For production, update the environment variables:
NODE_ENV=production MONGO_URL=mongodb+srv://[username]:[password]@[cluster-address]/ LOG_LEVEL=error - Start the backend in development mode:
npm run dev
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install - Start the development server:
npm start - The application will be available at http://localhost:3000
If you prefer to set up the application manually, follow these steps:
- Node.js (v14 or higher)
- MongoDB installed and running
- Navigate to the backend directory:
cd backend - Install dependencies:
npm install - Create a
.envfile in the backend directory with the following variables:NODE_ENV=development PORT=3000 MONGO_URL=mongodb://127.0.0.1:27017/test LOG_LEVEL=debug - For production, update the environment variables:
NODE_ENV=production MONGO_URL=mongodb+srv://[username]:[password]@[cluster-address]/ LOG_LEVEL=error - Start the backend in development mode:
npm run dev
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install - Start the development server:
PORT=3001 npm start - The application will be available at http://localhost:3001
- macOS: If MongoDB doesn't start, try
brew services restart mongodb-community - Windows: Ensure MongoDB service is running or start it with
net start MongoDB
- If port 3000 is in use, the backend will fail to start. Check for processes using this port:
- macOS/Linux:
lsof -i :3000 - Windows:
netstat -ano | findstr :3000
- macOS/Linux:
- If port 3001 is in use, set a different port for the frontend:
PORT=3002 npm start(macOS/Linux)set PORT=3002 && npm start(Windows)
Currently developing the following features based on the todoList:
- Prompt creation and validation
- Response verification based on priority
- User identity management
- Emergency tracking
- Communication with central server
- LLM integration for intelligent responses
This project is licensed under the ISC License.