A web application to visualize crime hotspots in India using interactive maps. This project uses React for the frontend and Flask for the backend with a Kaggle crime dataset.
- Interactive map using Leaflet.
- Displays crimes as markers on the map.
- Markers are color-coded by crime type.
- Fetches real-time data from the Flask backend.
- Node.js v18+ and Yarn
- Python 3.8+
- pip (Python package manager)
- Virtualenv (recommended)
- Navigate to the api folder:
cd api Create and activate a virtual environment:
pip install -r requirements.txt Make sure crime_data.csv exists in the api folder.
Run the backend server:
python app.py The API will be available at: http://127.0.0.1:5000/api/crimes
###Frontend
Navigate to the frontend folder:
cd frontend Install dependencies using Yarn:
yarn install Start the frontend:
yarn start The app will open in your browser at http://localhost:3000.
Open the app in your browser.
The map displays crime locations across India.
Each marker represents a crime; the color indicates the type.
Make sure the backend is running before starting the frontend, otherwise markers will not load.
The app uses marker clustering for better performance and visualization.