A robust, lean Django-based web platform connecting customers with reliable local contractors through a geospatial search and an automated trust scoring system.
LocalKonnect helps customers find trustworthy local contractors while providing contractors a platform to showcase their services and build their reputation through customer feedback and trust scores. The platform was recently refactored to focus on a highly stable, synchronous core flow: Customer -> Search -> Contractor Detail -> Submit Feedback -> Trust Score Updates -> Reflected in Search.
- β Custom user model with role-based access (Customer / Contractor)
- β Standard session-based authentication
- β Google OAuth integration with smart user-type auto-detection
- β User profile management with exact geographical coordinates (PostGIS Point field)
- β Built-in password reset functionality (utilizing Django's secure token system and console email backend)
- β Auto-created contractor profiles via Django signals
- β
Office location tracking with PostGIS
Pointfield andGISTindexes - β Service radius configuration
- β Verification status tracking
- β Service categories and subcategories
- β Contractor service management
- β Per-service trust scores calculated automatically based on customer feedback
- β
Synchronous
Feedbackmodel ensuring absolute data integrity - β 1-5 star rating system with verified feedback bonuses
- β Dynamic trust score algorithm combining rating, verified status, and contractor experience
- β Trust score instantly updates and reflects in search rankings upon feedback submission
- β Public contractor profiles display aggregated, filterable, and paginated review histories
- β
Hyper-local review filtering: Utilizes PostGIS
DWithinto automatically badge and filter reviews from customers located within a 25km radius of the viewing user.
- β PostGIS-powered distance-based search
- β Filter contractors by category and location
- β Radius search to match customers with nearby contractors
- β Results deterministically ordered by trust score and distance
- β Docker Compose local setup
- β PostgreSQL 15 with PostGIS 3.3
- β
Native Django management commands for nightly maintenance tasks (e.g.,
python manage.py recompute_trust_scores) - β Lean, server-rendered frontend using Django Templates, Tailwind CSS (CDN), and Alpine.js
- Django 4.2.8 - Core web framework
- PostgreSQL 15 + PostGIS 3.3 - Primary database with robust geospatial support
- Django Templates - Template engine
- Tailwind CSS (CDN) - Utility-first styling
- Alpine.js - Lightweight reactive components
- Vanilla JavaScript - Map integration (Leaflet.js) and UI logic
- Docker & Docker Compose - Containerization
- Gunicorn - WSGI server (production-ready)
- WhiteNoise - Static file serving
- Docker Desktop installed
- Git
- Clone the repository:
git clone https://github.com/yourusername/LocalKonnect.git
cd LocalKonnect- Start the application:
docker compose up -d --build- Run database migrations:
docker compose exec backend python manage.py migrate- Seed realistic demo data:
# Create categories first
docker compose exec backend python manage.py create_categories
# Seed 10 contractors, 10 customers, services, and feedback
docker compose exec backend python manage.py seed_realistic_demo_data- Create a superuser (optional):
docker compose exec backend python manage.py shell -c "
from apps.users.models import User
User.objects.create_superuser('admin', 'admin@localkonnect.com', 'Admin1234!', user_type='contractor')
"- Access the application:
- Web Application: http://localhost:8000
- Admin Panel: http://localhost:8000/admin
Demo Logins:
- Customer:
customer1@seed.localkonnect.test/SeedPass123! - Contractor:
contractor1@seed.localkonnect.test/SeedPass123!
docker compose downdocker compose logs backend -fLocalKonnect/
βββ backend/
β βββ config/ # Django project settings and root routing
β βββ apps/
β β βββ users/ # User authentication & profiles
β β βββ contractors/ # Contractor profiles and signals
β β βββ services/ # Service categories and ContractorService models
β β βββ trust/ # Feedback models, trust score utilities, and submission logic
β β βββ search/ # Geospatial search views and Contractor detail views
β β βββ customer/ # Minimal customer dashboards
β βββ templates/ # Django templates (Base, Auth, Contractor, Customer, Search, Trust)
β βββ static/ # Static assets (CSS, JS, Images)
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Backend container configuration
β βββ manage.py # Django CLI
βββ docker-compose.yml # Multi-container orchestration (DB and Backend)
βββ README.md # This file
User
- Custom authentication model extending
AbstractUser - Handles
user_type(Customer/Contractor) and PostGISlocation.
ContractorProfile
- One-to-one with
User. - Stores
office_location(PostGIS Point),service_radius_km, and business details.
ServiceCategory & ServiceSubcategory
- Hierarchical taxonomy for the services offered on the platform.
ContractorService
- The core offering linking a Contractor to a ServiceCategory.
- Stores the calculated
trust_scorewhich is deterministically updated when feedback is given.
Feedback
- Links a
Customerto aContractorService. - Stores
rating(1-5), optional text, andis_verifiedstatus. - Triggers synchronous trust score recalculation on save.
When a customer leaves feedback for a service, the system immediately recalculates the ContractorService trust score. The algorithm factors in:
- Raw Rating: The 1-5 star value.
- Verification Bonus: Feedback marked as
is_verified(e.g. proof of work provided) is weighted significantly heavier. - Reviewer Weight: Feedback from trusted customers contributes more to the score.
- Experience Bonus: Contractors receive a slight bump based on their
years_of_experience. - Bayesian Smoothing: Prevents new services with a single 5-star review from instantly outranking established services with hundreds of solid 4.8-star reviews.
LocalKonnect utilizes PostgreSQL's PostGIS extension to handle all location data. When a customer searches:
- It calculates the exact distance between the customer's coordinate and the contractor's office coordinate.
- It filters out contractors if the customer falls outside their configured
service_radius_km. - Search queries utilize
GISTindexes for highly optimized geographical sorting.
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Version: 1.0.0