Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ihfaz297/MND/llms.txt

Use this file to discover all available pages before exploring further.

Overview

The Node model represents a physical location in the transportation network. Nodes can be bus stops, major intersections, or key destinations.

Type Definition

interface Node {
  id: string;
  name: string;
  type: 'stop' | 'intersection' | 'destination';
  gmaps_address: string;
  lat?: number;
  lng?: number;
}
Source: /home/daytona/workspace/source/MND-backend/src/core/types.ts:5-12

Fields

id
string
required
Unique node identifier in UPPERCASE with underscores.Examples:
  • TILAGOR
  • CAMPUS
  • SHAHI_EIDGAH
  • MODINA_MARKET
Used in all API endpoints for route planning.
name
string
required
Human-readable location name.Examples:
  • "Tilagor"
  • "Campus"
  • "Shahi Eidgah"
  • "Modina Market"
type
string
required
Classification of the node’s purpose.
gmaps_address
string
required
Google Maps searchable address.Used for:
  • Distance Matrix API calculations
  • User-facing location descriptions
  • Map integrations
Examples:
  • "Tilagor, Sylhet, Bangladesh"
  • "Shahjalal University of Science and Technology, Sylhet, Bangladesh"
  • "Sylhet MAG Osmani Medical College Hospital, Sylhet, Bangladesh"
lat
number
Latitude coordinate (optional).Example: 24.9204
lng
number
Longitude coordinate (optional).Example: 91.8354

Node Types

Stop

Regular bus stops with scheduled pickups and drop-offs.
{
  "id": "TILAGOR",
  "name": "Tilagor",
  "type": "stop",
  "gmaps_address": "Tilagor, Sylhet, Bangladesh"
}
Characteristics:
  • Served by one or more bus routes
  • Users wait here for buses
  • May have local transport connections
Examples: TILAGOR, SHIBGONJ, NAIORPUL, KUMARPARA, CAMPUS

Intersection

Major crossroads serving as transfer points.
{
  "id": "SHAHI_EIDGAH",
  "name": "Shahi Eidgah",
  "type": "intersection",
  "gmaps_address": "Shahi Eidgah, Sylhet, Bangladesh"
}
Characteristics:
  • Multiple bus routes converge here
  • Good transfer points between routes
  • High connectivity to other nodes
Examples: SHAHI_EIDGAH, AMBARKHANA, SUBIDBAZAR

Destination

Key destinations with high foot traffic.
{
  "id": "MEDICAL",
  "name": "Medical",
  "type": "destination",
  "gmaps_address": "Sylhet MAG Osmani Medical College Hospital, Sylhet, Bangladesh"
}
Characteristics:
  • Important endpoints for routes
  • May have limited direct bus service
  • Often reached via local transport
Examples: MEDICAL (hospital), ZINDABAZAR (shopping district)

Complete Node List

All 19 Nodes

[
  {
    "id": "TILAGOR",
    "name": "Tilagor",
    "type": "stop",
    "gmaps_address": "Tilagor, Sylhet, Bangladesh"
  },
  {
    "id": "SHIBGONJ",
    "name": "Shibgonj",
    "type": "stop",
    "gmaps_address": "Shibgonj, Sylhet, Bangladesh"
  },
  {
    "id": "NAIORPUL",
    "name": "Naiorpul",
    "type": "stop",
    "gmaps_address": "Naiorpul, Sylhet, Bangladesh"
  },
  {
    "id": "KUMARPARA",
    "name": "Kumarpara",
    "type": "stop",
    "gmaps_address": "Kumarpara, Sylhet, Bangladesh"
  },
  {
    "id": "SHAHI_EIDGAH",
    "name": "Shahi Eidgah",
    "type": "intersection",
    "gmaps_address": "Shahi Eidgah, Sylhet, Bangladesh"
  },
  {
    "id": "AMBARKHANA",
    "name": "Ambarkhana",
    "type": "intersection",
    "gmaps_address": "Ambarkhana, Sylhet, Bangladesh"
  },
  {
    "id": "SUBIDBAZAR",
    "name": "Subidbazar",
    "type": "intersection",
    "gmaps_address": "Subidbazar, Sylhet, Bangladesh"
  },
  {
    "id": "PATHANTULA",
    "name": "Pathantula",
    "type": "stop",
    "gmaps_address": "Pathantula, Sylhet, Bangladesh"
  },
  {
    "id": "MODINA_MARKET",
    "name": "Modina Market",
    "type": "stop",
    "gmaps_address": "Modina Market, Sylhet, Bangladesh"
  },
  {
    "id": "CAMPUS",
    "name": "Campus",
    "type": "stop",
    "gmaps_address": "Shahjalal University of Science and Technology, Sylhet, Bangladesh"
  },
  {
    "id": "CHOWHATTA",
    "name": "Chowhatta",
    "type": "stop",
    "gmaps_address": "Chowhatta, Sylhet, Bangladesh"
  },
  {
    "id": "JAIL_RD",
    "name": "Jail Rd",
    "type": "stop",
    "gmaps_address": "Jail Road, Sylhet, Bangladesh"
  },
  {
    "id": "NAYASARAK",
    "name": "Nayasarak",
    "type": "stop",
    "gmaps_address": "Nayasarak, Sylhet, Bangladesh"
  },
  {
    "id": "RIKABI_BAZAR",
    "name": "Rikabi-Bazar Point",
    "type": "stop",
    "gmaps_address": "Rikabi Bazar, Sylhet, Bangladesh"
  },
  {
    "id": "LAKKATURA",
    "name": "Lakkatura",
    "type": "stop",
    "gmaps_address": "Lakkatura, Sylhet, Bangladesh"
  },
  {
    "id": "SHEIKHGHAT",
    "name": "Sheikhghat",
    "type": "stop",
    "gmaps_address": "Sheikhghat, Sylhet, Bangladesh"
  },
  {
    "id": "LAMABAZAR",
    "name": "Lamabazar",
    "type": "stop",
    "gmaps_address": "Lamabazar, Sylhet, Bangladesh"
  },
  {
    "id": "MEDICAL",
    "name": "Medical",
    "type": "destination",
    "gmaps_address": "Sylhet MAG Osmani Medical College Hospital, Sylhet, Bangladesh"
  },
  {
    "id": "ZINDABAZAR",
    "name": "Zindabazar",
    "type": "destination",
    "gmaps_address": "Zindabazar, Sylhet, Bangladesh"
  }
]

Usage in API

Route Planning

Node IDs are used in route planning:
GET /api/routes?from=TILAGOR&to=CAMPUS&time=08:30
Node IDs are case-sensitive. TILAGOR works, but tilagor returns an error.

Getting Node Information

GET /api/nodes
Returns basic info (without coordinates):
{
  "count": 19,
  "nodes": [
    {
      "id": "TILAGOR",
      "name": "Tilagor",
      "type": "stop"
    }
    // ... more nodes
  ]
}

Finding Nodes on a Route

GET /api/routes/bus1
Returns all stops for Bus 1:
{
  "stops": [
    {
      "id": "TILAGOR",
      "name": "Tilagor",
      "type": "stop"
    },
    {
      "id": "CAMPUS",
      "name": "Campus",
      "type": "stop"
    }
    // ... more stops
  ]
}

Node Connectivity

Nodes are connected via edges (relationships):

Bus Connections

Nodes connected by scheduled bus routes:
TILAGOR ---bus1---> SHIBGONJ ---bus1---> CAMPUS

Local Transport

Nodes connected by CNG/rickshaw:
SUBIDBAZAR ---local---> RIKABI_BAZAR
Cost: 20 BDT, Time: 5 min

Walking

Nearby nodes connected by walking paths:
RIKABI_BAZAR ---walk---> CHOWHATTA
Cost: 0 BDT, Time: 6 min

Validation

Required Fields

All nodes must have:
  • Unique id
  • Human-readable name
  • Valid type (stop/intersection/destination)
  • Google Maps searchable gmaps_address

ID Format

function isValidNodeId(id: string): boolean {
  // Must be uppercase with underscores only
  return /^[A-Z_]+$/.test(id);
}

// Valid:
isValidNodeId('TILAGOR'); // true
isValidNodeId('SHAHI_EIDGAH'); // true

// Invalid:
isValidNodeId('tilagor'); // false (lowercase)
isValidNodeId('SHAHI-EIDGAH'); // false (hyphen)
isValidNodeId('CAMPUS 2'); // false (space)

Type Validation

type NodeType = 'stop' | 'intersection' | 'destination';

function isValidNodeType(type: string): type is NodeType {
  return ['stop', 'intersection', 'destination'].includes(type);
}

Coordinate System

When provided, coordinates use WGS84 (GPS standard):
{
  "id": "CAMPUS",
  "name": "Campus",
  "lat": 24.9204,
  "lng": 91.8354
}
Coverage Area:
  • Latitude: ~24.85 to 24.95
  • Longitude: ~91.81 to 91.88
  • Region: Sylhet, Bangladesh

Distance Matrix Integration

The gmaps_address field is used for Distance Matrix API calls:
const from = nodes.find(n => n.id === 'TILAGOR');
const to = nodes.find(n => n.id === 'MEDICAL');

const result = await distanceMatrix.getDistance(
  from.gmaps_address,
  to.gmaps_address,
  'driving'
);

// Returns: distance, duration, cost

Edges

Nodes are connected by edges:
{
  "from": "TILAGOR",
  "to": "SHIBGONJ",
  "mode": "bus",
  "route_ids": ["bus1", "bus2"],
  "time_min": 5,
  "cost": 0,
  "one_way": false
}

Routes

Bus routes define stop sequences:
{
  "route_id": "bus1",
  "name": "Bus 1",
  "trips": [
    {
      "stops": ["TILAGOR", "SHIBGONJ", "CAMPUS"]
    }
  ]
}

Get All Nodes

List all 19 locations

Route Planning

Use nodes to plan routes

Bus Routes

See which nodes are served

RouteLeg Model

Nodes as from/to in legs

Build docs developers (and LLMs) love