DEV Community

Cover image for Telepage – I built a self-hosted PHP app that turns any Telegram channel into a website
Giuseppe Carlà
Giuseppe Carlà

Posted on

Telepage – I built a self-hosted PHP app that turns any Telegram channel into a website

If you run a Telegram channel, you already know the problem: your content is invisible to Google, there's no search, old posts are buried, and readers need the app just to see your work.

I built Telepage to fix that.

What it does

Telepage connects to your Telegram channel via a bot webhook and turns every post into a searchable web card — automatically, in real time.

Recipes site with 952 posts, colored tags and AI summaries

Every hashtag in your Telegram posts becomes a colored navigation filter. Every link gets its Open Graph metadata scraped. Every post gets an AI-generated summary and tags if you connect a Gemini key.

Science/news channel

The tech stack

Pure PHP 8.1, SQLite with WAL mode, vanilla JS. No frameworks, no Composer, no build step, no MySQL. It runs on standard shared hosting — I tested it on Aruba (a very restrictive Italian host).

Telegram channel
      │
      ▼ webhook (instant)
PHP 8.1 + SQLite
      │
      ▼
Your website — card grid, search, tag filters
Enter fullscreen mode Exit fullscreen mode

Interesting technical decisions

Session isolation per installation
Multiple Telepage sites on the same domain (e.g. site.com/news/ and site.com/recipes/) need completely separate admin sessions. I solved this with:

session_name('tp_' . substr(md5(TELEPAGE_ROOT), 0, 12));
session_start();
Enter fullscreen mode Exit fullscreen mode

Each installation path produces a unique session name — no shared cookies, no cross-login.

History Scanner
Telegram's Bot API has no "get all past messages" endpoint. To import historical content I use the forwardMessage trick: forward each message ID from the channel to itself, read the content, then immediately delete the forwarded copy. It scans backwards from the most recent ID, skipping gaps from deleted messages.

AI integration
Optional Google Gemini integration auto-tags and summarizes every post. The models available via the free tier change frequently — I built a cascade fallback that tries multiple model names in order and logs exactly which one succeeded.

What it looks like in production

I've been running it on two test channels:

  • A science/news channel: 23 posts, tagged by topic
  • A recipes channel: 952 posts, fully tagged and summarized by AI

The recipes site went from zero to 952 searchable, tagged posts in a few hours using the History Scanner.

What I'm less happy with

  • AI calls are currently synchronous in the admin panel — for large archives you click "Process AI" repeatedly. A proper background queue would be better.
  • The History Scanner requires manual ID tuning when posts are missing — not ideal for non-technical users.
  • No pagination on the install wizard, though the 5-step flow works fine in practice.

Try it

GitHub: github.com/scibilo/telepage

It's MIT licensed. Works on any PHP 8.1+ shared hosting with HTTPS. The install wizard takes about 5 minutes.

Feedback welcome — this is the first public release and I'm actively improving it.

Top comments (0)