CrimeVue is a powerful web application that enables users to visualize and analyze real-time crime data. By scraping crime-related information from Twitter, the app provides an interactive map interface where users can explore crime incidents, access detailed crime information, and contribute to community safety efforts.
Ontario-Crime-Mapper-Frontend/ocmf
: Contains the frontend codebase for the Crime Mapper application built with Next.js.Ontario-Crime-Mapper-Backend
: Contains the backend codebase for the Crime Mapper application built with Node.js and Express.Twitter_Scraper
: Contains the Python scraper code used to collect real-time crime data from Twitter.
- Frontend: Next.js
- Backend: Node.js, Express
- Database: MongoDB
- Scraper: Python
- Real-time Crime Data: Utilizes web scraping techniques to gather up-to-date crime data from Twitter, ensuring the accuracy and relevance of information.
- Interactive Map Interface: Displays crime incidents on a user-friendly map, allowing users to navigate and explore crime hotspots and patterns.
- Custom Marker Icons: Uses unique icons to represent different types of crimes, providing visual cues for easier interpretation and understanding.
- Detailed Crime Information: Allows users to click on map markers to view comprehensive details about each crime incident, including location, date, time, and description.
- Community Chat (Coming Soon): Facilitates user interactions and knowledge sharing through a chat feature, enabling users to connect, share safety tips, and discuss crime-related concerns.
- Crime Reporting (Coming Soon): Empowers users to report crimes directly through the app, contributing to crime prevention efforts and assisting law enforcement agencies.
Crime Mapper utilizes different markers on the map to represent various types of crimes. Each marker is associated with a unique image icon, making it easy for users to identify the crime category at a glance. Here are the marker categories and their respective images:
- Car Jacking
- Collision
- Crowd Control
- Elopee
- Fire
- Firearm Discharge
- Hazard
- Industrial Accident
- Media Advisory
- Person Missing
- Person With a Gun
- Road Closures
- Shooting
- Sound Of Gunshots
- Sudden Death
- Suspicious Incident
- Unknown Trouble
- Unknown
- Updates
- Clone the repository:
git clone https://github.com/Humza-Aa/Ontario_Crime-Mapper.git
- Navigate to the frontend directory:
cd Ontario-Crime-Mapper-Frontend/ocmf
- Install the frontend dependencies:
npm install
- Start the frontend server:
npm run dev
-
Open your web browser and visit
http://localhost:3000
to access the Crime Mapper frontend. -
For the backend, navigate to the backend directory:
cd Ontario-Crime-Mapper-Backend
- Install the backend dependencies:
npm install
- Create a
.env
file in theOntario-Crime-Mapper-Backend
directory and provide the following environment variables:
PORT=4000
MONGODB_LINK=your-mongodb-connection-string
MONGODB_USER=your-mongodb-username
MONGODB_PASS=your-mongodb-password
TOKENPASSWORD=your-access-token-password
REFRESHTOKENPASSWORD=your-refresh-token-password
- Start the backend server:
npm start
- For the Python scraper, navigate to the scraper directory:
cd Twitter_Scraper
- Set up a Python virtual environment (recommended):
python -m venv venv source venv/bin/activate
- Install the Python dependencies:
pip install -r requirements.txt
- Create a
.env
file in theTwitter_Scraper
directory and provide the following environment variables:
MONGODB_USER=your-mongodb-username
MONGODB_PASS=your-mongodb-password
TW_USERNAME=your-twitter-username
TW_PASSWORD=your-twitter-password
Please note that you need to use the same MongoDB cluster credentials (MONGODB_USER
and MONGODB_PASS
) for both the backend and the Twitter scraper.
- Run the scraper:
python scraper.py
Contributions are welcome! If you'd like to contribute to Crime Mapper, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them with descriptive messages.
- Push your changes to your forked repository.
- Submit a pull request, clearly describing the changes you've made.
This project is licensed under the MIT License.
For any inquiries or feedback, please contact humzaaamir31@gmail.com.