SafeCity Hub is a smart, integrated platform designed to improve urban safety by connecting citizens, police, and administrative authorities on a single digital system.
It enables real-time crime reporting, incident monitoring, and data-driven decision-making to build safer, smarter cities.
- Report Crimes: Log safety concerns with exact locations and details.
- Flexible Login: Access accounts securely with either a User ID or Registered Email.
- OTP Password Recovery: Forgot your password? Instantly recover it via a secure 6-Digit Email OTP process with a glassmorphism UI.
- Live Monitoring: Track incoming reported incidents in your specific jurisdiction in real-time.
- Status Updates: Automatically update and inform citizens regarding the resolution status of their complaints directly to their email.
- Criminal Records: Upload, manage, and attach images of known offenders securely.
- Data Analytics: Analyze crime data, visualize yearly trends on charts, and plan urban safety strategies.
- Station Management: Create regional police station sub-accounts dynamically.
Primary Stakeholders:
- Citizens
- Police / Law Enforcement
- Municipal & Administrative Authorities
Workflow:
- A citizen logs in/registers and reports an incident via the web portal.
- The system logs data securely to a cloud-ready PostreSQL database.
- Local police (matching the citizen's Area Code) receive real-time alerts and take action, emailing resolution statuses back to the citizen.
- Administrators access overarching analytics for macro policy planning.
- Python 3.10+
- PostgreSQL Server
- Git
git clone https://github.com/vedangdhuri/SafeCity-Hub.git
cd SafeCity-HubCreate a .env file at the root of your project directory to manage sensitive credentials:
# Example .env configuration
SECRET_KEY=your_django_secret_key
DEBUG=True
DATABASE_URL=postgres://YOUR_USERNAME:YOUR_PASSWORD@127.0.0.1:5432/crime_analysis
# Email Configurations for OTP
SET_EMAIL_HOST_USER=your_email@gmail.com
SET_EMAIL_HOST_PASSWORD=your_generated_app_password
SET_DEFAULT_FROM_EMAIL=your_email@gmail.comNote: Ensure your PostgreSQL has a database successfully created named crime_analysis.
# Create the virtual environment
python -m venv .venv
# Activate (Windows)
.venv\Scripts\activate
# Install all dependencies (django, psycopg2, django-dotenv, etc.)
pip install -r requirements.txtIf using Gmail, go to <a href="https://myaccount.google.com/apppasswords">App Passwords</a> and generate a sequence. Add this generated 16-character password to SET_EMAIL_HOST_PASSWORD in your .env file along with your email address in SET_EMAIL_HOST_USER and SET_DEFAULT_FROM_EMAIL.
python manage.py makemigrations
python manage.py migrate
python manage.py runserverNavigate to http://127.0.0.1:8000/ to explore the application!
Role-Based Access Control (RBAC) securely limits data access. In the police portal, an officer from Station 001 can only view citizen complaints made within area code 001.
This project is licensed under the MIT License.