Skip to content

manojbade/winping

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WinPing

A Telegram bot that reminds you of your wins when you're spiraling.

Log your daily achievements. Get a personalized AI message every morning based on your wins — not generic motivation.


Try it now

@my_winping_bot — already running, free to use.

  1. Open Telegram → search @my_winping_bot
  2. Send /start
  3. Log your first win: /win I shipped something today
  4. Customize with /settings

Commands

Command What it does
/win <text> Log an achievement
/list View recent wins
/spiral Instant motivation when anxious (uses your wins)
/settings Set reminder time, timezone, tone, format
/test Preview your daily reminder
/help Full command reference

How it works

  • You log wins throughout the day
  • Every morning at your chosen time, the bot sends you an AI-generated message based on 1–3 of your recent wins
  • When you're anxious or spiraling, /spiral fetches a win + a quote instantly
  • AI tone options: Normal, Future Self, Mentor, Friend, Power

Why no SMS? SMS requires regulatory compliance, carrier registration, and significant overhead. Telegram keeps it simple and free.


Tech Stack

  • Bot: python-telegram-bot 22.5
  • Backend: FastAPI + SQLAlchemy 2.0 (async)
  • Database: PostgreSQL
  • AI: Google Gemini 2.5 Flash Lite
  • Deployment: Railway (~$8–13/month)

Self-hosting on Railway

If you want to run your own instance:

1. Fork & clone

git clone https://github.com/manojbade/winping.git
cd winping

2. Create a Telegram bot

  • Message @BotFather on Telegram
  • Send /newbot and follow the steps
  • Copy the bot token

3. Get a Gemini API key

4. Deploy on Railway

  1. Create a new project at railway.app
  2. Add a PostgreSQL service (click Add Service → Database → PostgreSQL)
  3. Add a new service from your GitHub repo
  4. Set the start command: python -m app.bot.main
  5. Set environment variables (see below)

5. Run database migrations

In your Railway PostgreSQL service → Query tab, run the SQL files in order:

migrations/init.sql
migrations/add_telegram_fields.sql
migrations/add_reminder_format.sql
migrations/add_feedback_table.sql

6. Environment variables

Set these in your Railway service:

# Required
DATABASE_URL=postgresql://...        # Auto-provided by Railway PostgreSQL
TELEGRAM_BOT_TOKEN=your_token_here
SECRET_KEY=any_random_string_here

# Optional but recommended (enables AI messages)
GOOGLE_API_KEY=your_gemini_api_key

# Optional (defaults work fine)
ENVIRONMENT=production
DEBUG=False
JOB_QUEUE_ENABLED=True
MAX_SPIRAL_REQUESTS_PER_HOUR=5
MAX_WIN_SUBMISSIONS_PER_DAY=20

Railway automatically injects DATABASE_URL when you link the PostgreSQL service to your app service.


Local development

python -m venv .venv
source .venv/bin/activate       # Windows: .venv\Scripts\activate
pip install -r requirements.txt

cp .env.example .env
# Fill in: TELEGRAM_BOT_TOKEN, DATABASE_URL, GOOGLE_API_KEY, SECRET_KEY

python -m app.bot.main

Contributing & Feedback

Have a feature idea or found a bug? Open an issue on GitHub — all suggestions welcome.


License

MIT — free to use, fork, and build on.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors