Skip to content

Vishal2002/wakeme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WakeMe - Never Miss Your Stop Again! 🚀

WakeMe is a Telegram bot that helps you never miss your bus/train stop while traveling — especially useful when you're tired or sleeping during long journeys.

It tracks your location (bus) or train status (via PNR), and automatically wakes you up with voice calls ~30 minutes before arrival using AI-powered phone calls.

Current date reference: Project actively developed in 2025–2026

✨ Features

  • Bus Mode

    • Share live location → bot tracks you in real-time
    • Set destination (name or location pin)
    • Calculates distance & ETA continuously
    • Voice wake-up call when ~30 min away
  • Train Mode

    • Enter 10-digit PNR number
    • Fetches train name, route, timings via IRCTC
    • Live train status tracking (current station, delay, stations left)
    • Voice wake-up call when approaching destination
  • Smart Wake-up System

    • Uses Bland.ai for natural Indian English voice calls
    • Up to 5 retry attempts (2 min interval)
    • Detects phrases like "I'm awake", "Yes I'm up"
    • Leaves voicemail if not answered
    • Escalates urgency in later attempts
  • Safety & Privacy

    • Only asks for phone when needed
    • Supports /cancel, /awake, /status commands
    • Graceful handling of API failures & location issues

🛠️ Tech Stack

  • Language: TypeScript
  • Runtime: Node.js
  • Telegram Bot Framework: Telegraf
  • Database: PostgreSQL
  • Voice Calls: Bland.ai API
  • Train Status: irctc-connect (unofficial)
  • Geocoding: Google Maps API (with Indian cities fallback)
  • Server: Express (for webhook + health)
  • Deployment Ready: Railway.app friendly structure

Project Structure (simplified)

src/
├── config/             # env + constants
├── database/           # schema, queries, pool
├── handlers/           # telegram message/command/callback handlers
├── services/           # business logic (train, location, voice, telegram)
├── workers/            # background jobs (alerts, tracking)
├── types/              # shared interfaces
└── server.ts           # main entry + bot + express

🚀 Getting Started

Prerequisites

  • Node.js 18+
  • PostgreSQL database
  • Telegram Bot Token
  • Bland.ai API Key (https://bland.ai)
  • Google Maps API Key (optional)
  • Railway.app / VPS / any Node.js hosting

Environment Variables (.env)

TELEGRAM_BOT_TOKEN=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11
SERVER_URL=https://your-domain.com
PORT=3000

# Database
DATABASE_URL=postgresql://user:pass@host:5432/dbname

# Voice Calls
BLAND_API_KEY=sk_xxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Optional - for better geocoding
GOOGLE_MAPS_API_KEY=AIzaSyCxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Run locally

# Install dependencies
npm install

# Development (with hot reload)
npm run dev

# Build & start production
npm run build
npm start

📱 How to Use the Bot

  1. Start → /start
  2. Choose Bus or Train
    • Bus: Share Live Location (8 hours recommended)
    • Train: Send 10-digit PNR
  3. Set destination (text or location pin for bus)
  4. Share phone number (needed for wake-up calls)
  5. Relax — bot will track & call you when close!

Useful commands:

/status   → check current trip progress
/cancel   → stop tracking & alerts
/awake    → manually confirm you're awake
/help     → show commands

⚠️ Current Limitations (2026)

  • Indian trains only (IRCTC based)
  • Bus tracking depends on user sharing live location continuously
  • Voice call quality depends on Bland.ai credits & network
  • No multi-leg journeys yet
  • Geocoding fallback is very limited (top 10 cities only)

❤️ Acknowledgments

  • Telegram & Telegraf community
  • Bland.ai team for fantastic voice API
  • Indian Railways passengers who sleep through stations 😴

Made with ☕ and late-night train journeys

About

Agent that helps you wake up before your destination.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors