Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Trackly β€” No cap, the smartest way to track trains πŸš†

A full-stack Indian Railways intelligence platform with live GPS tracking, AI journey assistant (RailMind), delay predictions, weather forecasting along route, elevation profiling, and POI discovery. Built for modern India, works on every device.

Output Screen :-

Screenshot 2026-08-10 at 12 47 34β€―PM Screenshot 2026-08-10 at 12 45 31β€―PM
Screenshot 2026-08-10 at 12 46 09β€―PM Screenshot 2026-08-10 at 12 45 54β€―PM
Screenshot 2026-08-10 at 12 46 59β€―PM Screenshot 2026-08-10 at 12 46 50β€―PM

What is Trackly

Trackly is not just another train tracking app. While apps like NTES, RailYatri, and ixigo only show you where the train is, Trackly tells you everything:

  • Live position on an interactive map with smooth interpolation
  • Why the train is delayed β€” weather, congestion, or upstream trains
  • Whether you'll make your connecting train
  • What you're passing through β€” rivers, mountains, monuments, cities
  • AI answers to any question about your journey β€” no hallucinations, no guessing

The core differentiator is RailMind β€” a RAG-powered AI assistant strictly scoped to Indian Railways data, always cites its source, and honestly says "I don't know" rather than making things up.


Features

Live Train Tracking

  • Real-time position from RailRadar API with smooth interpolation between pings
  • Animated train marker on interactive MapLibre GL map
  • Full route visualization β€” orange for covered, grey for remaining
  • Station dots with popups showing arrival/departure times
  • Speed indicator (km/h), delay status, last update timestamp
  • Auto-refresh every 30 seconds

Smart Search

  • Search any train by number (e.g. 12951) or name (e.g. Rajdhani)
  • Instant results with live delay badge
  • Recent searches saved locally
  • Favourite trains for quick access

Journey Analytics

  • Journey completion percentage with distance covered and remaining
  • Delay trend analysis (improving / stable / worsening)
  • Elevation profile along the entire route
  • Station arrival history (actual vs scheduled)

Weather Intelligence

  • Current weather at every station along the route
  • Rain probability and fog alerts that affect delays
  • Temperature range across the full journey
  • Route-wide weather delay risk score (High / Medium / Low)

Route Intelligence

  • Points of interest along the route via OpenStreetMap Overpass API
  • Rivers, mountains, heritage sites, tourist attractions near each station
  • Elevation profile chart powered by OpenTopoData

RailMind AI (Strict RAG)

  • Powered by Groq Llama 3.3-70b β€” fastest free LLM available
  • 3-layer hallucination prevention system
  • Confidence scoring on every response (HIGH / MEDIUM / LOW)
  • Hard scope boundary β€” refuses all non-railway questions
  • Suggested follow-up questions after every answer
  • Journey-aware β€” knows your current train's live status

Tech Stack

Frontend

Technology Version Purpose
Next.js 14.2.5 React framework with App Router
TypeScript 5.x Type safety across the codebase
TailwindCSS 3.4 Utility-first styling
MapLibre GL JS 4.5.0 Interactive map rendering
Zustand 4.5 Lightweight global state management
Recharts 2.12 Elevation profile chart
Lucide React 0.400 Icon library (no emojis)
Framer Motion 11.3 Page transitions and animations
Axios 1.7 HTTP client with interceptors

Backend

Technology Version Purpose
FastAPI 0.111 High-performance Python web framework
Uvicorn 0.30 ASGI server with WebSocket support
Groq SDK 0.9 LLM API client
LangChain 0.2.6 RAG pipeline orchestration
ChromaDB 0.5.3 Local vector database
sentence-transformers 3.0.1 Free local text embeddings
httpx 0.27 Async HTTP client
Pydantic 2.7 Request/response data validation
BeautifulSoup4 4.12 HTML parsing for NTES fallback
APScheduler 3.10 Background scheduling
WebSockets 12.0 Real-time live position updates

