CitizenAlert is a web application designed to help communities stay informed about local incidents and emergencies. Users can create, view, and filter alerts based on categories such as fire, crime, accidents, weather, and more. The web app also includes features like a map view, chatbot assistance, and user authentication and location of the user.
- Community Alerts: View and create alerts for incidents in your area.
- Map Integration: Visualize alerts on an interactive map.
- Category Filtering: Filter alerts by categories like fire, crime, accidents, weather, etc.
- Search Functionality: Search alerts by title, description, or location.
- User Authentication: Sign up, log in, and manage your profile.
- AI Chatbot: Get assistance through an integrated chatbot powered by Gemini AI.
- Responsive Design: Optimized for both desktop and mobile devices.
- Frontend: React, TypeScript, TailwindCSS
- Backend: Flask, Firebase (Firestore, Storage, Authentication)
- AI Integration: Gemini AI (via
google.generativeai) - Map Integration: Leaflet.js
- State Management: React Context API
- Form Handling: React Hook Form
- UI Components: Radix UI, ShadCN UI
- Build Tool: Vite
-
Clone the repository:
git clone https://github.com/your-username/CitizenAlert.git cd CitizenAlert -
Navigate to the backend directory:
cd CitizenAlert -
Install Python dependencies:
pip install -r requirements.txt
-
Create a .env file in the root directory and add the following:
GEMINI_API_KEY=your_gemini_api_key
-
Run the Flask server:
python app.py
-
Navigate to the frontend directory:
cd CitizenAlert/frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
-
Open the app in your browser:
http://localhost:8080
- Description: Sends a user message to the Gemini AI chatbot and returns a response.
- Request Body:
{ "message": "Describe the emergency situation here." } - Response:
{ "response": "Step-by-step instructions from the chatbot." }
CitizenAlert/
├── app.py # Flask backend for chatbot integration
├── requirements.txt # Python dependencies
├── .env # Environment variables
├── frontend/ # Frontend application
│ ├── public/ # Static assets
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── context/ # Context providers (e.g., AuthContext)
│ │ ├── firebase/ # Firebase configuration
│ │ ├── hooks/ # Custom React hooks
│ │ ├── pages/ # Application pages (e.g., Home, Login, Signup)
│ │ ├── lib/ # Utility functions
│ │ ├── App.tsx # Main application component
│ │ ├── index.css # Global styles
│ │ └── main.tsx # Application entry point
│ ├── tailwind.config.ts # TailwindCSS configuration
│ ├── vite.config.ts # Vite configuration
│ ├── tsconfig.json # TypeScript configuration
│ └── package.json # Project metadata and dependencies
Create a .env file in the root directory and add:
GEMINI_API_KEY=your_gemini_api_keyCreate a .env file in the frontend directory and add:
VITE_FIREBASE_API_KEY=your_api_key
VITE_FIREBASE_AUTH_DOMAIN=your_auth_domain
VITE_FIREBASE_PROJECT_ID=your_project_id
VITE_FIREBASE_STORAGE_BUCKET=your_storage_bucket
VITE_FIREBASE_MESSAGING_SENDER_ID=your_messaging_sender_id
VITE_FIREBASE_APP_ID=your_app_id- Fork the repository.
- Create a new branch:
git checkout -b feature-name
- Make your changes and commit them:
git commit -m "Add feature-name" - Push to your fork:
git push origin feature-name
- Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Firebase for backend services.
- Leaflet.js for map integration.
- Radix UI and ShadCN UI for UI components.
- Lucide Icons for icons.
- Gemini AI for chatbot integration.
Feel free to contribute and make CitizenAlert even better!