An AI-powered hyperlocal service discovery and transparent matching platform connecting people with verified local service providers.
Explore the Docs ยป
Getting Started
ยท
AI Matching Architecture
ยท
Telegram Bot
ยท
API Reference
ยท
Testing Strategy
- ๐ Project Overview
- โ Problem Statement
- ๐ก Our Solution
- โจ Key Features
- ๐ง AI & Smart Matching Architecture
- ๐บ๏ธ How It Works
- ๐ ๏ธ Technology Stack
- ๐๏ธ System Architecture
- ๐ Repository Structure
- ๐ Getting Started
- โก Running the Project
- ๐ API Endpoints
- ๐ค Telegram AI Bot
- ๐งช Testing Strategy
- ๐ Security & Privacy
- ๐ Development Workflow
- ๐บ๏ธ Roadmap
- ๐ License & Authors
LocalConnect is an AI-first, hyperlocal service discovery platform designed to connect consumers with vetted, high-trust local service professionals (tutors, electricians, plumbers, home chefs, mechanics, fitness trainers, and technicians) based on their actual needs, exact location proximity, real-time availability, budget, and multi-pillar trust signals.
Unlike traditional static directory listings that rely on keyword spam and pay-to-win ads, LocalConnect treats local discovery as an intent-driven matching problem. Users describe their requirements naturally (e.g., "Need a Class 12 Maths tutor in Dharampeth under โน500/hr for weekend boards prep"), and LocalConnect's intelligence layer extracts semantic parameters, computes a 7-factor explainable match score, and surfaces the best-fit local providers with verified trust audits.
LocalConnect delivers a dual-interface experience:
- Modern Responsive Web Application: 12 interactive screens with conversational search refinement, algorithm weight customization, provider comparison modals, trust audits, and provider dashboards.
- Telegram AI Chatbot (
@LocalConnect001bot): Complete conversational natural language search, match cards, profile inspection, 4-pillar trust scorecards, and review intelligence directly inside Telegram.
Finding a trustworthy local service provider today is fragmented across WhatsApp groups, word-of-mouth, Instagram accounts, and ad-heavy search engines. Consumers face:
- Zero Transparency: Fake reviews, hidden prices, and unverified credentials.
- Manual Overhead: Calling multiple numbers to inquire about rates and weekend availability.
- Location Inefficiency: Getting recommendations for providers located too far across town.
- Low Trust: Uncertainty over who is entering the household or teaching a family member.
Skilled independent workers and local micro-businesses face severe digital hurdles:
- Lack of marketing budgets to compete with sponsored ad listings on legacy portals.
- Inability to showcase verified proof of work, verified government credentials, or verified response rates.
- Inbound inquiries with poor fit (mismatched budgets, incompatible timings, or unrealistic distances).
There is a critical need for an intelligent, intent-based matchmaking engine that understands natural language needs, guarantees factual trust transparency, and connects local demand with local talent.
LocalConnect replaces static search listings with an Explainable 7-Factor Semantic Match Engine and a 4-Pillar Verified Trust Audit:
flowchart LR
A[Natural Language Need] --> B[AI Need Parser]
B --> C[7-Factor Weighted Matching]
C --> D[Ranked Local Providers]
D --> E[4-Pillar Trust Audit]
E --> F[Direct Connection]
- Natural Understanding: Converts conversational text and Hinglish inputs into structured requirement contracts.
- Deterministic & Explainable Matching: Computes a transparent 0โ100% Match Score based on mathematical criteria weights, not black-box guesses.
- Verified Credibility: Audits providers across Identity, Verified Experience, Ratings, and Responsiveness.
- Conversational Multi-Turn Refinement: Refines searches dynamically without losing session context.
| Category | Feature | Status | Description |
|---|---|---|---|
| Search & Discovery | Natural Language Need Parser | โ Implemented | Extracts service category, skill level, budget ceiling, location radius, and timing constraints from free-form text. |
| Search & Discovery | Conversational Search Refinement | โ Implemented | Multi-turn query adjustments (e.g. "Only highly rated", "Within 3 km", "Available Sunday") preserving active search context. |
| Matching Engine | 7-Factor Explainable Matching | โ Implemented | Transparent scoring algorithm evaluating skills, semantic similarity, distance, schedule, budget, trust, and response rate. |
| Matching Engine | Dynamic Algorithm Weighting | โ Implemented | Interactive drawer allowing users to customize matching weight priorities in real time. |
| Matching Engine | Provider Comparison Modal | โ Implemented | Side-by-side comparison of candidate match scores, hourly rates, verified jobs, and distance. |
| Trust & Verification | 4-Pillar Trust Scorecard | โ Implemented | 100-point audit evaluating Identity (25 pts), Experience (25 pts), Ratings (30 pts), and Responsiveness (20 pts). |
| Trust & Verification | AI Review Intelligence | โ Implemented | Grounded sentiment extraction displaying top praised qualities, honest caveats, and real client testimonials. |
| Provider Tools | Provider AI Assistant | โ Implemented | Evaluates inbound job requests, computes Request Fit Score %, and generates rate-grounded suggested replies. |
| Telegram Interface | Full-Featured Telegram AI Bot | โ Implemented | Complete conversational bot (@LocalConnect001bot) with interactive reply keyboards, inline match cards, profile viewers, and trust audits. |
| User Dashboard | Customer & Provider Dashboards | โ Implemented | Active request status tracking, lead management, and profile enhancement modals. |
The LocalConnect AI subsystem (ai/) is designed around a multi-provider architecture featuring Google Gemini 1.5/2.0 with an automated, zero-latency Local Deterministic Fallback Engine. This guarantees 100% uptime, zero hallucinations, and consistent test reliability even offline.
ai/
โโโ parser/ # Converts free-form text into structured NeedRequirement JSON
โโโ matching/ # 7-factor weighted multi-criteria ranking algorithm
โโโ refinement/ # Stateful multi-turn conversational filter manager
โโโ trust/ # 4-pillar verified trust score computation
โโโ review_intelligence/ # Review sentiment, praised themes, and nuance extraction
โโโ provider_assistant/ # Inbound lead fit evaluator & draft response generator
โโโ services/ # GeminiProvider, LocalDeterministicProvider, AIService
โโโ schemas/ # TypeScript interfaces and JSON data contracts
โโโ shared/ # Semantic domain ontology and keyword dictionary
โโโ prompts/ # Structured LLM system prompts
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ 1. Skill & Category Match (30%) โโ [Core Competency] โ
โ 2. Semantic Intent Similarity (20%) โโ [Context Match] โ
โ 3. Distance Proximity (15%) โโ [Haversine / Km] โ
โ 4. Availability & Schedule (10%) โโ [Day / Slot Fit] โ
โ 5. Budget Compatibility (10%) โโ [Price Fit] โ
โ 6. Verified Trust Score (10%) โโ [Credibility] โ
โ 7. Historical Response Rate (05%) โโ [Reliability] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
- Match Score (0โ100%): Measures how well the provider satisfies the current specific user request (Category, Distance, Budget, Schedule).
- Trust Score (0โ100 pts): Measures the provider's overall verified credibility across all time (Aadhaar verification, completed jobs count, verified client ratings, and reply speed).
sequenceDiagram
autonumber
actor User as Consumer
participant UI as Web / Telegram Bot
participant AI as AI Intelligence Layer
participant Match as Matching Engine
participant DB as Provider Registry
User->>UI: "Need a Class 12 Maths tutor near Dharampeth under โน500"
UI->>AI: Parse natural language query
AI-->>UI: Structured Requirement (Service: Maths, Budget: โน500, Loc: Dharampeth)
UI->>Match: Match against verified providers
Match->>DB: Query candidates in radius
Match-->>UI: Ranked Provider Cards with 7-factor Match Scores & Why Bullets
User->>UI: Refine: "Only available on Sunday"
UI->>Match: Re-rank with updated Sunday filter
Match-->>UI: Refined Candidate Results
User->>UI: View 4-Pillar Trust Scorecard & Reviews
User->>UI: Click Connect
| Domain | Technology | Purpose |
|---|---|---|
| Frontend Framework | React 19 (TypeScript) | Declarative component UI and single-page application structure |
| Bundler & Tooling | Vite 8 + Rolldown | High-speed ESM development server and optimized production bundling |
| Styling & Design | Tailwind CSS + Vanilla CSS | Modern responsive design system, glassmorphism, and dark/light modes |
| UI Components | Radix UI + Lucide React | Accessible UI primitives, dialogs, drawers, sheets, and icon set |
| Animations | Motion (Framer Motion) | Smooth micro-interactions, page transitions, and slide animations |
| Backend API | Node.js + Express 5 | REST API server routing /api/ai/* endpoints and service adapters |
| AI / NLP | Google Gemini + Deterministic Engine | Semantic natural language parsing, lead evaluations, and zero-hallucination fallback |
| Chatbot Interface | Telegram Bot API (Node.js) | Standalone Telegram bot with long-polling daemon and inline keyboard routers |
| Data Contracts | TypeScript Interfaces + JSON Schemas | Strict type safety across frontend, backend, and AI pipeline |
| Test Automation | Node.js Native Test Runner (.test.mjs) |
153 automated tests covering parser, matching, refinement, trust, and bot |
graph TD
subgraph Clients["User Interfaces"]
WebApp["๐ Web Application (React 19 / Vite)"]
TeleBot["๐ค Telegram Bot (@LocalConnect001bot)"]
end
subgraph BackendAPI["Backend Layer (Node.js / Express)"]
Router["Express Router (/api/ai)"]
HealthEndpoint["/api/health"]
end
subgraph AIIntelligence["LocalConnect AI Subsystem (ai/)"]
Parser["Parser Engine (ai/parser)"]
MatchingEngine["7-Factor Match Engine (ai/matching)"]
RefinementEngine["Refinement Engine (ai/refinement)"]
TrustEngine["Trust Engine (ai/trust)"]
ReviewEngine["Review Intelligence (ai/review_intelligence)"]
AssistantEngine["Provider Assistant (ai/provider_assistant)"]
ProviderAdapter["AIService Provider (Gemini / LocalFallback)"]
end
subgraph DataStore["Data & Domain Layer"]
ProviderData["Verified Providers Registry"]
Ontology["Semantic Domain Ontology & Thesaurus"]
end
WebApp --> Router
TeleBot --> Router
Router --> Parser
Router --> MatchingEngine
Router --> RefinementEngine
Router --> TrustEngine
Router --> ReviewEngine
Router --> AssistantEngine
Parser --> ProviderAdapter
MatchingEngine --> ProviderAdapter
MatchingEngine --> ProviderData
MatchingEngine --> Ontology
LocalConnect/
โโโ Backend/ # Express API Backend
โ โโโ src/
โ โ โโโ config/ # Database and service configs
โ โ โโโ controllers/ # AI & request controllers
โ โ โโโ routes/ # Express route definitions (/api/ai, /api/health)
โ โ โโโ app.js # Express application setup
โ โ โโโ server.js # Server bootstrap entry point
โ โโโ package.json
โโโ ai/ # Core AI Intelligence Subsystem
โ โโโ matching/ # 7-factor ranking algorithm & weights
โ โโโ parser/ # Natural language & Hinglish requirement parser
โ โโโ refinement/ # Conversational multi-turn search refiner
โ โโโ trust/ # 4-pillar trust evaluation engine
โ โโโ review_intelligence/ # Review sentiment & theme analysis
โ โโโ provider_assistant/ # Lead fit evaluator & reply generator
โ โโโ services/ # Gemini & deterministic fallback providers
โ โโโ schemas/ # JSON and TypeScript data contracts
โ โโโ shared/ # Semantic ontology and dictionary
โ โโโ prompts/ # System prompt templates
โ โโโ index.ts # AI module exports
โโโ src/ # Frontend Source (React 19 + TypeScript)
โ โโโ api/ # Client API adapters (ai, providers, auth)
โ โโโ assets/ # Brand logos, photography, and fonts
โ โโโ components/ # Reusable UI primitives (dialogs, cards, buttons)
โ โโโ context/ # AuthContext and RequestContext state
โ โโโ features/ # Feature modules (matching, trust, refinement, provider)
โ โโโ pages/ # 12 page views (Home, Search, Results, Dashboards, Auth)
โ โโโ services/ # Matching & AI client bridge
โ โโโ styles/ # Global styling and Tailwind tokens
โ โโโ types/ # Domain interfaces and contracts
โ โโโ main.tsx # React application entry point
โโโ telegram/ # Telegram AI Chatbot Subsystem
โ โโโ bot/
โ โ โโโ formatters/ # Card, profile, trust scorecard & review formatters
โ โ โโโ handlers/ # Command, text, callback, and refinement routers
โ โ โโโ keyboards/ # Inline and reply keyboard layouts
โ โ โโโ services/ # Telegram API & LocalConnect client bridge
โ โ โโโ session/ # Multi-turn user session context store
โ โ โโโ config.js # Bot configuration & token validation
โ โ โโโ main.js # Telegram bot polling runner
โ โโโ tests/ # Automated Telegram test suites (Steps 3โ7)
โโโ Docs/ # Architecture specs, PRD, TRD, and schemas
โโโ dist/ # Optimized production bundle
โโโ package.json # Project dependencies and script runner
โโโ tsconfig.json # TypeScript configuration
โโโ vite.config.ts # Vite build configuration
- Node.js: v18.0.0 or higher (
node -v) - npm: v9.0.0 or higher (
npm -v) - Git: Installed and configured
git clone https://github.com/Nipun75/LocalConnect.git
cd LocalConnectnpm installCreate a .env file in the root directory (refer to .env.example):
cp .env.example .envSet the required environment variables:
# Server & API Ports
PORT=5000
LOCALCONNECT_API_URL=http://localhost:5000/api
# Telegram Chatbot (Optional for Telegram bot)
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_from_botfather
TELEGRAM_POLL_INTERVAL_MS=1000
# Google Gemini AI (Optional - Local Deterministic Fallback used automatically if absent)
GEMINI_API_KEY=your_gemini_api_key_hereLocalConnect components can be run independently or concurrently:
npm run devAccess the web app at: http://localhost:5173
npm run build
npm run previewAccess the production build at: http://localhost:4173
npm run start:backendAPI health check available at: http://localhost:5000/api/health
npm run start:telegramOpen Telegram and message: @LocalConnect001bot
The Express Backend exposes clean RESTful endpoints consumed by both the web application and the Telegram bot:
| Method | Endpoint | Description | Sample Payload / Params |
|---|---|---|---|
GET |
/api/health |
Health check & feature discovery | None |
POST |
/api/ai/parse-need |
Parse natural language text into structured requirement | {"text": "Need a maths tutor for class 12 under 500"} |
POST |
/api/ai/match |
7-factor ranking of providers for structured need | {"requirement": {...}} |
POST |
/api/ai/chat |
Conversational query refinement | {"query": "Only highly rated ones", "currentRequirement": {...}} |
POST |
/api/ai/refine |
Alias for multi-turn search refinement | {"query": "Within 3 km", "context": {...}} |
GET |
/api/ai/recommendations |
Get personalized provider recommendations | ?lat=21.1458&lng=79.0882&category=tutor |
POST |
/api/ai/feedback |
Record recommendation feedback for ranking tuning | {"providerId": "prov_math_01", "rating": 5} |
The LocalConnect Telegram bot is a native integration running directly against the existing LocalConnect AI and Backend subsystem.
Telegram User โโ> Telegram Bot Service โโ> AI Parser โโ> 7-Factor Match Engine โโ> Ranked Cards
- Username: @LocalConnect001bot
- Supported Commands:
/startโ Welcome screen with interactive navigation buttons./helpโ How to search and command guide./searchโ Start a fresh provider search and reset context./profileโ View user account status./requestsโ View active service requests.
- Natural Language Capabilities:
- Send any natural language requirement directly: "Need an emergency electrician in Dharampeth right now"
- Refine conversationally: "Only ones available Sunday", "Increase budget to โน700", "Within 3 km"
- Tap [ ๐ค View Profile ], [ ๐ก๏ธ Trust Scorecard ], and [ โญ Customer Reviews ] to inspect credentials before connecting.
LocalConnect includes an extensive automated test suite of 153 unit and end-to-end tests validating all algorithms, fallback states, and bot interactions.
# Run all test suites across the repository
npm run test:all- AI Matching & Scoring Tests (
npm run test:step6):- 19 automated tests validating natural language parsing, 7-factor weighted scoring, explainable why generation, conversational refinement, and provider assistant fit calculations.
- Telegram Bot Integration Tests (
npm run test:telegram):- 102 automated tests across Steps 3, 4, 5, 6, and 7 validating connection lifecycle, requirement summaries, candidate rankings, context preservation, 4-pillar trust scorecards, and security on malformed callback IDs.
- Core AI Unit Tests (
npm test):- 32 automated tests validating offline deterministic fallbacks and semantic ontology matching.
- Zero PII Exposure: Private provider contact details (phone number, email, address) are never exposed through Telegram cards or search APIs prior to confirmed user connection.
- Credential Isolation: Secrets (
TELEGRAM_BOT_TOKEN,MONGO_URI,GEMINI_API_KEY) are managed strictly via git-ignored.envfiles and validated at boot. - Deterministic Guardrails: AI response templates are strictly grounded in factual provider profiles to prevent LLM hallucinations.
- Input Sanitization: Callbacks, queries, and numerical parameters are parsed with strict boundary validation and safe fallback handlers.
Create Feature Branch โโ> Local Development โโ> Run Test Suite โโ> Build Verification โโ> Open PR
- Create Branch:
git checkout -b feature/your-feature-name - Develop: Make modular code changes following the existing architecture.
- Test: Run
npm run test:all(all 153 tests must pass 100%). - Build: Run
npm run buildto verify clean TypeScript compilation and asset bundling. - Commit & Push: Follow conventional commit conventions (
feat:,fix:,docs:,test:).
- Natural language need parser with Hinglish support
- 7-factor transparent provider matching algorithm
- 4-pillar verified trust scorecard engine
- AI review intelligence and testimonial summarization
- Conversational multi-turn search refinement
- Provider AI Assistant with request fit score & reply drafting
- Complete 12-screen responsive React 19 web application
- Native Telegram AI chatbot (
@LocalConnect001bot) - 153 automated integration and unit tests
- Direct in-app WebRTC audio/video consultations
- Multi-city expansion beyond the Nagpur pilot region
- WhatsApp Business Cloud API bot integration
- Real-time provider location tracking on interactive Leaflet/Mapbox maps
- Decentralized identity verification via verifiable credentials
- Escrow-based smart milestone payments
- Multi-lingual voice-to-text search support (Hindi, Marathi)
This project is licensed under the ISC License โ see the LICENSE file for details.
Developed with โค๏ธ for LocalConnect โ Making local discovery smarter, more trusted, and seamlessly connected.
Repository: https://github.com/Nipun75/LocalConnect
