{"id":20944555,"url":"https://github.com/intothevoid/kramerbot","last_synced_at":"2026-03-16T13:12:25.227Z","repository":{"id":37772756,"uuid":"492417623","full_name":"intothevoid/kramerbot","owner":"intothevoid","description":"A telegram bot to get you the latest Aussie deals","archived":false,"fork":false,"pushed_at":"2023-07-02T03:46:41.000Z","size":10042,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-19T21:38:27.606Z","etag":null,"topics":["amazon","deals","golang","mongo","mongodb","ozbargain","telegram"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intothevoid.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-15T07:29:45.000Z","updated_at":"2023-09-30T17:17:41.000Z","dependencies_parsed_at":"2024-06-21T10:09:03.082Z","dependency_job_id":null,"html_url":"https://github.com/intothevoid/kramerbot","commit_stats":{"total_commits":145,"total_committers":1,"mean_commits":145.0,"dds":0.0,"last_synced_commit":"2abc9a5923f5f6916d0db6af78fa38f3de13357b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intothevoid%2Fkramerbot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intothevoid%2Fkramerbot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intothevoid%2Fkramerbot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intothevoid%2Fkramerbot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intothevoid","download_url":"https://codeload.github.com/intothevoid/kramerbot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243335419,"owners_count":20274904,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amazon","deals","golang","mongo","mongodb","ozbargain","telegram"],"created_at":"2024-11-18T23:42:40.676Z","updated_at":"2026-03-16T13:12:25.217Z","avatar_url":"https://github.com/intothevoid.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kramer's Deals\n\n### @kramerbot\n\nLive Demo https://t.me/kramerbot\n\n\u003cimg src=\"https://raw.githubusercontent.com/intothevoid/kramerbot/main/static/kramer-ui1.jpg\" width=\"50%\" height=\"50%\"\u003e\u003c/img\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/intothevoid/kramerbot/main/static/kramer-ui2.jpg\" width=\"50%\" height=\"50%\"\u003e\u003c/img\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/intothevoid/kramerbot/main/static/kramer-ui3.jpg\" width=\"50%\" height=\"50%\"\u003e\u003c/img\u003e\n\nA Telegram bot — and now a full web app — to get you the latest deals from https://www.ozbargain.com.au and https://amazon.com.au. Let Kramer watch deals so you don't have to. Giddy up!\nA Telegram bot — and now a full web app — to get you the latest deals from https://www.ozbargain.com.au and https://amazon.com.au. Let Kramer watch deals so you don't have to. Giddy up!\nA Telegram bot — and now a full web app — to get you the latest deals from https://www.ozbargain.com.au and https://amazon.com.au. Let Kramer watch deals so you don't have to. Giddy up!\n\n## Features\n\n1. Uses Telegram Bot API for instant notifications\n2. Written in Go; deployable as a single binary or Docker container\n3. **Web UI** — sign up, manage preferences, browse deals, and link your Telegram account from a browser\n4. Subscribe to regular or top deals, or set up keyword watches via Telegram commands or the web dashboard\n5. User data is written to a SQLite database file (`data/users.db` by default)\n6. Keep track of deals already sent to avoid duplicate notifications\n7. Supports scraping www.ozbargain.com.au — Regular (all deals) and Top (25+ votes in 24h) deals\n8. Supports scraping www.amazon.com.au (via Camel Camel Camel RSS) — Top daily and weekly deals\n9. **Daily email summary** — opt-in digest of top OzBargain + Amazon Daily deals sent at 8pm (configurable timezone, defaults to `Australia/Adelaide`)\n10. Supports Android TV notifications (via Pipup)\n11. Admin announcement broadcast\n\n## Web UI\n\nThe web interface runs at `http://localhost:8989` (or the configured port).\n\n### Pages\n\n| Route | Description |\n|---|---|\n| `/` | Landing page |\n| `/signup` | Create an account (email + password) |\n| `/login` | Sign in |\n| `/verify-email` | Email verification landing (linked from signup email) |\n| `/forgot-password` | Request a password reset email |\n| `/reset-password` | Choose a new password (linked from reset email) |\n| `/dashboard` | Browse today's deals; manage keywords; link Telegram |\n\n### Sign-up flow\n\n1. Register at `/signup` — a verification email is sent immediately.\n2. Click the link in the email to verify your address and log in.\n3. Accounts that have not been verified cannot sign in.\n\n\u003e **Existing accounts in the database** (created before email verification was added) have `email_verified = 0` and will be blocked at login. To unblock them run:\n\u003e ```sql\n\u003e UPDATE web_users SET email_verified = 1;\n\u003e ```\n\n### Linking Telegram\n\n1. Sign up / log in on the web dashboard.\n2. Click **Link Telegram Account** in the sidebar.\n3. A deep link button appears — click it to open the Telegram app.\n4. The bot receives your `/start \u003ctoken\u003e` and links the accounts automatically.\n5. The dashboard updates within a few seconds.\n\n## Email (SMTP)\n\nEmail is used for three flows:\n\n| Flow | Trigger | Link destination |\n|---|---|---|\n| Email verification | New account registration | `/verify-email?token=…` |\n| Password reset | Forgot password form | `/reset-password?token=…` |\n| Daily summary | 8pm scheduler (opt-in per user) | — |\n\n### Configuring an SMTP provider\n\nSet the following variables in `kramerbot.env`:\n\n```bash\nSMTP_HOST=smtp.resend.com        # SMTP server hostname\nSMTP_PORT=587                    # STARTTLS port (use 587 for all providers)\nSMTP_USER=resend                 # Username (varies by provider)\nSMTP_PASS=re_xxxx                # Password / API key\nSMTP_FROM=KramerBot \u003cnoreply@yourdomain.com\u003e\n```\n\n**Important:** Do not use a personal `@gmail.com`, `@outlook.com`, or `@yahoo.com` address as `SMTP_FROM` when routing through a third-party relay — those domains have DMARC policies that will cause delivery failures. Use an address on a domain you control, or a sender address provided by your email service.\n\nRecommended providers:\n\n| Provider | Free tier | Notes |\n|---|---|---|\n| [Resend](https://resend.com) | 3,000/month | Use `onboarding@resend.dev` as sender without a custom domain |\n| [Mailjet](https://mailjet.com) | 6,000/month | Requires verified sender domain or address |\n| [SendGrid](https://sendgrid.com) | 100/day | `SMTP_USER=apikey`, `SMTP_PASS=\u003capi_key\u003e` |\n\nSet `SUMMARY_TIMEZONE` to any valid [IANA timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) (e.g. `Australia/Sydney`, `America/New_York`). The server timezone is irrelevant — the scheduler always targets 8pm in the configured zone.\n\nAlso update `api.web_url` in `config.yaml` to your public domain so links in emails point to the right place:\n\n```yaml\napi:\n  web_url: \"https://yourdomain.com\"\n```\n\n### Disabling email (development / testing)\n\nLeave `SMTP_HOST` empty. The bot skips sending emails and logs the verification/reset links to the console instead — copy them directly into your browser.\n\n```bash\n# Find links in container logs:\ndocker logs kramerbot | grep \"verify\\|reset\"\n```\n\n## REST API\n\nAll endpoints are prefixed with `/api/v1`.\n\n### Auth (public)\n\n```\nPOST /api/v1/auth/register          — Create account { email, password, display_name } → 202\nGET  /api/v1/auth/verify-email      — Verify email ?token=… → JWT\nPOST /api/v1/auth/login             — Login { email, password } → JWT\nPOST /api/v1/auth/logout            — Logout (client discards token)\nPOST /api/v1/auth/forgot-password   — Send reset email { email }\nPOST /api/v1/auth/reset-password    — Set new password { token, password }\n```\n\n### User (requires Bearer JWT)\n\n```\nGET    /api/v1/user/profile             — Current user profile\nPUT    /api/v1/user/preferences         — Update deal toggles\nGET    /api/v1/user/keywords            — List keywords\nPOST   /api/v1/user/keywords            — Add keyword { keyword }\nDELETE /api/v1/user/keywords/:keyword   — Remove keyword\nPOST   /api/v1/user/telegram/link       — Generate deep link token\nGET    /api/v1/user/telegram/status     — Linked status\nDELETE /api/v1/user/telegram/link       — Unlink Telegram\n```\n\n### Deals (requires Bearer JWT)\n\n```\nGET /api/v1/deals/ozbargain   ?type=good|super   \u0026limit=50 \u0026offset=0\nGET /api/v1/deals/amazon      ?type=daily|weekly \u0026limit=50 \u0026offset=0\nGET /api/v1/deals             — Combined feed\n```\n\n## Deployment\n\nConfiguration is primarily managed via `config.yaml`. Sensitive values must be set via environment variables.\n\n### Environment variables\n\n```\nTELEGRAM_BOT_TOKEN=\u003ctoken\u003e           # Mandatory for bot\nTELEGRAM_BOT_USERNAME=\u003cusername\u003e     # Used in deep link URL (without @)\nKRAMERBOT_ADMIN_PASS=\u003cpassword\u003e      # Optional — admin commands\nSQLITE_DB_PATH=\u003cpath\u003e                # Optional — defaults to data/users.db\nJWT_SECRET=\u003crandom_32_byte_hex\u003e      # Mandatory for web API in production\n\n# SMTP — set these to use a real mail provider (see \"Email\" section above)\nSMTP_HOST=\nSMTP_PORT=587\nSMTP_USER=\nSMTP_PASS=\nSMTP_FROM=KramerBot \u003cnoreply@yourdomain.com\u003e\n\n# Daily summary timezone — IANA timezone name (default: Australia/Adelaide)\nSUMMARY_TIMEZONE=Australia/Adelaide\n```\n\nGenerate a JWT secret:\n```bash\nopenssl rand -hex 32\n```\n\n### Run locally\n\n```bash\n# Backend\ngo build .\nJWT_SECRET=changeme TELEGRAM_BOT_TOKEN=\u003ctoken\u003e ./kramerbot\n\n# Frontend (separate terminal)\ncd frontend \u0026\u0026 npm run dev\n```\n\nWhen running locally without Docker, SMTP is not configured by default. Verification/reset links are printed to the terminal so you can copy them directly into your browser.\n\n### Using Docker Compose (recommended)\n\n1. Edit `kramerbot.env` and set `TELEGRAM_BOT_TOKEN`, `TELEGRAM_BOT_USERNAME`, and `JWT_SECRET`.\n2. Run:\n```bash\ndocker compose up -d\n```\n\n3. Open **http://localhost:8989** for the web app.\n\n### Using Docker directly\n\n```bash\nmkdir -p data\n\ndocker run -d --name kramerbot \\\n  --env-file ./kramerbot.env \\\n  -v \"$(pwd)/data:/app/data\" \\\n  -p 8989:8080 \\\n  --restart unless-stopped \\\n  kramerbot:latest\n```\n\nNote: when running without Docker Compose, wire up your own SMTP server via the `SMTP_*` env vars.\n\n### Setup Database (SQLite)\n\nThe bot auto-creates `data/users.db` on first run (including the `web_users` table with email verification columns).\nNo manual migration is needed.\n\n\u003cimg src=\"https://raw.githubusercontent.com/intothevoid/kramerbot/main/static/about.jpeg\" width=\"50%\" height=\"50%\"\u003e\u003c/img\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintothevoid%2Fkramerbot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintothevoid%2Fkramerbot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintothevoid%2Fkramerbot/lists"}