AI / ML Models

Model Provider Temperature Use Case
llama-3.1-8b-instant Groq (free) 0.0 Intent classifier β€” binary, fast
llama-3.1-8b-instant Groq (free) 0.0 Entity extraction β€” JSON output
llama-3.3-70b-versatile Groq (free) 0.1 Main RailMind responses
mixtral-8x7b-32768 Groq (free) 0.1 Long-context route analysis
all-MiniLM-L6-v2 HuggingFace (local) β€” Text embeddings for ChromaDB

System Architecture

╔══════════════════════════════════════════════════════════════════╗
β•‘                        USER BROWSER                              β•‘
β•‘                                                                  β•‘
β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β•‘
β•‘  β”‚  Next.js 14  β”‚  β”‚ MapLibre GL  β”‚  β”‚   RailMind Chat UI   β”‚    β•‘
β•‘  β”‚  App Router  β”‚  β”‚ Interactive  β”‚  β”‚  (React Component)   β”‚    β•‘
β•‘  β”‚  5 Tab Pages β”‚  β”‚    Map       β”‚  β”‚  Confidence Badges   β”‚    β•‘
β•‘  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β•‘
β•‘         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β•‘
β•‘                           β”‚ HTTP / WebSocket / REST              β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•ͺ══════════════════════════════════════╝
                            β”‚
╔═══════════════════════════β•ͺ══════════════════════════════════════╗
β•‘                    FASTAPI BACKEND                               β•‘
β•‘                            β”‚                                     β•‘
β•‘   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β•‘
β•‘   β”‚/search β”‚/trainsβ”‚ /live   β”‚  /ai   β”‚/weather β”‚/elevation β”‚    β•‘
β•‘   β”‚ Router β”‚ Routerβ”‚ Router  β”‚ Router β”‚ Router  β”‚ /poi      β”‚    β•‘
β•‘   β””β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”¬β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”΄β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β•‘
β•‘       β”‚        β”‚        β”‚         β”‚        β”‚                     β•‘
β•‘   β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”  β”Œβ”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β•‘
β•‘   β”‚    TrainService        β”‚  β”‚ RailMind β”‚ β”‚  WeatherService  β”‚  β•‘
β•‘   β”‚                        β”‚  β”‚   RAG    β”‚ β”‚  + GeoService    β”‚  β•‘
β•‘   β”‚ β€’ RailRadar API        β”‚  β”‚ Pipeline β”‚ β”‚                  β”‚  β•‘
β•‘   β”‚ β€’ NTES fallback        β”‚  β”‚          β”‚ β”‚ Open-Meteo       β”‚  β•‘
β•‘   β”‚ β€’ Position interpolate β”‚  β”‚ ChromaDB β”‚ β”‚ OpenTopoData     β”‚  β•‘
β•‘   β”‚ β€’ WebSocket broadcast  β”‚  β”‚ + Groq   β”‚ β”‚ Overpass API     β”‚  β•‘
β•‘   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•
                            β”‚
╔═══════════════════════════β•ͺ══════════════════════════════════════╗
β•‘                 EXTERNAL APIs (All Free Tier)                    β•‘
β•‘                                                                  β•‘
β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β•‘
β•‘  β”‚  RailRadar  β”‚ β”‚ MapTiler β”‚ β”‚ Open-Meteo β”‚ β”‚ OpenTopoData  β”‚   β•‘
β•‘  β”‚ 50 req/day  β”‚ β”‚ 100k/mo  β”‚ β”‚ unlimited  β”‚ β”‚ 1000 req/day  β”‚   β•‘
β•‘  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β•‘
β•‘                                                                  β•‘
β•‘  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β•‘
β•‘  β”‚  Overpass   β”‚ β”‚Nominatim β”‚ β”‚         Groq API               β”‚ β•‘
β•‘  β”‚  OSM POI    β”‚ β”‚Geocoding β”‚ β”‚  llama-3.3-70b (free tier)     β”‚ β•‘
β•‘  β”‚  unlimited  β”‚ β”‚ free     β”‚ β”‚  500k tokens/day free          β”‚ β•‘
β•‘  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Data Flow

