Collision-Aid is a web application designed to assist Canadians in easily locating collision repair centers in their area. With the prevalence of auto collisions, finding a trustworthy and affordable repair center can be challenging. This app streamlines the process by allowing users to input a Canadian postal code and search radius, returning all collision repair centers within that specified area. The results are displayed on a leaflet.js map, providing users with an interactive and visual representation of available repair centers.
-
Clone the Repository:
git clone [repo_url]
-
Create Virtual Environment:
virtualenv venv
-
Activate Virtual Environment:
- CMD:
venv\Scripts\activate
- Bash:
source venv/bin/activate
- CMD:
-
Install Requirements:
For Linux, run:pip install psycopg2-binary pip install -r requirements.txt
For Windows, run:
pip install psycopg2==2.9.5 pip install -r requirements.txt
-
Setup PostgreSQL and PostGIS:
- Use a serverless service like neon.tech or set up locally with Docker.
- Create a database named
collision_aid
and enable the PostGIS extension:CREATE EXTENSION postgis;
-
Create .env File: Create a
.env
file in the BASE_DIR (same folder asmanage.py
) with the following environment variables:SECRET_KEY=your_secret_key DEBUG=True DB_NAME=collision_aid DB_USER=your_postgres_username DB_PASS=your_postgres_password DB_HOST=your_postgres_endpoint DB_PORT=5432 STATIC_URL=static/ ALLOWED_HOSTS=* ENGINE=django.contrib.gis.db.backends.postgis EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend' EMAIL_HOST=your_email_host EMAIL_USE_TLS=True EMAIL_PORT=587 EMAIL_HOST_USER=your_email EMAIL_HOST_PASSWORD=your_email_password
-
Install GDAL:
- For Windows, download the appropriate wheel file from here and install using:
pip install full_path_to_wheel_file
- For Linux (Ubuntu), run:
source gdal_install.sh
- For Windows, download the appropriate wheel file from here and install using:
-
Run System Check:
From the BASE_DIR, run:python manage.py check
-
Create Database Tables:
python manage.py makemigrations python manage.py migrate
-
Load Dummy/Fake Data into Database:
python manage.py shell import os from django.conf import settings from shops.load import load_shop, load_postal_codes b = settings.BASE_DIR load_postal_codes(os.path.join(b, 'CanadianPostalCodes202208.csv')) load_shop(os.path.join(b, 'faker_shops_tilder.txt'))
-
Run the Django development server:
python manage.py runserver
-
Access the application in your web browser at
http://localhost:8000
. -
Enter a Canadian postal code and search radius to locate collision repair centers in the specified area.
Auto collisions are a common occurrence, and the app aims to simplify the process of finding trustworthy and affordable collision repair centers. Users can quickly locate repair centers within a specified radius, view their rates on an interactive map, and access aggregated repair rates in a table. The app also allows users to submit new collision repair centers and their rates, contributing to a comprehensive database.
We welcome contributions to improve Collision-Aid. If you find any issues or have suggestions, please open an issue or submit a pull request.
This project is licensed under the MIT License.
- Special thanks to neon.tech for providing a generous free tier for serverless PostgreSQL services.
- The app utilizes the Leaflet.js library for interactive maps.
Feel free to explore, use, and contribute to make Collision-Aid even better!