Skip to content

freaklearner/location-eval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎯 Location Evaluation Tool v2.0 - The Momos Mafia

πŸš€ Complete System Overhaul

The Location Evaluation Tool has been completely rebuilt with a new 7-Step Slab-Based Framework that eliminates the uniform scoring issue and provides accurate, differentiated location evaluation for franchise expansion.

πŸ”₯ Key Problem Solved

  • ❌ Before: Same 75-80% score for every location
  • βœ… After: True differentiation from 15% (poor) to 95% (excellent) locations

πŸ—οΈ New Architecture

7-Step Evaluation Framework

1. Data Fetch       β†’ Multi-radius Google Maps API calls
2. Query Processing β†’ Brand-specific keyword matching  
3. Signal Extraction β†’ Quality, density, price indicators
4. Proxy Analysis   β†’ Measurable business metrics
5. Slab Assignment  β†’ 5-tier classification system
6. Confidence Score β†’ Data quality assessment
7. Final Integration β†’ Format-based weight adjustments

5-Slab Classification System

  • Slab 1: Budget/Mass (0-20%) - Street-heavy, price-sensitive
  • Slab 2: Entry-level (21-40%) - Basic organized presence
  • Slab 3: Mid-market (41-60%) - Balanced catchment
  • Slab 4: Premium (61-80%) - Organized, aspirational
  • Slab 5: Luxury/Elite (81-100%) - High-end destination

πŸ“Š 22 Evaluation Parameters

🎯 High Priority (Direct Revenue Drivers)

Parameter Weight Purpose
Footfall 18% Walk-in traffic density
Delivery Density 15% Zomato/Swiggy ecosystem
Spending Capacity 12% Economic indicators
Target Audience Fit 10% Demographics alignment
Competition Pricing 8% Market saturation

🏒 Medium Priority (Market Indicators)

Parameter Weight Purpose
Schools/Colleges 7% Student demographics
Offices/Businesses 7% Lunch crowd potential
Residential Quality 7% Repeat customer base
Food Brand Presence 5% Market maturity
Nightlife/CafΓ©s 4% Aspirational crowd

πŸ› οΈ Supporting Factors (12 more parameters)

Infrastructure, safety, branding opportunities, and lifestyle indicators.


πŸ”„ Format-Based Optimization

Cart Format (Street/Tier-2 focus)

  • ⬆️ Footfall weight: 25%
  • ⬆️ Student demographics: 10%
  • ⬇️ Delivery density: 8%

Cloud Kitchen (Delivery-first)

  • ⬆️ Delivery density: 25%
  • ⬆️ Spending capacity: 15%
  • ⬇️ Footfall: 5%

CafΓ©/Premium (Dine-in experience)

  • ⬆️ Nightlife/cafΓ© presence: 12%
  • ⬆️ Shopping preferences: 8%
  • ➑️ Balanced footfall: 15%

πŸš€ Quick Start

Prerequisites

  • Node.js 16+
  • Google Maps API key with Places API enabled
  • Environment variables configured

Installation

# Clone repository
git clone <repo-url>
cd Location-Evaluation-Tool

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies  
cd ../
npm install

# Set environment variables
echo "GOOGLE_MAPS_API_KEY=your_api_key_here" > backend/.env

Development

# Start backend (Port 3001)
cd backend
npm run start:dev

# Start frontend (Port 3000)
cd ../
npm start

πŸ“‘ API Endpoints

Complete Analysis

POST /analysis/complete
Content-Type: application/json

{
  "lat": 28.6139,
  "lng": 77.2090,
  "radius": 800,
  "format": "cart",
  "clientName": "Test Location",
  "address": "Connaught Place, Delhi"
}

Quick Location Check

POST /location/analyze
Content-Type: application/json

{
  "lat": 28.6139,
  "lng": 77.2090,
  "radius": 800,
  "format": "cloud_kitchen"
}

System Health

GET /analysis/health
GET /analysis/config
POST /analysis/validate

πŸ“Š Sample Response

{
  "success": true,
  "evaluation": {
    "overall": {
      "percentage": 67.5,
      "grade": "B", 
      "confidence": 82.3
    },
    "parameters": [
      {
        "name": "Footfall",
        "slab": 3,
        "score": 58.2,
        "weight": 18,
        "reason": "Mid market: middle-class families + students",
        "indicators": ["CBSE schools", "reviews 200-500", "balanced vehicle mix"]
      },
      {
        "name": "Delivery Density",
        "slab": 4, 
        "score": 74.1,
        "weight": 15,
        "reason": "Dense hub: 4+ national brands, 2+ cloud kitchens",
        "indicators": ["Domino's", "Wow! Momo", "late-night options"]
      }
      // ... 20 more parameters
    ],
    "recommendations": [
      "βœ… Recommended: Good location with solid fundamentals",
      "πŸ’ͺ Key Strengths: Delivery Density, Office Presence", 
      "πŸ”§ Priority Improvements: Food Brand Presence, Residential Quality"
    ]
  }
}

🏒 Business Logic

Slab Assignment Example: Food Brand Presence

  • Slab 1: 90%+ local outlets, no branded chains
  • Slab 2: 1-2 regional chains, no global QSR
  • Slab 3: 2-3 national chains, local strong
  • Slab 4: 3-4 global QSR + national chains
  • Slab 5: Multiple global QSR (β‰₯5) + national chains

Confidence Scoring

  • Data Coverage: % parameters with sufficient data
  • Review Density: Average reviews per POI
  • Brand Recognition: Clarity of brand identification
  • Radius Consistency: Score stability across different radius

πŸ“ Project Structure

Location-Evaluation-Tool/
β”œβ”€β”€ backend/                    # NestJS API server
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ config/
β”‚   β”‚   β”‚   └── evaluation.config.json  # Core evaluation logic
β”‚   β”‚   └── modules/
β”‚   β”‚       └── location/
β”‚   β”‚           β”œβ”€β”€ location.service.ts  # Main evaluation engine
β”‚   β”‚           β”œβ”€β”€ analysis.controller.ts
β”‚   β”‚           └── location.controller.ts
β”œβ”€β”€ src/                        # React frontend
β”‚   β”œβ”€β”€ components/            # UI components
β”‚   └── services/             # API integration
β”œβ”€β”€ Evalution-Logic/          # Business logic documentation
β”‚   β”œβ”€β”€ Location Evaluation Tool-Brain.md
β”‚   └── Location Evaluation Tool-Decide Weight.md
└── NEW_EVALUATION_SYSTEM_SUMMARY.md  # Complete technical overview

πŸ”§ Configuration

The system is driven by backend/src/config/evaluation.config.json:

  • 22 evaluation parameters with weights and slab criteria
  • Format-based adjustments for different business models
  • Brand categorization for quality assessment
  • Confidence factors for data reliability scoring

πŸš€ Deployment

Development

npm run start:dev  # Backend with hot reload
npm start          # Frontend with hot reload

Production

npm run build      # Build both backend and frontend
npm run start:prod # Production server

Docker

docker-compose up --build

πŸ“ˆ Performance Features

  • βœ… Multi-radius analysis for comprehensive coverage
  • βœ… Intelligent API rate limiting to optimize Google Maps usage
  • βœ… Confidence-based scoring for data quality assurance
  • βœ… Format optimization for different business models
  • βœ… Caching mechanisms for repeated evaluations
  • βœ… Error handling with graceful degradation

πŸ› οΈ Development

Adding New Parameters

  1. Define parameter in evaluation.config.json
  2. Add slab criteria and weight
  3. Implement evaluation logic in location.service.ts
  4. Update frontend components if needed

Modifying Weights

Format-specific weights can be adjusted in the formatBasedWeights section of the configuration.


πŸ“ž Support

  • Technical Issues: Check logs in logs/ directory
  • API Errors: Verify Google Maps API key and quotas
  • Configuration: Refer to NEW_EVALUATION_SYSTEM_SUMMARY.md

🎯 Built specifically for The Momos Mafia franchise expansion with accurate, data-driven location evaluation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published