Search Flow

User types "12951" or "Rajdhani"
            β”‚
            β–Ό debounce 300ms
GET /api/search/?q=12951
            β”‚
            β–Ό
TrainService.search_trains()
            β”‚
            β”œβ”€β”€β–Ί RailRadar /v1/lookup/trains?q=12951
            β”‚         β”‚
            β”‚    200 OK β†’ parse {number, name, source, dest}
            β”‚    429    β†’ show rate limit message
            β”‚    404    β†’ empty results
            β”‚
            β–Ό
Return SearchResult[] with delay badge
            β”‚
            β–Ό
Render dropdown β€” click to go to /train/12951

Live Tracking Flow

User opens /train/12951
            β”‚
            β–Ό Parallel fetch
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ GET /api/trains/id  β”‚  GET /api/live/id
   β”‚ Full schedule       β”‚  Current position
   β”‚ All stations        β”‚  Delay in minutes
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  Speed (km/h)
            β”‚
            β–Ό
MapLibre map.on('load'):
   β”œβ”€β”€ addSource('full')   β†’ grey route line
   β”œβ”€β”€ addSource('done')   β†’ orange completed line
   β”œβ”€β”€ forEach station     β†’ dot marker + popup
   └── trainMarker         β†’ orange circle icon
            β”‚
            β–Ό
fitBounds() β†’ zoom to show entire route
            β”‚
            β–Ό
Poll every 30s:
   GET /api/live/12951
            β”‚
   β”œβ”€β”€ trainMarker.setLngLat([lng, lat])
   β”œβ”€β”€ source('done').setData(completedCoords)
   └── Update stats grid

RailMind AI Flow

User: "Will my train reach Mumbai on time?"
            β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ INTENT CHECK    β”‚  llama-3.1-8b / temp=0.0
   β”‚ Railway? YES/NO β”‚  ~180ms
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚ YES only
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ EXTRACT ENTITY  β”‚  llama-3.1-8b / temp=0.0
   β”‚ train=12951     β”‚  JSON output
   β”‚ type=delay      β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ CHROMADB RAG    β”‚  Local vector search
   β”‚ Find relevant   β”‚  Top 4 chunks returned
   β”‚ schedule data   β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ INJECT LIVE     β”‚  From RailRadar API
   β”‚ delay=23 mins   β”‚  Real-time context
   β”‚ station=Surat   β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
   β”‚ GROUNDED RESPONSE  llama-3.3-70b / temp=0.1 β”‚
   β”‚                                              β”‚
   β”‚ System prompt enforces:                      β”‚
   β”‚  β€’ Only answer from provided context         β”‚
   β”‚  β€’ Never invent train numbers or timings     β”‚
   β”‚  β€’ Add [CONFIDENCE: HIGH/MEDIUM/LOW]         β”‚
   β”‚  β€’ Add [SOURCE: Live API / Schedule DB]      β”‚
   β”‚  β€’ Max 180 words, suggest 2 follow-ups       β”‚
   β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
            β”‚
            β–Ό
Response with badge:
  🟒 HIGH β€” from live API
  🟑 MEDIUM β€” from schedule DB
  πŸ”΄ LOW β€” estimated/inferred

AI Pipeline β€” RailMind

How Hallucination is Prevented

Query enters
    β”‚
    β–Ό
[Gate 1] Is it about railways?
    NO  ──────────────────────► "I only answer railway questions"
    β”‚
    YES
    β–Ό
[Gate 2] ChromaDB retrieval
    Empty ────────────────────► "No data β€” check NTES or IRCTC"
    β”‚
    Has context
    β–Ό
