# AI-Powered Land Feasibility Platform — Complete Development Blueprint
### Product: LandFeasibility.ai (India)
**Document Date:** March 6, 2026  
**Platform:** Laravel 11 + PHP Backend | React/Blade Frontend | PostGIS | Python AI Services  
**Current Status:** Admin Panel MVP (Phase 0) — Transitioning to Phase 1

---

## TABLE OF CONTENTS

1. [Current State Analysis](#1-current-state-analysis)
2. [Market Landscape & Competitor Analysis](#2-market-landscape--competitor-analysis)
3. [Our Differentiated Solution Strategy](#3-our-differentiated-solution-strategy)
4. [AI Integration Architecture — Real-Time & Predictive](#4-ai-integration-architecture--real-time--predictive)
5. [Complete System Architecture](#5-complete-system-architecture)
6. [Database Schema — Full Design](#6-database-schema--full-design)
7. [Module-by-Module Development Plan](#7-module-by-module-development-plan)
8. [Technology Stack — Final Recommendation](#8-technology-stack--final-recommendation)
9. [API Design Specification](#9-api-design-specification)
10. [Phase-wise Roadmap with Deliverables](#10-phase-wise-roadmap-with-deliverables)
11. [Security Architecture](#11-security-architecture)
12. [Cost, Team & Infrastructure Plan](#12-cost-team--infrastructure-plan)
13. [Risk Register & Mitigation](#13-risk-register--mitigation)
14. [Future Advanced Capabilities](#14-future-advanced-capabilities)

---

## 1. Current State Analysis

### What Has Been Built (Codebase Audit — March 2026)

The existing Laravel 11 codebase has a working **Admin Panel Foundation** with the following components:

| Module | Status | What Exists |
|--------|--------|-------------|
| Authentication | ✅ Done | Admin login, session guard, middleware |
| Role Management | ✅ Done | CRUD for user roles/permissions |
| State Management | ✅ Done | 28 states + regulatory body fields |
| Zone Management | ✅ Done | Zone types, FAR/FSI, setbacks, coverage, height |
| Regulation Management | ✅ Done | Title, type, state, authority, effective date, reference URL |
| Feasibility Reports | ✅ Partial | Store reports; no calculation engine yet |
| Activity Logs | ✅ Done | User action audit trail |
| Dashboard | ✅ Done | Stats overview for admin |
| GIS Engine | ❌ Missing | No map, no spatial query |
| Feasibility Calculator | ❌ Missing | No rule-match logic |
| AI/ML Layer | ❌ Missing | No NLP, no predictions |
| User-Facing Portal | ❌ Missing | No public interface |
| PDF Report Generation | ❌ Missing | No export |
| API Layer | ❌ Missing | No REST/GraphQL API |
| Real-Time Data | ❌ Missing | No external data feeds |

### Data Model Strengths (Existing)

```
zones table:
  - zone_type: Residential | Commercial | Industrial | Mixed | Agricultural | Green Belt | Heritage
  - far_fsi, max_height_m, max_ground_coverage
  - front_setback_m, side_setback_m, rear_setback_m
  - open_space_pct, permitted_uses

feasibility_reports table:
  - user_id, state_id, address, latitude, longitude
  - feasibility_score (integer), status (pending|processing|completed|failed)
  - result_data (JSON) — flexible output store

regulations table:
  - title, type, state_id, authority, effective_date
  - description, reference_url, is_active
```

**Assessment:** The data model is a solid foundation. The core tables are the right starting point. 
**Critical Gap:** The system can STORE rules and reports but cannot yet CALCULATE or EXECUTE feasibility analysis. That is the most important gap to fill.

---

## 2. Market Landscape & Competitor Analysis

### 2.1 Global Players

| Product | Country | Core Capability | Limitation for India |
|---------|---------|-----------------|----------------------|
| **Symbium** (USA) | US | Zoning lookup + ADU calculator | US-only, no India regulations |
| **LandVision** (US) | US | Property data + parcels | No Indian land records integration |
| **PropStream** (US) | US | Investment data + comps | No India data |
| **ReZone** (AUS) | Australia | DA feasibility modeling | No India support |
| **PlanningAlerts** (AUS) | Australia | Planning application alerts | Civic tool, not developer tool |
| **Estated** | US | Property data API | US-focused |
| **Regrid** | US | Parcel data platform | No India parcel data |

### 2.2 Indian Market Players

| Product | Capability | Gaps |
|---------|-----------|------|
| **PropTiger / Housing.com** | Price aggregation, listings | No regulatory compliance/feasibility |
| **Square Yards** | Transaction data, advisory | Manual advisory, not automated |
| **Anarock** | Developer advisory reports | Consultant-based, not platform-based |
| **Magicbricks** | Listings, price trends | Consumer platform, no FSI/FAR analysis |
| **JLL India** | Institutional advisory | High-cost manual consulting |
| **Knight Frank India** | Market reports | Quarterly reports, not real-time tool |
| **Land Insight** (UK-origin India trial) | Parcel + planning data | Very limited India data |
| **Zapkey** | Registered sale deed data | Transaction data only, no regulation engine |
| **GeoIQ** | Spatial analytics | Data platform, no regulation engine |
| **Clicbrics** | Property discovery | Consumer listings, no compliance layer |

### 2.3 Key Market Gap

**No platform in India today combines:**
1. GIS-based land parcel identification
2. State-specific zoning and bye-law rule engine
3. Automated buildable area calculation (FAR/FSI)
4. AI-powered regulation parsing from PDFs
5. Real-time market price + ROI forecasting
6. Automated PDF feasibility report generation

This is your **Blue Ocean opportunity.**

### 2.4 Adjacent Technology Benchmarks

| Technology Benchmark | How to Apply |
|--------------------|-------------|
| **Symbium's Zoning API** | Build similar for India with state-specific logic |
| **Google Maps Platform** | Use for geocoding, satellite layers, place search |
| **Regrid's parcel data** | Build Indian equivalent via state land portals |
| **OpenAI/LangChain PDF parsing** | Extract structured rules from government regulation PDFs |
| **Nearmap satellite AI** | Land use classification from satellite imagery |
| **Verisk's property analytics** | Risk scoring model to replicate for Indian markets |

---

## 3. Our Differentiated Solution Strategy

### 3.1 Positioning Statement

> **"The first automated, AI-powered regulatory feasibility platform for real estate development in India — providing any developer, architect, or investor an instant, state-specific analysis of what can be built on any plot."**

### 3.2 Unique Value Propositions

| Feature | What Others Do | What We Do |
|---------|---------------|-----------|
| Regulation Compliance | Manual research (weeks) | Automated rule engine (seconds) |
| Multi-state Support | Single city tools | All 28 states + UTs modular |
| AI Regulation Parsing | Manual PDF reading | NLP extracts rules from PDFs automatically |
| Report Generation | Consultant-prepared ($$$) | Automated PDF report with citations |
| Market Intelligence | Separate tools | Integrated price prediction in same workflow |
| Integration | Standalone tools | REST API for ERP/CRM integration |
| Updates | Outdated datasets | Versioned regulations with change tracking |

### 3.3 Three-Tier Service Model

```
TIER 1 — BASIC (Free/Freemium)
  ├── Location lookup
  ├── Zone identification
  ├── Basic permitted uses
  └── 3 free reports/month

TIER 2 — PROFESSIONAL (₹2,999–₹9,999/month)
  ├── Full feasibility calculation
  ├── PDF report generation
  ├── ROI estimates
  ├── All states coverage
  └── 50 reports/month

TIER 3 — ENTERPRISE (₹50,000+/month)
  ├── API access
  ├── White-label reports
  ├── CRM/ERP integration
  ├── Custom rule sets
  ├── Bulk analysis
  └── Dedicated support
```

---

## 4. AI Integration Architecture — Real-Time & Predictive

### 4.1 Overview — Four AI Subsystems

```
┌─────────────────────────────────────────────────────────────────┐
│                     AI LAYER ARCHITECTURE                        │
├─────────────────┬──────────────────┬─────────────┬─────────────┤
│  REGULATION AI  │  GEOSPATIAL AI   │  MARKET AI  │  REPORT AI  │
│  (NLP Engine)   │  (Vision Model)  │  (Predict)  │  (LLM Gen)  │
├─────────────────┼──────────────────┼─────────────┼─────────────┤
│ PDF→Rules       │ Satellite→       │ Price       │ Structured  │
│ extraction      │ Land use class   │ prediction  │ report text │
│                 │                  │ ROI model   │ generation  │
└─────────────────┴──────────────────┴─────────────┴─────────────┘
```

### 4.2 AI Subsystem 1 — Regulation Intelligence (NLP)

**Purpose:** Convert government PDF regulation documents into structured rule database records.

**Pipeline:**
```
Regulation PDF Upload (Admin)
        ↓
[1] PDF Text Extraction (PyMuPDF / pdfplumber)
        ↓
[2] Document Chunking & Cleaning
        ↓
[3] LLM Extraction (GPT-4o / Claude / Llama 3.1)
    Prompt: Extract regulation rules as structured JSON:
    {zone_type, road_width_min, max_far, max_height,
     coverage_pct, setback_front, setback_side, rear,
     open_space_pct, permitted_uses[], special_conditions[]}
        ↓
[4] Confidence Scoring (threshold: 0.85)
        ↓
[5] Human Validation Queue (Admin review UI)
        ↓
[6] Publish to Rule Database with version tag
        ↓
[7] Invalidate affected cached feasibility results
```

**Example Extraction:**

*Input (raw PDF text):*
```
"In Residential Zone R1, where the road width is not less than 12 metres,
the permissible Floor Space Index shall be 2.0 and the maximum permissible 
height shall not exceed 15 metres with a mandatory front setback of 4.5 metres."
```

*Extracted JSON:*
```json
{
  "zone_type": "Residential",
  "zone_sub_type": "R1",
  "road_width_min": 12,
  "max_far": 2.0,
  "max_height_m": 15,
  "front_setback_m": 4.5,
  "confidence": 0.94,
  "source_text_reference": "Section 4.2.1",
  "requires_human_validation": false
}
```

**Technology:**
- Python FastAPI microservice
- `pdfplumber` or `PyMuPDF` for extraction
- LangChain + OpenAI GPT-4o (or self-hosted Llama 3.1 70B for data privacy)
- Pydantic validation schemas
- Vector DB (Chroma/Qdrant) for regulation semantic search

---

### 4.3 AI Subsystem 2 — Geospatial Land Intelligence

**Purpose:** Classify land use from satellite imagery and detect surrounding infrastructure automatically.

**Models Required:**

| Model | Purpose | Training Data |
|-------|---------|---------------|
| Land Use Classifier (CNN) | Vacant / Built / Agricultural / Green | Sentinel-2 + Google Earth imagery |
| Road Width Estimator | Detect road width from satellite | OpenStreetMap + satellite pairs |
| Building Density Index | Urban density score around plot | OSM building footprints |
| Flood Risk Classifier | Identify flood-prone parcels | NDMA flood maps + DEM data |
| Water Body Proximity | Distance to rivers, lakes | USGS + ISRO Bhuvan |

**Real-Time Data Sources:**

```python
REAL_TIME_SOURCES = {
    "satellite":    "Google Earth Engine API (free tier) / ISRO Bhuvan",
    "dem":          "SRTM 30m DEM — NASA (free)",
    "osm":          "OpenStreetMap Overpass API (free, real-time)",
    "flood_zones":  "NDMA India flood hazard atlas",
    "protected":    "Wildlife Institute of India shapefiles",
    "crz":          "Ministry of Environment CRZ notification zones",
    "nhai_buffer":  "NHAI road centreline + 75m buffer computation",
    "railway":      "Indian Railways zone shapefiles",
    "airport":      "DGCA airport funnel zone shapefiles",
}
```

**Processing Flow:**
```
User inputs coordinates (lat, lng)
        ↓
[1] Fetch Sentinel-2 tile for location (Google Earth Engine)
        ↓
[2] Run CNN land use classifier
        ↓
[3] Query OSM Overpass API: roads, amenities, buildings
        ↓
[4] Compute spatial intersections (PostGIS):
    - Which zone polygon contains this point?
    - CRZ overlap? Highway buffer overlap?
    - Flood zone membership?
        ↓
[5] Aggregate into Location Intelligence JSON
        ↓
[6] Store in location_intelligence table
        ↓
[7] Use as input for Rule Engine
```

---

### 4.4 AI Subsystem 3 — Market Intelligence & ROI Prediction

**Purpose:** Predict property value, rental yield, and development ROI.

**Input Features for ML Model:**

```
Location features:
  - Distance to CBD (city center)
  - Distance to nearest metro station
  - Distance to highway
  - Walk score (nearby amenities)
  - School/hospital proximity

Land features:
  - Plot area (sqm)
  - Zoning type
  - FAR/FSI
  - Buildable area

Market features:
  - Past 24-month transaction prices (sqft)
  - Supply pipeline in 2km radius
  - Infrastructure project announcements
  - Demographic density

Economic features:
  - City GDP growth rate
  - Employment hub proximity
  - IT park / SEZ proximity
```

**Models:**

| Prediction Target | Algorithm | Inputs |
|------------------|-----------|--------|
| Land price per sqft | XGBoost Regressor | Location + market features |
| Construction cost | Linear Regression + city index | Zone type + floor count |
| Rental yield | Random Forest | Location + project type |
| 3-yr appreciation | LSTM Time Series | Historical price bands |
| Risk score | Gradient Boost Classifier | Legal + environmental features |

**Data Sources for Training:**
- Zapkey registered sale deeds (public data)
- State registration department APIs (IGR)
- PropTiger/99acres historical price APIs
- RERA registration data (public)
- RBI housing price index

---

### 4.5 AI Subsystem 4 — AI Report Generator

**Purpose:** Produce human-quality feasibility report narrative from structured calculation results.

**Approach:**
```
Structured feasibility JSON
        ↓
LLM Report Prompt (GPT-4o / Claude Sonnet)
        ↓
Section-by-section narrative generation:
  1. Executive Summary
  2. Location Analysis
  3. Regulatory Compliance Summary
  4. Development Potential
  5. Risk Factors
  6. Recommendations
        ↓
PDF compilation (mPDF / wkhtmltopdf / WeasyPrint)
        ↓
Branded PDF with maps + charts
```

**Example Generated Summary:**
```
"The subject plot at Survey No. 42/B, Andheri East, Mumbai (Maharashtra) 
measures 2,340 sqm and falls within Residential Zone R2 under the 
Development Control & Promotion Regulations 2034 (DCPR 2034). Based on 
the applicable FSI of 3.0 for a 12m road frontage, the maximum permissible 
built-up area is 7,020 sqm, achievable over an estimated 10 floors. The 
plot has no CRZ restrictions, is outside NDZ (No Development Zone) limits, 
and is not flagged in the NDMA flood risk zone..."
```

---

## 5. Complete System Architecture

### 5.1 High-Level System Diagram

```
┌──────────────────────────────────────────────────────────────────────┐
│                          CLIENT LAYER                                 │
│   Web Dashboard (React/Blade)  │  Mobile App  │  API Consumers       │
└────────────────────┬─────────────────────────────────────────────────┘
                     │ HTTPS
┌────────────────────▼─────────────────────────────────────────────────┐
│                          API GATEWAY                                  │
│        Laravel 11 (PHP)  +  FastAPI (Python AI Services)             │
│        Auth: Laravel Sanctum (API tokens) + JWT                      │
└──────┬──────────┬──────────┬──────────┬──────────┬───────────────────┘
       │          │          │          │          │
       ▼          ▼          ▼          ▼          ▼
┌──────────┐ ┌────────┐ ┌────────┐ ┌────────┐ ┌───────────┐
│ Location │ │ Rule   │ │  AI    │ │ Report │ │  Admin    │
│ GIS      │ │ Engine │ │ Engine │ │ Engine │ │  Portal   │
│ Service  │ │        │ │        │ │        │ │ (Laravel) │
└────┬─────┘ └───┬────┘ └───┬────┘ └───┬────┘ └───────────┘
     │           │          │          │
     ▼           ▼          ▼          ▼
┌──────────────────────────────────────────────────────┐
│                     DATA LAYER                        │
│  PostgreSQL + PostGIS  │  Redis Cache  │  S3 Storage  │
└──────────────────────────────────────────────────────┘
     │           │          │
     ▼           ▼          ▼
┌──────────┐ ┌────────┐ ┌────────────────────────────┐
│ External │ │  ML    │ │   Vector DB (Qdrant)        │
│ APIs     │ │ Model  │ │   (Regulation Embeddings)   │
│ OSM,GEE  │ │ Store  │ └────────────────────────────┘
│ NDMA etc │ │        │
└──────────┘ └────────┘
```

### 5.2 Request Flow — Core Feasibility Analysis

```
User enters: Address / Lat-Lng / Plot boundary
                    ↓
         [1] Geocoding & Parcel ID
             (Google Maps API + BhuNaksha)
                    ↓
         [2] Spatial Zone Detection
             (PostGIS point-in-polygon query)
                    ↓
         [3] Infrastructure Proximity
             (OSM Overpass + PostGIS buffer queries)
                    ↓
         [4] Restriction Checks
             (CRZ, NHAI buffer, Railway buffer,
              Airport funnel, Flood zone, Eco-sensitive)
                    ↓
         [5] Rule Engine Match
             (State + City + Zone + Road Width → Rules)
                    ↓
         [6] Feasibility Calculation
             - Max FAR/FSI
             - Ground Coverage
             - Max Buildable Area
             - Estimated Floors
             - Setback requirements
             - Parking calculations
                    ↓
         [7] AI Market Prediction
             (Price/sqft, Construction cost, ROI)
                    ↓
         [8] Risk Assessment
             (Environmental, Legal, Infrastructure)
                    ↓
         [9] Report Generation
             (JSON + PDF + Map snapshot)
                    ↓
        [10] Store in feasibility_reports
             Update status: completed
```

---

## 6. Database Schema — Full Design

### 6.1 Existing Tables (To Keep + Enhance)

**zones** — Add `road_width_min_m`, `road_width_max_m`, `city_id`, `parking_ratio` columns.

**regulations** — Add `raw_text`, `ai_extracted`, `validation_status`, `version`, `superseded_by` columns.

**feasibility_reports** — Add `plot_area_sqm`, `zone_id`, `max_buildable_area_sqm`, `max_floors`, `ground_coverage_sqm`, `regulatory_restrictions`, `ai_predictions`, `report_pdf_path` columns.

### 6.2 New Tables Required

```sql
-- Cities (Municipal bodies within states)
CREATE TABLE cities (
    id              BIGSERIAL PRIMARY KEY,
    state_id        BIGINT REFERENCES states(id),
    name            VARCHAR(255) NOT NULL,
    code            VARCHAR(20),
    planning_authority VARCHAR(255),    -- MCGM, PCMC, BBMP etc.
    master_plan_year INT,
    dcr_version     VARCHAR(100),
    is_active       BOOLEAN DEFAULT TRUE,
    created_at      TIMESTAMP,
    updated_at      TIMESTAMP
);

-- Granular zone rules per city (road-width-linked)
CREATE TABLE zone_rules (
    id                  BIGSERIAL PRIMARY KEY,
    zone_id             BIGINT REFERENCES zones(id),
    city_id             BIGINT REFERENCES cities(id),
    road_width_min_m    DECIMAL(6,2),
    road_width_max_m    DECIMAL(6,2),
    max_far             DECIMAL(5,2),
    max_height_m        DECIMAL(8,2),
    max_ground_coverage DECIMAL(5,2),    -- percentage
    open_space_pct      DECIMAL(5,2),
    front_setback_m     DECIMAL(6,2),
    side_setback_m      DECIMAL(6,2),
    rear_setback_m      DECIMAL(6,2),
    parking_ratio_ecs   DECIMAL(6,3),   -- ECS per 100 sqm
    is_base_rule        BOOLEAN DEFAULT TRUE,
    effective_from      DATE,
    rule_source         VARCHAR(500),   -- Regulation section reference
    notes               TEXT,
    version             INT DEFAULT 1,
    is_active           BOOLEAN DEFAULT TRUE,
    created_at          TIMESTAMP,
    updated_at          TIMESTAMP
);

-- GIS-enabled land parcels
CREATE TABLE land_parcels (
    id              BIGSERIAL PRIMARY KEY,
    state_id        BIGINT REFERENCES states(id),
    city_id         BIGINT REFERENCES cities(id),
    survey_number   VARCHAR(100),
    khasra_number   VARCHAR(100),
    address         TEXT,
    latitude        DECIMAL(10,7),
    longitude       DECIMAL(10,7),
    geometry        GEOMETRY(POLYGON, 4326),  -- PostGIS spatial column
    area_sqm        DECIMAL(12,2),
    land_use_type   VARCHAR(100),
    source          VARCHAR(100),       -- bhu_naksha | osm | manual | api
    created_at      TIMESTAMP,
    updated_at      TIMESTAMP
);
CREATE INDEX idx_land_parcels_geom ON land_parcels USING GIST(geometry);

-- Zoning map (spatial)
CREATE TABLE zoning_areas (
    id              BIGSERIAL PRIMARY KEY,
    city_id         BIGINT REFERENCES cities(id),
    zone_id         BIGINT REFERENCES zones(id),
    geometry        GEOMETRY(MULTIPOLYGON, 4326),
    source          VARCHAR(255),
    version         VARCHAR(50),
    created_at      TIMESTAMP,
    updated_at      TIMESTAMP
);
CREATE INDEX idx_zoning_areas_geom ON zoning_areas USING GIST(geometry);

-- Infrastructure spatial data
CREATE TABLE infrastructure_layers (
    id              BIGSERIAL PRIMARY KEY,
    city_id         BIGINT REFERENCES cities(id),
    layer_type      VARCHAR(100),   -- road | railway | metro | nhai | crz | flood | airport | eco_zone
    name            VARCHAR(255),
    geometry        GEOMETRY(GEOMETRY, 4326),
    buffer_m        INT,            -- regulatory buffer in metres
    regulation_ref  VARCHAR(500),
    created_at      TIMESTAMP,
    updated_at      TIMESTAMP
);
CREATE INDEX idx_infrastructure_geom ON infrastructure_layers USING GIST(geometry);

-- Location intelligence cache
CREATE TABLE location_intelligence (
    id                  BIGSERIAL PRIMARY KEY,
    latitude            DECIMAL(10,7),
    longitude           DECIMAL(10,7),
    geohash             VARCHAR(20),    -- for quick lookup
    zone_classification JSON,
    infrastructure_data JSON,
    satellite_data      JSON,
    restriction_flags   JSON,
    road_width_m        DECIMAL(6,2),
    computed_at         TIMESTAMP,
    expires_at          TIMESTAMP
);
CREATE INDEX idx_loc_intel_geohash ON location_intelligence(geohash);

-- Market price history
CREATE TABLE market_price_history (
    id              BIGSERIAL PRIMARY KEY,
    city_id         BIGINT REFERENCES cities(id),
    zone_type       VARCHAR(100),
    micro_market    VARCHAR(255),
    price_per_sqft  DECIMAL(10,2),
    transaction_type VARCHAR(50),   -- sale | rent
    data_source     VARCHAR(100),
    period_month    DATE,           -- 2024-01-01 = Jan 2024
    created_at      TIMESTAMP
);

-- AI model predictions per feasibility report
CREATE TABLE ai_predictions (
    id                      BIGSERIAL PRIMARY KEY,
    feasibility_report_id   BIGINT REFERENCES feasibility_reports(id),
    land_price_per_sqft     DECIMAL(12,2),
    construction_cost_sqft  DECIMAL(12,2),
    total_project_cost      DECIMAL(15,2),
    rental_yield_pct        DECIMAL(5,2),
    roi_3yr_pct             DECIMAL(5,2),
    roi_5yr_pct             DECIMAL(5,2),
    risk_score              INT,            -- 0-100
    risk_factors            JSON,
    confidence_score        DECIMAL(5,2),
    model_version           VARCHAR(50),
    created_at              TIMESTAMP
);

-- Uploaded regulation PDFs + their extracted rules
CREATE TABLE regulation_documents (
    id              BIGSERIAL PRIMARY KEY,
    state_id        BIGINT REFERENCES states(id),
    city_id         BIGINT REFERENCES cities(id),
    title           VARCHAR(500),
    document_type   VARCHAR(100),   -- DCR | Building_Byelaws | Master_Plan | Notification
    file_path       VARCHAR(500),
    file_hash       VARCHAR(64),    -- SHA-256 for dedup
    extracted_text  LONGTEXT,       -- Full extracted text
    extraction_status VARCHAR(50),  -- pending | extracting | extracted | failed
    rule_count      INT DEFAULT 0,
    ai_processed    BOOLEAN DEFAULT FALSE,
    version         VARCHAR(100),
    effective_date  DATE,
    created_at      TIMESTAMP,
    updated_at      TIMESTAMP
);

-- Regulation rule versions (versioned history)
CREATE TABLE regulation_rule_versions (
    id              BIGSERIAL PRIMARY KEY,
    zone_rule_id    BIGINT REFERENCES zone_rules(id),
    version         INT,
    old_values      JSON,
    new_values      JSON,
    changed_by      BIGINT REFERENCES users(id),
    change_reason   TEXT,
    created_at      TIMESTAMP
);
```

### 6.3 Enhanced Existing Tables

```sql
-- Add to feasibility_reports:
ALTER TABLE feasibility_reports ADD COLUMN city_id BIGINT REFERENCES cities(id);
ALTER TABLE feasibility_reports ADD COLUMN zone_id BIGINT REFERENCES zones(id);
ALTER TABLE feasibility_reports ADD COLUMN zone_rule_id BIGINT REFERENCES zone_rules(id);
ALTER TABLE feasibility_reports ADD COLUMN plot_area_sqm DECIMAL(12,2);
ALTER TABLE feasibility_reports ADD COLUMN road_width_m DECIMAL(6,2);
ALTER TABLE feasibility_reports ADD COLUMN max_buildable_area_sqm DECIMAL(12,2);
ALTER TABLE feasibility_reports ADD COLUMN ground_coverage_sqm DECIMAL(12,2);
ALTER TABLE feasibility_reports ADD COLUMN max_floors INT;
ALTER TABLE feasibility_reports ADD COLUMN setback_summary JSON;
ALTER TABLE feasibility_reports ADD COLUMN restriction_flags JSON;
ALTER TABLE feasibility_reports ADD COLUMN permitted_uses JSON;
ALTER TABLE feasibility_reports ADD COLUMN report_pdf_path VARCHAR(500);
ALTER TABLE feasibility_reports ADD COLUMN calculation_log JSON;

-- Add to regulations:
ALTER TABLE regulations ADD COLUMN city_id BIGINT REFERENCES cities(id);
ALTER TABLE regulations ADD COLUMN document_id BIGINT REFERENCES regulation_documents(id);
ALTER TABLE regulations ADD COLUMN ai_extracted BOOLEAN DEFAULT FALSE;
ALTER TABLE regulations ADD COLUMN validation_status VARCHAR(50) DEFAULT 'pending';
ALTER TABLE regulations ADD COLUMN version INT DEFAULT 1;
ALTER TABLE regulations ADD COLUMN raw_text TEXT;
ALTER TABLE regulations ADD COLUMN structured_rules JSON;
```

---

## 7. Module-by-Module Development Plan

### Module 1: Feasibility Calculation Engine (Priority: CRITICAL)

**File:** `app/Services/FeasibilityCalculatorService.php`

**Logic:**
```php
class FeasibilityCalculatorService
{
    public function calculate(array $input): FeasibilityResult
    {
        // Input: plot_area_sqm, zone_rule_id, road_width_m
        // Returns: FeasibilityResult DTO

        $rule = ZoneRule::findOrFail($input['zone_rule_id']);
        $plotArea = $input['plot_area_sqm'];

        // Step 1: Ground coverage
        $groundCoverage = $plotArea * ($rule->max_ground_coverage / 100);

        // Step 2: Max buildable area
        $maxBuildableArea = $plotArea * $rule->max_far;

        // Step 3: Floors
        $estimatedFloors = floor($maxBuildableArea / $groundCoverage);

        // Step 4: Height check
        $avgFloorHeight = 3.2; // metres
        $requiredHeight = $estimatedFloors * $avgFloorHeight;
        if ($requiredHeight > $rule->max_height_m) {
            $estimatedFloors = floor($rule->max_height_m / $avgFloorHeight);
            $maxBuildableArea = $groundCoverage * $estimatedFloors;
        }

        // Step 5: Setbacks
        $netPlotWidth = ...;
        $netPlotDepth = ...;
        // Adjust ground coverage after setbacks

        // Step 6: Open space
        $openSpaceRequired = $plotArea * ($rule->open_space_pct / 100);

        // Step 7: Parking
        $parkingRequired = round($maxBuildableArea / 100 * $rule->parking_ratio_ecs);

        return new FeasibilityResult([...]);
    }
}
```

---

### Module 2: GIS & Location Service

**Technology:** PostGIS + PHP wrapper + Google Maps Geocoding API

**Services Required:**

```php
// app/Services/GeocodingService.php
class GeocodingService {
    public function geocode(string $address): Coordinates
    public function reverseGeocode(float $lat, float $lng): Address
    public function getParcelBoundary(float $lat, float $lng): ?GeoJSON
}

// app/Services/ZoneDetectionService.php
class ZoneDetectionService {
    public function detectZone(float $lat, float $lng): ?Zone
    // PostGIS: ST_Contains(geometry, ST_SetSRID(ST_MakePoint($lng, $lat), 4326))
    
    public function checkRestrictions(float $lat, float $lng): array
    // Returns: ['crz' => bool, 'nhai_buffer' => bool, 'flood_zone' => bool, ...]
    
    public function getRoadWidth(float $lat, float $lng): float
    // OSM Overpass API: fetch nearest road + width tag
}
```

**PostGIS Queries:**
```sql
-- Zone detection
SELECT z.*, za.id as zoning_area_id
FROM zoning_areas za
JOIN zones z ON z.id = za.zone_id
WHERE ST_Contains(za.geometry, ST_SetSRID(ST_MakePoint(:lng, :lat), 4326));

-- Restriction checks
SELECT layer_type, name, buffer_m,
       ST_Distance(
           geometry::geography,
           ST_SetSRID(ST_MakePoint(:lng, :lat), 4326)::geography
       ) AS distance_m
FROM infrastructure_layers
WHERE ST_DWithin(
    geometry::geography,
    ST_SetSRID(ST_MakePoint(:lng, :lat), 4326)::geography,
    2000
)
ORDER BY distance_m;
```

---

### Module 3: Rule Engine

**Architecture:** Structured database rules + PHP evaluation (no external rule engine needed at this scale)

```php
// app/Services/RuleEngineService.php
class RuleEngineService
{
    public function findApplicableRule(
        int $zoneId,
        float $roadWidthM,
        ?int $cityId = null
    ): ?ZoneRule {
        return ZoneRule::where('zone_id', $zoneId)
            ->where('city_id', $cityId ?? $this->getDefaultCity($zoneId))
            ->where('road_width_min_m', '<=', $roadWidthM)
            ->where(function ($q) use ($roadWidthM) {
                $q->whereNull('road_width_max_m')
                  ->orWhere('road_width_max_m', '>=', $roadWidthM);
            })
            ->where('is_active', true)
            ->orderBy('road_width_min_m', 'desc')
            ->first();
    }

    public function applySpecialConditions(
        FeasibilityResult $result,
        array $restrictionFlags
    ): FeasibilityResult {
        // CRZ: Reduce buildable area, add restrictions
        if ($restrictionFlags['crz_zone_1']) {
            $result->addRestriction('CRZ Zone 1: No construction permitted');
            $result->setFeasible(false);
        }
        if ($restrictionFlags['crz_zone_2']) {
            $result->addRestriction('CRZ Zone 2: Only approved developments');
            $result->reduceFar(0.5);
        }
        // NHAI: 75m from highway centreline
        if ($restrictionFlags['nhai_buffer']) {
            $result->addRestriction('NHAI ROW: 75m buffer — no construction');
            $result->setFeasible(false);
        }
        // Airport: Height restrictions (DGCA funnel zones)
        if ($restrictionFlags['airport_funnel']) {
            $result->restrictHeight($restrictionFlags['airport_max_height_m']);
        }
        return $result;
    }
}
```

---

### Module 4: AI Python Microservice

**File:** `ai-service/main.py` (separate Python FastAPI service)

```python
# ai-service/main.py
from fastapi import FastAPI
from pydantic import BaseModel
from services.regulation_extractor import RegulationExtractor
from services.market_predictor import MarketPredictor
from services.report_generator import ReportGenerator

app = FastAPI(title="LandFeasibility AI Service")

class RegulationRequest(BaseModel):
    document_id: int
    text: str
    state: str
    city: str

class MarketPredictionRequest(BaseModel):
    latitude: float
    longitude: float
    zone_type: str
    plot_area_sqm: float
    max_buildable_area_sqm: float

@app.post("/extract-regulations")
async def extract_regulations(req: RegulationRequest):
    extractor = RegulationExtractor()
    rules = await extractor.extract(req.text, req.state, req.city)
    return {"document_id": req.document_id, "rules": rules}

@app.post("/predict-market")
async def predict_market(req: MarketPredictionRequest):
    predictor = MarketPredictor()
    prediction = await predictor.predict(req)
    return prediction

@app.post("/generate-report-narrative")
async def generate_narrative(feasibility_data: dict):
    generator = ReportGenerator()
    narrative = await generator.generate(feasibility_data)
    return {"narrative": narrative}
```

---

### Module 5: PDF Report Generator

**Technology:** Laravel + mPDF or DomPDF

```php
// app/Services/ReportGeneratorService.php
class ReportGeneratorService
{
    public function generatePDF(FeasibilityReport $report): string
    {
        $data = [
            'report'         => $report,
            'zone_rule'      => $report->zoneRule,
            'calculations'   => $report->result_data,
            'ai_predictions' => $report->aiPrediction,
            'map_image'      => $this->generateMapSnapshot($report),
            'generated_at'   => now()->format('d M Y, H:i'),
        ];

        $pdf = PDF::loadView('reports.feasibility-pdf', $data);
        $pdf->setPaper('A4', 'portrait');

        $path = "reports/{$report->id}/feasibility_report.pdf";
        Storage::disk('s3')->put($path, $pdf->output());

        $report->update(['report_pdf_path' => $path]);
        return Storage::disk('s3')->temporaryUrl($path, now()->addHours(24));
    }
}
```

---

### Module 6: User Portal (Public Interface)

The current codebase only has an admin panel. A public user portal is required with:

**Routes to Add:**
```
GET  /                        → Landing page
GET  /analyze                 → Location search + map UI
POST /api/feasibility/analyze → Submit analysis (authenticated)
GET  /api/feasibility/{id}    → Fetch report result (polling)
GET  /feasibility/{id}/report → View/download report
GET  /dashboard               → User's saved reports
POST /register                → User registration
POST /login                   → User login (Sanctum)
```

**Frontend Implementation:**
```
resources/views/
  portal/
    home.blade.php         - Landing page
    analyze.blade.php      - Map + form analysis page
    dashboard.blade.php    - User dashboard
    report/
      show.blade.php       - Report viewer
      download.blade.php   - Download redirect
```

**Map UI Recommendation:**
- **Leaflet.js** (free, lightweight) with OpenStreetMap tiles
- Google Maps JavaScript API (draw polygon, place search)
- Allow users to:
  - Search by address (autocomplete)
  - Drop pin on map
  - Draw plot polygon (to compute plot area)

---

### Module 7: REST API Layer

```php
// app/Http/Controllers/Api/FeasibilityApiController.php
class FeasibilityApiController extends Controller
{
    /**
     * POST /api/v1/feasibility/analyze
     * Body: { address?, latitude, longitude, plot_area_sqm, state_id?, zone_id? }
     */
    public function analyze(Request $request): JsonResponse
    {
        $validated = $request->validate([
            'latitude'      => 'required|numeric|between:-90,90',
            'longitude'     => 'required|numeric|between:-180,180',
            'plot_area_sqm' => 'required|numeric|min:10',
            'address'       => 'nullable|string|max:500',
        ]);

        // Create pending report
        $report = FeasibilityReport::create([
            'user_id'    => auth()->id(),
            'status'     => 'pending',
            'latitude'   => $validated['latitude'],
            'longitude'  => $validated['longitude'],
            'address'    => $validated['address'] ?? null,
            'plot_area_sqm' => $validated['plot_area_sqm'],
        ]);

        // Dispatch async job
        ProcessFeasibilityAnalysis::dispatch($report);

        return response()->json([
            'report_id' => $report->id,
            'status'    => 'pending',
            'poll_url'  => route('api.feasibility.status', $report->id),
        ], 202);
    }
}
```

---

### Module 8: Queue-based Async Processing

```php
// app/Jobs/ProcessFeasibilityAnalysis.php
class ProcessFeasibilityAnalysis implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    public function handle(
        GeocodingService $geocoder,
        ZoneDetectionService $zoneDetector,
        RuleEngineService $ruleEngine,
        FeasibilityCalculatorService $calculator,
        AIPredictionService $aiService,
        ReportGeneratorService $reportGenerator
    ): void {
        $report = $this->report;
        $report->update(['status' => 'processing']);

        try {
            // Step 1-2: GIS
            $zoneInfo     = $zoneDetector->detectZone($report->latitude, $report->longitude);
            $restrictions = $zoneDetector->checkRestrictions($report->latitude, $report->longitude);
            $roadWidth    = $zoneDetector->getRoadWidth($report->latitude, $report->longitude);

            // Step 3: Rule match
            $rule = $ruleEngine->findApplicableRule($zoneInfo->id, $roadWidth);

            // Step 4: Calculate
            $result = $calculator->calculate([
                'plot_area_sqm' => $report->plot_area_sqm,
                'zone_rule_id'  => $rule->id,
                'road_width_m'  => $roadWidth,
            ]);

            // Apply restrictions
            $result = $ruleEngine->applySpecialConditions($result, $restrictions);

            // Step 5: AI predictions
            $aiPrediction = $aiService->predict($result, $zoneInfo);

            // Step 6: Generate report
            $pdfPath = $reportGenerator->generatePDF($report);

            // Update report
            $report->update([
                'status'             => 'completed',
                'feasibility_score'  => $result->score,
                'zone_id'            => $zoneInfo->id,
                'zone_rule_id'       => $rule->id,
                'max_buildable_area_sqm' => $result->maxBuildableArea,
                'max_floors'         => $result->maxFloors,
                'result_data'        => $result->toArray(),
                'report_pdf_path'    => $pdfPath,
            ]);

        } catch (\Exception $e) {
            $report->update(['status' => 'failed']);
            Log::error("Feasibility analysis failed: " . $e->getMessage());
        }
    }
}
```

---

## 8. Technology Stack — Final Recommendation

### 8.1 Recommended Production Stack

| Layer | Technology | Rationale |
|-------|-----------|-----------|
| **Backend (Core)** | Laravel 11 (PHP 8.4) | Already built; excellent ORM, queues, jobs |
| **AI Microservice** | Python 3.12 + FastAPI | Best AI/ML ecosystem; async performance |
| **Database** | PostgreSQL 16 + PostGIS 3.4 | Production spatial queries; JSON support |
| **Cache** | Redis 7.2 | Queue backend + response caching |
| **Queue** | Laravel Horizon + Redis | Monitor & manage async jobs |
| **Frontend** | Blade + Alpine.js + Leaflet.js | Keep simple; progressive enhancement |
| **Maps** | Google Maps JS API + Leaflet | Drawing polygons + OSM base tiles |
| **PDF** | mPDF (PHP) | Best quality PDFs from HTML/CSS |
| **File Storage** | AWS S3 / Cloudflare R2 | PDF + document storage |
| **AI/LLM** | OpenAI GPT-4o API | Regulation extraction + report narrative |
| **ML Models** | XGBoost + scikit-learn | Market predictions |
| **Vector DB** | Qdrant (self-hosted) | Regulation semantic search |
| **Container** | Docker + Docker Compose | Dev consistency |
| **Web Server** | Nginx + PHP-FPM | Standard Laravel production |
| **Deployment** | AWS EC2 / DigitalOcean | Starting point; scale to EKS later |
| **CDN** | Cloudflare | Static assets + DDoS protection |
| **Email** | Laravel + AWS SES / Mailgun | Transactional emails |

### 8.2 Why NOT some alternatives

| Choice | Rejected Option | Why |
|--------|-----------------|-----|
| PHP Laravel | Node.js | Already built in PHP; team continuity |
| PostGIS | MongoDB | Relational + spatial; ACID compliance needed |
| Leaflet.js | Mapbox GL | Leaflet is free; sufficient for MVP |
| XGBoost | Deep Learning | Tabular data; XGBoost outperforms DL for property data |
| FastAPI | Django | Faster; purpose-built for ML microservices |

---

## 9. API Design Specification

### 9.1 API Versioning & Base URL
```
Base URL: https://api.landfeasibility.in/v1/
Auth: Bearer token (Laravel Sanctum)
Rate Limit: 60/min (free), 600/min (pro), 6000/min (enterprise)
```

### 9.2 Endpoints

```
# Authentication
POST   /auth/register
POST   /auth/login
POST   /auth/logout
GET    /auth/me

# Feasibility Analysis
POST   /feasibility/analyze         Create new analysis (returns report_id + poll URL)
GET    /feasibility/{id}            Get report status + result
GET    /feasibility/{id}/pdf        Download PDF report
GET    /feasibility                 List user's reports (paginated)
DELETE /feasibility/{id}            Delete a report

# Location Intelligence
GET    /location/geocode            ?address=...  → lat, lng, state, city
GET    /location/zone               ?lat=&lng=    → zone classification
GET    /location/restrictions       ?lat=&lng=    → CRZ, buffer checks
GET    /location/road-width         ?lat=&lng=    → road width in metres

# Reference Data
GET    /states                      List all active states
GET    /states/{id}/cities          Cities in state
GET    /states/{id}/zones           Zone types in state
GET    /zones/{id}/rules            Zone rules for a zone

# Market Intelligence
GET    /market/prices               ?city_id=&zone_type=&period= → Price history
GET    /market/predict              ?lat=&lng=&plot_area= → ML price prediction
```

### 9.3 Response Format (Standardized)

```json
{
  "success": true,
  "data": { ... },
  "meta": {
    "report_id": 1234,
    "status": "completed",
    "generated_at": "2026-03-06T10:30:00Z",
    "api_version": "1.0"
  },
  "errors": null
}
```

### 9.4 Feasibility Report Response

```json
{
  "success": true,
  "data": {
    "report_id": 1234,
    "status": "completed",
    "feasibility_score": 78,
    "location": {
      "address": "Survey No. 42/B, Andheri East, Mumbai",
      "latitude": 19.1197,
      "longitude": 72.8468,
      "state": "Maharashtra",
      "city": "Mumbai",
      "planning_authority": "MCGM"
    },
    "zone": {
      "name": "Residential Zone R2",
      "zone_type": "Residential",
      "dcr_reference": "DCPR 2034 - Section 4.2"
    },
    "plot": {
      "area_sqm": 2340,
      "road_width_m": 12.0
    },
    "regulations": {
      "max_far": 3.0,
      "max_height_m": 30.0,
      "max_ground_coverage_pct": 40.0,
      "open_space_required_pct": 15.0,
      "front_setback_m": 4.5,
      "side_setback_m": 2.0,
      "rear_setback_m": 3.0,
      "parking_required_ecs": 70
    },
    "calculations": {
      "ground_coverage_sqm": 936,
      "max_buildable_area_sqm": 7020,
      "estimated_floors": 7,
      "open_space_sqm": 351,
      "net_available_for_sale_sqm": 6200
    },
    "restrictions": {
      "crz": false,
      "nhai_buffer": false,
      "flood_zone": false,
      "heritage_zone": false,
      "eco_sensitive": false,
      "airport_funnel": false,
      "remarks": []
    },
    "permitted_uses": ["Residential", "Retail (Ground Floor)", "Office (above 3rd floor with TDR)"],
    "ai_predictions": {
      "land_price_per_sqft": 45000,
      "construction_cost_per_sqft": 3500,
      "total_project_cost_cr": 28.5,
      "rental_yield_pct": 3.2,
      "roi_3yr_pct": 18.5,
      "roi_5yr_pct": 34.0,
      "risk_score": 22,
      "risk_level": "Low"
    },
    "pdf_url": "https://cdn.landfeasibility.in/reports/1234/report.pdf",
    "regulatory_citations": [
      { "rule": "FSI = 3.0 for 12m road in R2 zone", "source": "DCPR 2034, Reg. 32(3)(b)" }
    ]
  }
}
```

---

## 10. Phase-wise Roadmap with Deliverables

### Phase 0 — Foundation (DONE ✅) — Months 0–2
- [x] Laravel admin panel
- [x] States, Zones, Regulations CRUD
- [x] User/Role management
- [x] Feasibility report storage schema
- [x] Activity logging

---

### Phase 1 — Functional Engine (Months 3–5)

**Goal:** System can perform real feasibility calculations for Maharashtra (Mumbai) using manual data entry.

| Week | Task | Deliverable |
|------|------|-------------|
| 1-2 | Database migrations (cities, zone_rules, location_intelligence) | New schema live |
| 1-2 | Seed Maharashtra data (DCR 2034 zones + rules) | 50+ zone rules seeded |
| 3-4 | FeasibilityCalculatorService | Working calculation engine |
| 3-4 | RuleEngineService | Rule matching logic |
| 5-6 | Google Maps / OpenStreetMap geocoding integration | Address → lat/lng |
| 5-6 | Zone detection via hardcoded city polygon data | Zone from location |
| 7-8 | Road width detection via OSM Overpass API | Road width from lat/lng |
| 7-8 | Basic restriction flags (manual zone data) | CRZ/buffer detection |
| 9-10 | ProcessFeasibilityAnalysis Queue Job | Async job pipeline |
| 9-10 | mPDF report generation (basic template) | PDF download |
| 11-12 | User portal (search UI + map + report view) | Public user interface |
| 11-12 | REST API (analyze + status endpoints) | API functional |

**Phase 1 Success Criteria:**
- User inputs Mumbai address + plot area
- System returns FSI, buildable area, floors, setbacks
- PDF report downloadable
- < 30 second response time

---

### Phase 2 — Intelligence Layer (Months 6–9)

**Goal:** AI-assisted regulation extraction + 5 more states + market prediction.

| Task | Description |
|------|-------------|
| PostGIS spatial zones | Import actual GIS zone shapefiles for Mumbai, Pune |
| NLP Regulation Extractor | Python FastAPI + GPT-4o pipeline |
| Admin PDF upload + review | Regulation extraction review UI |
| Maharashtra expansion | All cities + all zone types |
| 5 more states | Karnataka, Delhi, Tamil Nadu, Gujarat, Telangana |
| Market prediction MVP | XGBoost model for Mumbai prices |
| ROI calculator | Integration into feasibility report |
| Enhanced PDF report | Professional layout with charts, maps |
| User dashboard | Saved reports, comparison tool |
| Subscription system | Stripe/Razorpay integration |

---

### Phase 3 — Scale & Enterprise (Months 10–14)

| Task | Description |
|------|-------------|
| 15+ states | Pan-India expansion |
| Satellite AI | Google Earth Engine land use classification |
| Advanced market AI | 3yr/5yr ROI model, LSTM price forecast |
| White-label reports | Custom branding per enterprise customer |
| API marketplace | Developer portal, API key management |
| CRM Integration | Salesforce / Zoho / Hubspot webhook |
| Mobile app | React Native (iOS + Android) |
| Bulk analysis | Upload CSV of 100+ locations, batch report |
| Regulation update alerts | Email notification when rules change |

---

### Phase 4 — Advanced AI (Months 15–20)

| Feature | Description |
|---------|-------------|
| Auto layout generation | AI suggests optimal building footprint on plot |
| Approval checklist | Auto-generate RERA / local authority checklist |
| Legal risk scoring | Flag disputed parcels, pending litigation |
| Environmental AI | Automated EIA checklist generation |
| Competitor analysis | Nearby project pipeline overlay |
| Demand simulation | Monte Carlo ROI simulation |
| NLP chatbot | "What can I build on this plot?" conversational interface |

---

## 11. Security Architecture

### 11.1 Application Security (OWASP Top 10 Compliance)

| Risk | Mitigation |
|------|-----------|
| Broken Access Control | Role-based middleware; users can only access own reports |
| Injection | Laravel Eloquent ORM (parameterized queries); Pydantic input validation in Python |
| Cryptographic Failure | HTTPS everywhere; PDF URLs are signed (time-limited); passwords bcrypt |
| Security Misconfiguration | .env never committed; secrets via AWS Secrets Manager |
| SSRF | Whitelist external API domains; never accept user-provided URLs for server-side fetching |
| XSS | Blade auto-escapes output; CSP headers via middleware |
| API Auth | Sanctum token per user; scoped permissions |

### 11.2 Data Privacy

```
- Plot boundary data = sensitive commercial information
- Store in encrypted columns (Laravel Encryption)
- PDFs stored in private S3 bucket (signed URLs only)
- User data: GDPR/PDPB (India) compliant
- API rate limiting per token
- Audit log every data access
```

### 11.3 Infrastructure Security

```
- WAF (Cloudflare) — DDoS protection
- VPC with private subnets for DB
- No direct DB internet access
- SSH via bastion host only
- Automated security patches (AWS SSM)
- Penetration testing before Phase 2 launch
```

---

## 12. Cost, Team & Infrastructure Plan

### 12.1 Team Requirements

| Role | Phase 1 | Phase 2+ | Key Skills |
|------|---------|----------|-----------|
| **Product Manager** | 1 | 1 | Real estate domain + tech |
| **Backend Engineer (Laravel)** | 2 | 3 | PHP, PostGIS, Queue |
| **AI/ML Engineer (Python)** | 1 | 2 | NLP, ML, FastAPI |
| **GIS Specialist** | 1 | 1 | PostGIS, shapefiles, OSM |
| **Frontend Engineer** | 1 | 2 | Blade/React, Leaflet.js |
| **DevOps** | 0.5 | 1 | Docker, AWS, CI/CD |
| **QA Engineer** | 0.5 | 1 | Automated testing |
| **Data Analyst** (Regulations) | 1 | 2 | Real estate regulations |

### 12.2 Infrastructure Cost (Monthly)

| Resource | MVP | Growth |
|----------|-----|--------|
| App Server (EC2 t3.large) | ₹6,000 | ₹18,000 |
| Database (RDS PostgreSQL) | ₹8,000 | ₹25,000 |
| Redis (ElastiCache) | ₹3,000 | ₹6,000 |
| S3 Storage + CDN | ₹2,000 | ₹8,000 |
| OpenAI API (GPT-4o) | ₹15,000 | ₹60,000 |
| Google Maps API | ₹5,000 | ₹20,000 |
| Misc (email, monitoring) | ₹2,000 | ₹5,000 |
| **Total** | **~₹41,000** | **~₹1,42,000** |

### 12.3 Development Cost Estimate

| Phase | Duration | Rough Cost (INR) |
|-------|----------|-----------------|
| Phase 1 — Functional Engine | 3 months | ₹20–35 Lakhs |
| Phase 2 — Intelligence Layer | 4 months | ₹35–55 Lakhs |
| Phase 3 — Scale | 5 months | ₹60–90 Lakhs |
| Phase 4 — Advanced AI | 6 months | ₹80–1.2 Cr |
| **Total (Full Product)** | ~18 months | **₹2–3 Cr** |

---

## 13. Risk Register & Mitigation

| Risk | Probability | Impact | Mitigation |
|------|------------|--------|-----------|
| GIS zoning data unavailable for many cities | High | High | Start with manual polygon entry; use OSM as fallback; partner with municipal bodies |
| OpenAI API cost escalation | Medium | Medium | Cache all LLM responses; use self-hosted Llama for bulk processing |
| Regulation rule accuracy errors | High | High | Mandatory human validation step; versioned rules with rollback; liability disclaimer |
| Land records fragmentation (India) | Very High | High | Parcel identification is advisory only initially; use OSM + satellite visual |
| Model drift (laws change) | High | High | Regulation version control; automated gazette notifications monitoring; quarterly rule audits |
| Google Maps API cost | Medium | Medium | Migrate to OpenStreetMap + Nominatim for geocoding; Maps only for UI |
| Competition from prop-tech giants | Low | High | First-mover advantage; Indian market has no direct competitor today |
| RERA compliance requirements | Medium | Medium | Legal review; data accuracy disclaimer; not a substitute for professional advice |

---

## 14. Future Advanced Capabilities

### 14.1 Automated Building Layout AI
Train a generative model to suggest optimal building footprint on a given plot boundary, factoring setbacks automatically. Output: DXF-compatible layout.

### 14.2 Approval Readiness Score
Auto-generate a checklist of documents required for building plan approval at a specific municipal authority. Updated from scraped/parsed approval procedure documents.

### 14.3 Land Aggregation Intelligence
For large developers: suggest which adjacent plots to acquire to create a larger contiguous parcel that unlocks higher FSI under TDR/bonus FSI schemes.

### 14.4 NLP Chatbot Interface
```
User: "Can I build a 10-floor apartment in Whitefield, Bangalore?"
Bot:  "Based on BBMP/BDA regulations for Whitefield (Zone R2), 
       a 10-floor building requires a minimum 18m road width. 
       The nearest applicable road is 12m wide, allowing max 7 floors.
       Would you like a detailed feasibility report?"
```

### 14.5 Real-Time Gazette Monitoring
Python scraper that monitors state gazette notifications for zoning amendments → triggers rule review workflow automatically.

### 14.6 Municipal API Integration
As SmartCity APIs mature, direct integration with municipal approval systems for auto-submission of drawings and documents.

---

## Appendix A — State Expansion Priority Order

| Priority | State | Cities | Why |
|----------|-------|--------|-----|
| 1 | **Maharashtra** | Mumbai, Pune, Nagpur | Largest RE market; DCPR 2034 available |
| 2 | **Karnataka** | Bengaluru, Mysuru | IT hub; BDA/BBMP active |
| 3 | **Delhi NCR** | Delhi, Noida, Gurgaon | Capital; DDA Master Plan 2041 |
| 4 | **Tamil Nadu** | Chennai, Coimbatore | CMDA active; DCR available |
| 5 | **Gujarat** | Ahmedabad, Surat, Vadodara | GDCR 2017; growing market |
| 6 | **Telangana** | Hyderabad | HMDA; Pharma City growth |
| 7 | **West Bengal** | Kolkata | KMDA regulations |
| 8 | **Rajasthan** | Jaipur, Jodhpur | RIICO; heritage zones |

---

## Appendix B — Regulatory Sources per State

| State | Regulation | Document |
|-------|-----------|----------|
| Maharashtra | DCPR 2034 | https://mcgm.gov.in/dcpr2034 |
| Karnataka | BDA Zoning Regulations 2015 | BDA official portal |
| Delhi | MPD 2041 + Building Bye-Laws 2016 | DDA portal |
| Tamil Nadu | CMDA DCR 2022 | CMDA portal |
| Gujarat | GDCR 2017 | Gujarat Urban portal |
| Haryana | DDJAY + Building Code | DTCP Haryana |
| Rajasthan | RUDA Building Bye-Laws | RUDA Jaipur |

---

## Appendix C — Immediate Next Steps (Action Plan — March 2026)

### Week 1–2 Actions
1. Create cities + zone_rules + location_intelligence migrations
2. Seed 10 core zone rules for Mumbai (DCPR 2034 R1, R2, C1, C2, I categories)
3. Register Google Maps API key + configure geocoding service
4. Implement `FeasibilityCalculatorService` with core calculation logic
5. Update `FeasibilityController` to trigger calculation job

### Week 3–4 Actions
6. Implement `RuleEngineService` with road-width matching
7. Set up Redis + Laravel Horizon for queue processing
8. Create `ProcessFeasibilityAnalysis` job
9. Build basic user portal (analyze page with map input)
10. Create mPDF report template (basic layout)

### Week 5–6 Actions  
11. Integrate OSM Overpass API for road width detection
12. Add manual CRZ/buffer polygon data for Maharashtra coast
13. Implement Sanctum API authentication
14. Create REST API endpoints (analyze, status, pdf)
15. Internal testing with 20 real Mumbai locations

---

*This document supersedes individual notes and should be used as the single source of truth for development planning.*  
*Version: 1.0 | Author: LandFeasibility Dev Team | Date: March 6, 2026*
