The security platform for all civilians and Malawi police where you can report emergency and ask security based questions.
# Police Security AI Platform
A comprehensive platform designed to enhance community safety by connecting citizens with law enforcement through secure, real-time communication channels.
## Features
- **Secure Reporting**: Submit anonymous reports with end-to-end encryption
- **Real-Time Action**: Immediate dispatch alerts to the nearest patrol units
- **Emergency Notifications**: Receive immediate notifications about safety incidents
- **Incident Reporting**: Submit detailed reports with location, photos, and descriptions
- **AI-Powered Assistance**: Built-in chatbot for security advice and emergency detection
- **Location Tracking**: Real-time tracking for civilians and police officers
- **Role-Based Access**: Separate interfaces for civilians and police officers
## Technology Stack
- **Backend**: FastAPI
- **Database**: SQLite (with SQLAlchemy ORM)
- **Frontend**: HTML/CSS/JavaScript
- **Authentication**: JWT-based with role-based access control
- **AI/ML**: LangChain, Sentence Transformers, FAISS for RAG (Retrieval-Augmented Generation)
- **Security**: bcrypt for password hashing
## Installation
1. Clone the repository
2. Create a virtual environment:
```bash
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Create a `.env` file with the following variables:
```
SECRET_KEY=your_secret_key_here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
```
## Running the Application
### Method 1: Simple startup with automatic browser opening (Recommended)
Use the new startup script to install dependencies, initialize the database, run the server, and automatically open your browser:
```bash
# Full setup and run with browser automatically opening (recommended)
python startup.py
# Or install dependencies only
python startup.py --install
# Or initialize database only
python startup.py --init-db
# Or run server with browser automatically opening
python startup. …