[Gate 3] LLM with constraints
    Temperature 0.1 (near-zero creativity)
    "ONLY use the context provided below"
    "NEVER invent train numbers or timings"
    β”‚
    β–Ό
[Gate 4] Confidence tagging
    Live API data     β†’ HIGH confidence
    Schedule database β†’ MEDIUM confidence
    Inferred/estimated β†’ LOW confidence
    β”‚
    β–Ό
Response shown with confidence badge + source

Project Structure

trackly/
β”‚
β”œβ”€β”€ README.md                           ← This file
β”œβ”€β”€ start.sh                            ← One-command startup script
β”‚
β”œβ”€β”€ backend/                            ← Python FastAPI server
β”‚   β”œβ”€β”€ main.py                         ← Entry point, CORS, lifespan hooks
β”‚   β”œβ”€β”€ requirements.txt                ← All Python dependencies
β”‚   β”œβ”€β”€ .env.example                    ← Template (copy to .env)
β”‚   β”‚
β”‚   β”œβ”€β”€ routers/                        ← HTTP route handlers
β”‚   β”‚   β”œβ”€β”€ search.py                   ← GET /api/search/?q=
β”‚   β”‚   β”œβ”€β”€ trains.py                   ← GET /api/trains/{id}
β”‚   β”‚   β”œβ”€β”€ live.py                     ← GET + WS /api/live/{id}
β”‚   β”‚   β”œβ”€β”€ ai.py                       ← POST /api/ai/chat
β”‚   β”‚   β”œβ”€β”€ weather.py                  ← GET /api/weather/{id}
β”‚   β”‚   β”œβ”€β”€ elevation.py                ← GET /api/elevation/{id}
β”‚   β”‚   └── poi.py                      ← GET /api/poi/{id}
β”‚   β”‚
β”‚   β”œβ”€β”€ services/                       ← Core business logic
β”‚   β”‚   β”œβ”€β”€ train_service.py            ← RailRadar + NTES integration
β”‚   β”‚   β”œβ”€β”€ rag_pipeline.py             ← Groq + ChromaDB RAG engine
β”‚   β”‚   β”œβ”€β”€ weather_service.py          ← Open-Meteo integration
β”‚   β”‚   └── geo_service.py              ← Elevation + POI services
β”‚   β”‚
β”‚   └── models/
β”‚       └── train.py                    ← Pydantic request/response models
β”‚
└── frontend/                           ← Next.js React application
    β”œβ”€β”€ next.config.js                  ← Next.js + env var config
    β”œβ”€β”€ tailwind.config.ts              ← Brand colors, design tokens
    β”œβ”€β”€ package.json                    ← Node dependencies
    β”œβ”€β”€ tsconfig.json                   ← TypeScript config
    β”‚
    └── src/
        β”œβ”€β”€ app/                        ← Next.js App Router
        β”‚   β”œβ”€β”€ layout.tsx              ← Root layout + Navbar
        β”‚   β”œβ”€β”€ page.tsx                ← Homepage β€” hero + search
        β”‚   β”œβ”€β”€ globals.css             ← Global styles
        β”‚   β”œβ”€β”€ search/page.tsx         ← Full-page search
        β”‚   β”œβ”€β”€ favourites/page.tsx     ← Saved trains list
        β”‚   β”œβ”€β”€ settings/page.tsx       ← API keys + about
        β”‚   └── train/[id]/page.tsx     ← Train detail (5 tabs)
        β”‚
        β”œβ”€β”€ components/
        β”‚   β”œβ”€β”€ layout/
        β”‚   β”‚   └── Navbar.tsx          ← Top nav with route awareness
        β”‚   β”œβ”€β”€ tracking/
        β”‚   β”‚   β”œβ”€β”€ LiveTrackingTab.tsx ← MapLibre map + live data
        β”‚   β”‚   β”œβ”€β”€ StationTimeline.tsx ← All stops with status
        β”‚   β”‚   └── WeatherTab.tsx      ← Per-station weather cards
        β”‚   β”œβ”€β”€ analytics/
        β”‚   β”‚   └── AnalyticsTab.tsx    ← Elevation chart + POI list
        β”‚   └── ai/
        β”‚       └── RailMindChat.tsx    ← Chat UI with confidence badges
        β”‚
        └── lib/
            β”œβ”€β”€ api.ts                  ← Typed Axios client + interfaces
            └── store.ts                ← Zustand β€” recents, favourites, state

API Reference

Base URL: http://localhost:8000/api

Interactive docs at http://localhost:8000/docs

Method Endpoint Description
GET /search/?q={query} Search trains by number or name
GET /trains/{id} Full schedule + all stations
GET /trains/{id}/status Current running status
GET /live/{id} Live position + delay (HTTP)
WS /live/ws/{id} WebSocket stream (30s interval)
POST /ai/chat RailMind AI conversation
GET /ai/suggestions/{id} Proactive AI journey alerts
GET /weather/{id} Weather for all route stations
GET /elevation/{id} Elevation profile data
GET /poi/{id} Points of interest along route

Free APIs Used

API Provides Free Limit Key?
RailRadar Live tracking, schedules, search 50 req/day Yes β€” railradar.in/developers
Groq LLM inference (Llama 3.3) 500k tokens/day Yes β€” console.groq.com
MapTiler Vector map tiles 100k tiles/month Yes β€” maptiler.com
Open-Meteo Weather forecast Unlimited No
OpenTopoData Elevation (SRTM) 1000 req/day No
Overpass API OSM points of interest Unlimited No
Nominatim Reverse geocoding Fair use No

Total cost for full MVP: β‚Ή0 / month


Quick Start

Prerequisites

  • Node.js 18+
  • Python 3.11+
  • Git

1. Clone

git clone https://github.com/yourusername/trackly.git
cd trackly

2. Get Free API Keys

RailRadar  β†’ https://railradar.in/developers  (2 min)
Groq       β†’ https://console.groq.com         (2 min)
MapTiler   β†’ https://maptiler.com             (2 min)

3. Backend

cd backend
cp .env.example .env
# Edit .env β†’ add RAILRADAR_API_KEY and GROQ_API_KEY

python -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -r requirements.txt
python main.py
# βœ… http://localhost:8000
# πŸ“– http://localhost:8000/docs

4. Frontend

cd frontend
cp .env.local.example .env.local
# Edit .env.local β†’ add NEXT_PUBLIC_MAPTILER_KEY

npm install
npm run dev
# βœ… http://localhost:3000

Environment Variables

backend/.env

RAILRADAR_API_KEY=rr_live_xxxxxxxxxxxxxxxx    # required
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxx      # required
REDIS_URL=redis://localhost:6379               # optional
APP_ENV=development
CORS_ORIGINS=http://localhost:3000

frontend/.env.local

NEXT_PUBLIC_MAPTILER_KEY=your_key_here         # required
NEXT_PUBLIC_API_URL=http://localhost:8000       # change in production

Deployment

Backend on Render.com

1. Push repo to GitHub
2. render.com β†’ New Web Service β†’ Connect repo
3. Build command:   pip install -r requirements.txt
4. Start command:   uvicorn main:app --host 0.0.0.0 --port $PORT
5. Add env vars in Render dashboard

Frontend on Vercel

1. vercel.com β†’ Import project β†’ Connect GitHub repo
2. Framework: Next.js (auto-detected)
3. Environment variables:
   NEXT_PUBLIC_API_URL        = https://your-app.onrender.com
   NEXT_PUBLIC_MAPTILER_KEY   = your_maptiler_key
4. Deploy

Built by

Ankit β™‘

"No cap, Indian Railways just got an upgrade."

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages