Case Study: Telegram Channels – A Directory with ~47,800 Telegram Channels, Website and Mini App in One
How we built telegramchannels.io, indexing ~47,800 Telegram channels across a unified website and Mini App with automated discovery and Telegram Stars.
The Discovery Gap: Why Telegram Channels Remain Hard to Find
Telegram passed 1 billion monthly active users in March 2025. Despite this scale, public channel discovery remains one of the application's most persistent product limitations.
Telegram's in-app global search operates primarily on exact string matches against channel titles and public usernames (@handle). If a user does not already know the exact handle or phrasing used by an administrator, finding relevant, active channels in specific technical or geographic niches requires navigating fragmented external social feeds, link aggregators, or forwarded messages.
The Failure Modes of Third-Party Directories
Independent web directories have attempted to bridge this discovery gap, but most quickly degrade into unusable link farms due to poor data pipelines:
- Stale metadata: Channels regularly change usernames, switch permissions, or abandon publishing altogether. Without active verification routines, external indexes fill with dead links and orphaned handles.
- Manipulated metrics: Many aggregators display inflated or unverified subscriber figures to sell sponsored slots, giving users inaccurate signals about channel reach and engagement.
- Unmoderated spam: Sites without strict intake pipelines routinely index spam networks, illicit services, and automated engagement pods, degrading search relevance for legitimate publishers.
The Objective: telegramchannels.io
We designed and built telegramchannels.io to resolve these structural issues. The target was to establish a searchable, real-time directory of about 47,800 verified Telegram channels operating from a single, unified codebase.
The product requirements dictated that the directory must serve two environments equally: a high-performance, indexable website for desktop and mobile browsers, and an embedded Telegram Mini App running directly inside Telegram's WebView interface. Achieving this required an automated candidate discovery pipeline, strict multi-stage quality control, and an architectural rule that every metric displayed is either directly measured or omitted entirely.
Unified Architecture: Website and Telegram Mini App in One Codebase
Building separate codebases for a web directory and a Telegram Mini App creates duplicated maintenance, fragmented API integrations, and inconsistent UI states. Telegram Channels runs on a single Next.js 14 App Router project that simultaneously serves standard desktop and mobile browsers at telegramchannels.io and functions as an embedded Mini App inside Telegram's WebView.
Dual-Context Rendering with Next.js 14
The routing structure remains identical across environments. A request to /channel/[slug] resolves to the same React 18 page component whether opened from an organic search query on the web or tapped inside a Telegram chat.
The application detects the execution context on the client:
- Telegram WebView: Suppresses desktop-centric headers, footers, and redundant external links. Navigation delegates directly to Telegram's native
BackButtonandMainButtonprimitives via the Telegram Mini Apps SDK. - Standard Web: Renders full responsive navigation, search bars, category menus, and standard metadata tags for search engine indexing.
Dynamic UI Adaptation via Telegram Theme Variables
Telegram passes visual parameters directly to the WebView through CSS custom properties. Rather than enforcing an arbitrary fixed theme inside the app, the UI adapts dynamically using system tokens:
:root {
--bg-color: var(--tg-theme-bg-color, #ffffff);
--text-color: var(--tg-theme-text-color, #111827);
--link-color: var(--tg-theme-link-color, #2563eb);
--button-color: var(--tg-theme-button-color, #2481cc);
--button-text-color: var(--tg-theme-button-text-color, #ffffff);
}
When loaded in a desktop browser, CSS fallbacks ensure a standard design system is applied. When opened inside Telegram, the interface inherits the user's native client colors (such as dark mode or tinted chat themes) without layout shifts or theme flashes.
Database Architecture: PostgreSQL and Prisma
Serving listings across ~47,800 approved channels requires structured relational data and predictable query latency. The database layer uses PostgreSQL managed via Prisma:
- Indexed Query Paths: Composite indexes on
(status, categoryId, memberCount DESC)and(status, isFeatured, createdAt DESC)ensure directory views and filtered searches execute without full table scans. - Denormalized Display Metrics: Rating averages and total member counts are stored directly on the channel record and updated via scheduled tasks rather than computed through raw join queries during page generation.
- Schema Isolation: Active listings, candidate review queues, and verification metadata exist in clearly separated Prisma models, preventing raw intake records from polluting live listings.
Self-Hosting Infrastructure on Coolify
Instead of deploying to closed serverless platforms where bandwidth, continuous ingestion processes, and database connections create variable monthly costs, the entire stack is deployed via Coolify on private virtual instances.
Coolify manages Git-based deployments, SSL certificates, and environment variables across Docker containers. This setup runs the Next.js runtime, the PostgreSQL instance, and local file caching workers in the same private network. It delivers low internal database latency, eliminates third-party platform lock-in, and maintains full data ownership over the entire directory catalog.
The Ingestion Engine: Finding ~7,800 Channel Candidates Every Day
Telegram provides no global channel index or searchable registry. To build an index at scale, our ingestion engine runs automated workers that discover roughly 7,800 candidate channels every 24 hours. The discovery pipeline scans public web references, directory pages, community aggregate lists, and public t.me/* links shared across external platforms.
Candidates Discovered vs. Channels Listed
A core structural principle of the platform is keeping candidate discovery strictly separated from directory publication:
- Discovered candidates (~7,800 / day): Raw handles and links detected by discovery scripts that point to accessible Telegram entities.
- Newly listed channels (~700 / day): Verified, unique channels that pass filtering, content screening, and editorial review.
Discovery volume never equals directory growth. Roughly 90% of daily candidate links never enter the main directory. Many are duplicates of existing records, broken invite links, empty channels, private groups, or commercial spam. Treating discovery as an intake pipeline ensures the primary directory of ~47,800 channels contains only active, accessible destinations.
Deduplication and Ingestion Pipeline
Because the same popular channels are referenced repeatedly across the web, ingestion requires strict deduplication before candidate records touch the editorial queue or the production database.
// Candidate normalization before database insertion
export function extractCanonicalUsername(input: string): string | null {
const cleaned = input.trim().toLowerCase();
const match = cleaned.match(/(?:t\.me\/|telegram\.me\/|@)?([a-z0-9_]{5,32})/i);
return match ? match[1].toLowerCase() : null;
}
The pipeline handles incoming candidates through sequential stages:
- Handle Normalization: Strips URL prefixes, query parameters, trailing slashes, and
@symbols to extract the canonical, lowercase username. - Database Lookup: Checks PostgreSQL via Prisma for an existing record with that canonical username.
- Branching Action:
- If the channel exists: The worker updates the
lastSeenAttimestamp and skips the review queue entirely. If metadata is stale, it marks the channel for an eventual background refresh without duplicating the record. - If the channel is new: The handle is saved to a separate candidate staging table with a
pending_screenstatus.
- If the channel exists: The worker updates the
This boundary ensures that re-indexed channels reinforce data freshness rather than creating duplicate listings.
Quality Control Pipeline: AI Pre-Screening and Human Editorial Review
The Spam Problem in Automated Ingestion
Relying purely on automated scrapers to populate a directory results in an unusable product. Telegram hosts millions of public broadcasts, but uncurated feeds are saturated with automated spam networks, pump-and-dump groups, copyright infringements, and adult material. Open-source directory scripts often write raw crawler outputs straight to a public database. This creates bloated, low-trust platforms that search engines demote and users abandon. Ingestion volume means nothing if the resulting index lacks curation.
Stage 1: AI Content Pre-Screening
To handle the incoming stream of ~7,800 candidate channels discovered daily without overwhelming human staff, every candidate passes through an automated AI pre-screening service. Each channel is screened once upon ingestion.
The pre-screen worker analyzes the channel’s public metadata, bio, and recent post content. It applies policy rules to discard channels containing:
- Adult or pornographic content
- Unregulated gambling or casino promotions
- Illegal substances, phishing, and financial scams
- Inactive channels with no recent posting activity
Candidates flagged by the AI model are rejected before touching the editorial queue, eliminating the bulk of invalid candidate volume.
Stage 2: Human Editorial Review
Surviving candidates pass directly to an internal editorial dashboard. A human reviewer validates channel details, category tagging, and language accuracy before approving the entry for public indexing.

This two-tier structure maintains platform quality at scale:
- Found candidates: ~7,800 channels evaluated daily
- Editorial outcome: ~700 verified channels newly listed per day
Curated Systems Over Black-Box Automation
At WEB3 Build Studio, we design AI pipelines as operational leverage for human operators rather than uncontrolled autonomous publishers. Automation isolates high-quality candidates from high-velocity ingestion streams, while human oversight ensures platform compliance and user trust.
If you are planning a directory, listing site, or Mini App for your niche, WEB3 Build Studio engineers production infrastructure tailored to your business model. We build custom Telegram Mini Apps from $700 and web directories or SaaS MVPs from $2,500, backed by monthly hosting and maintenance on our own servers from $79 to $99 per month. Reach out via our contact form or visit web3buildstudio.com to discuss your product architecture.
Metadata Ingestion Without Bots: Profiles, Avatars, and Resilience
Maintaining structured records across ~47,800 channels without requiring administrative bot access to each channel requires combining multiple data sources with strict write defenses.
Dual Extraction: Public Previews and the Bot API
The ingestion pipeline gathers profile metadata without demanding bot membership in target communities:
- Public Web Previews: Telegram exposes public channel content through standard web previews (
t.me/s/<channel_username>). The worker extracts channel titles, descriptions, member counts, and avatar locations directly from this HTML layer. - Telegram Bot API: Where the directory's bot has direct contact or access, it queries the official
getChatendpoint to retrieve verified channel metadata, member counts, and profile configurations directly.
Image Proxying for Expiring CDN Links
Telegram serves avatar media from temporary CDN URLs that expire after a short time window. Saving raw Telegram media URLs directly to the database causes broken profile pictures across the directory within hours or days.
To ensure visual uptime across both the website and the Telegram Mini App, all avatar traffic passes through an internal image proxy. The ingestion engine retrieves the avatar binary from Telegram, caches it on the studio's self-hosted infrastructure, and serves it through a persistent internal path. If a remote CDN link expires or Telegram rotates a token, the cached asset continues to display seamlessly.
Defensive Database Writes
Scraper runs can encounter rate limits, network timeouts, or partial responses. To keep records stable, the database layer enforces a strict rule: a null, empty, or missing scraper value must never overwrite an established database record.
// Defensive metadata update with Prisma
await prisma.channel.update({
where: { username },
data: {
title: incoming.title?.trim() || existing.title,
description: incoming.description?.trim() ?? existing.description,
memberCount: incoming.memberCount ?? existing.memberCount,
avatarUrl: incoming.avatarUrl ?? existing.avatarUrl,
lastCheckedAt: new Date(),
},
});
If an ingestion cycle fails to parse a channel's member count or description, the record retains its last known valid data instead of overwriting existing fields with null values.
Frictionless Community Ratings: Telegram Identity Without Accounts
Requiring standard email sign-ups, passwords, or third-party OAuth handshakes introduces fatal friction into directory feedback loops. Visitors rarely interrupt their browsing flow to register an account simply to leave a 1-to-5 star rating on a channel.
Within the Mini App environment, the platform leverages Telegram's native cryptographic identity instead of maintaining an isolated user authentication database.
Cryptographic Identity via initData
When a visitor opens Telegram Channels inside Telegram, the client exposes window.Telegram.WebApp.initData. This string contains user metadata—including the Telegram user ID, username, and auth date—along with a cryptographic hash generated by Telegram's infrastructure.
// Server-side HMAC validation of Telegram initData
import crypto from "crypto";
export function verifyTelegramWebAppData(initData: string, botToken: string): boolean {
const params = new URLSearchParams(initData);
const hash = params.get("hash");
params.delete("hash");
const dataCheckString = Array.from(params.entries())
.sort(([a], [b]) => a.localeCompare(b))
.map(([key, val]) => `${key}=${val}`)
.join("\n");
const secretKey = crypto.createHmac("sha256", "WebAppData").update(botToken).digest();
const calculatedHash = crypto.createHmac("sha256", secretKey).update(dataCheckString).digest("hex");
return calculatedHash === hash;
}
The Next.js backend executes this check on every rating submission. The architecture issues no persistent session cookies, JWTs, or tracking records. The API validates the signature, writes the star rating directly to PostgreSQL via Prisma, and terminates the request.

Anti-Skew Constraints and Audit Flags
To maintain rating integrity without introducing captchas or account hurdles, the database enforces strict structural constraints:
- One Rating Per Identity: The database enforces a unique composite constraint on the channel ID and the verified Telegram user ID. Submitting a new vote updates the existing score rather than inflating the vote count.
- Three-Vote Display Threshold: Channel listings suppress the aggregate star average until a channel collects at least three independent ratings. A single rogue 1-star or 5-star review cannot skew public visibility.
- Non-Destructive Velocity Audits: Rating-velocity checks monitor for abnormal patterns, such as sudden bursts in submission speed, clusters of fresh Telegram accounts, or runs of identical scores.
Rather than executing automated deletions or shadowbanning listings, the system files an anomaly report in an internal moderation queue. Human reviewers evaluate the pattern, preventing false positives from disrupting legitimate community engagement while keeping coordinated manipulation off the directory.
Monetisation Mechanics: Telegram Stars and Crypto Placements with Automated Refunds
To monetise directory visibility without degrading browse quality, the platform provides Featured placements across the homepage, category headers, and search highlights. Channel owners purchase these placements through two checkout rails depending on where they access the directory: Telegram Stars inside the Mini App, or cryptocurrency via Heleket on the website.

Dual Rails and Independent Unit Economics
Telegram Stars launched in 2024 (https://www.telegram.org/blog/telegram-stars/?setln=en) as an in-app currency for digital goods in bots and Mini Apps. Instead of calculating Stars dynamically from fiat rates, the directory keeps unit economics strictly decoupled:
- Mini App checkout: Featured tiers carry a fixed price set directly in Telegram Stars.
- Web checkout: Placements carry fixed prices settled in cryptocurrency through Heleket.
Setting the Stars price independently from dollar pricing avoids dynamic conversion estimates, preventing price recalculation shifts during checkout and eliminating rounding mismatches between the client request and server verification.
Transaction Validation via pre_checkout_query
To prevent payment tampering, the backend validates every Stars order before funds change hands. Telegram requires bots to acknowledge a pre_checkout_query within 10 seconds before capturing user balances.
// Verify order integrity before Telegram captures Stars
bot.on('pre_checkout_query', async (ctx) => {
const { id, total_amount, invoice_payload } = ctx.preCheckoutQuery;
const { channelId, tierId } = JSON.parse(invoice_payload);
const expectedStars = await getPlacementTierStars(tierId);
// Reject if the amount sent does not match the configured price
if (total_amount !== expectedStars) {
return ctx.answerPreCheckoutQuery(false, {
error_message: 'Price mismatch. Please re-open checkout.'
});
}
// Confirm order is legitimate to trigger payment capture
await ctx.answerPreCheckoutQuery(true);
});
The server parses the signed invoice_payload, confirms the target channel ID exists in the database, and checks that total_amount matches the tier's designated Stars value. If any value differs, the bot rejects the transaction and Telegram cancels the invoice without deducting funds.
The 30-Day Clock and Automated Refunds
Purchasing a placement does not bypass directory quality standards. Every paid channel still undergoes AI pre-screening and editorial review. To treat channel owners fairly, the system enforces two automated rules:
- Approval-triggered duration: When an owner purchases a Featured slot for an unreviewed channel, the 30-day visibility window does not start at invoice payment. The 30-day countdown triggers only once an editor approves the listing.
- Automated Stars refunds: If human review rejects a paid submission for policy violations, the system automatically calls the Telegram Bot API refund endpoint using the stored transaction identifier. Stars return to the buyer's balance immediately without manual support requests or administrative overhead.
Engineering Integrity and Sister Projects: Measured or Not Shown
Public web directories often pad numbers with simulated counters or generated historical curves to manufacture social proof. On Telegram Channels, every displayed metric follows a strict operational rule: it is either measured directly from real system events, or it is not shown at all.
Verified Signals Over Synthetic Metrics
Visitor metrics in the platform header derive strictly from real incoming HTTP requests processed by the server. To avoid misleading visitors with volatile or statistically insignificant figures, this counter remains hidden until traffic crosses a verified minimum volume threshold. We do not run background increments or pad visitor figures.
The same discipline governs channel performance analytics:
- No historical backfilling: When a channel is approved, historical tracking begins from that exact timestamp forward. Post-view averages and subscriber growth charts display only verified time-series data captured while indexed. We never fabricate retroactive growth curves.
- Zero-data transparency: If a newly listed channel has not accumulated enough daily snapshots to construct an accurate trend line, the analytics section indicates that data collection is underway rather than rendering synthetic trend estimates.
- Filtered tracking: The ingestion pipeline discards web crawlers, duplicate bot hits, and unverified requests before updating public-facing counters.
Replicating the Architecture: Telegram Group Wall
A reliable directory architecture should not be locked to a single product. Because the core ingestion pipeline, screening filters, and Telegram Mini App rendering layer were built as modular services, we deployed the exact same underlying platform to power a sister directory: Telegram Group Wall (telegramgroupwall.com).

While Telegram Channels organizes broadcast feeds, Telegram Group Wall focuses on interactive discussion groups and community hubs. It relies on the identical operational core: automated candidate ingestion, AI pre-screening against prohibited categories, human review queues, and passwordless community ratings authenticated via Telegram WebApp data.
Production Stack and Infrastructure
Both directories run on an identical production stack built for predictable database performance and self-hosted control:
| Layer | Technology | Implementation Detail |
|---|---|---|
| Frontend & SSR | Next.js 14 (App Router), React 18 | Single codebase serving desktop browsers and the Telegram WebView |
| Database & ORM | PostgreSQL, Prisma | Relational schemas for candidate tracking, metrics, and listings |
| Authentication | Auth.js & Telegram HMAC | Secure admin operations alongside cryptographic Mini App user validation |
| Deployment | Coolify on dedicated servers | Self-hosted application management with direct database isolation |
| Integrations | Telegram Bot API & Stars | Automated metadata ingestion, status checks, and Stars payment webhooks |
Building Directory Infrastructure: Costs, Timelines, and Implementation
Building a resilient directory platform requires disciplined architecture: automated ingestion crawlers, multi-stage review queues, unified web and Mini App interfaces, and verified payment gateways. At WEB3 Build Studio, we engineer these platforms end-to-end with fixed-scope pricing and zero agency handoffs.
Fixed Build and Maintenance Pricing
Every project begins with a short scoping call to define data models, screening rules, and monetization flows. Fixed implementation rates include design, full-stack engineering, production deployment, and 30 days of post-launch bug fixes.
| Infrastructure Layer | Starting Price (One-Off) | Monthly Hosting & Care |
|---|---|---|
| Website | From $500 (Standard $700–$1,200) | $49 / month |
| Telegram Mini App | From $700 (Standard $1,000–$1,500) | $79 / month |
| Web App / SaaS MVP | From $2,500 (Standard $4,000–$7,000) | From $99 / month |
| Telegram Bot | From $300 (Standard $500–$900) | $59 / month |
Custom integrations, AI filtering pipelines, and multi-currency payment gateways (such as Telegram Stars or crypto checkout) are scoped based on specific throughput requirements.
Monthly care on the studio's managed infrastructure covers dedicated hosting, daily database backups, automated SSL renewal, uptime monitoring, and routine maintenance updates.
Build Your Infrastructure With WEB3 Build Studio
Whether you are launching a discovery platform, a niche directory, or a dual-interface Telegram Mini App, building robust data ingestion and automated moderation from day one prevents technical debt.
WEB3 Build Studio delivers production-grade systems tailored to your technical requirements. Review our fixed scopes on our pricing page, inspect completed builds under projects, or discuss your architecture directly via our contact form.
Frequently Asked Questions
Can one codebase serve both web users and Telegram Mini App users? Yes. A unified Next.js App Router setup serves desktop and mobile browsers while detecting Telegram's WebView context to adapt layouts and authenticate users server-side via initData.
How does the directory handle rejected paid submissions? For listings submitted with Telegram Stars, rejections trigger an automated refund through the Telegram Bot API, ensuring zero manual accounting overhead.
Frequently asked questions
How do you find new Telegram channels automatically?
Automated discovery relies on parsing public Telegram data and discovery endpoints using background workers. The system monitors public channel posts for forward sources, mentions (@username), and invite links (t.me/...). A crawler queries Telegram's MTProto API or Bot API to fetch metadata, channel bios, and subscriber counts for newly detected handles.
Additionally, the directory can ingest submissions from channel admins directly through a submission form or bot interface. New links enter a processing queue where workers validate channel accessibility, check if the channel is public, and deduplicate handles against existing records in PostgreSQL before indexing.
Why not publish every channel the crawler finds?
Publishing every scraped channel degrades directory quality, search relevance, and indexing performance. Crawlers frequently pick up abandoned channels, bot-driven spam hubs, cloned scam groups, and private or deleted links.
A multi-stage ingestion pipeline filters records before they go live. Filters check for minimum activity thresholds, recent posts, channel age, and complete metadata such as avatars and descriptions. Automated heuristic checks and keyword blocklists flag malicious links or deceptive schemes. Channels that pass verification are categorized into the database, while suspicious or dormant entries are rejected or queued for manual review.
Can one codebase be both a website and a Telegram Mini App?
Yes. A single Next.js and React application can serve both desktop web visitors and mobile Mini App users. The application initializes the Telegram Web App SDK on load to detect its operating context. If the Telegram Web App environment is detected, the UI adapts dynamically—collapsing desktop headers, adjusting viewport heights via viewport CSS variables, and binding interactions to native Telegram controls like the MainButton and BackButton.
When accessed via a standard browser, the app renders regular responsive navigation, headers, and standard web layouts. Both environments share the same TypeScript backend, database models, and API endpoints, eliminating duplicate development work.
How do ratings inside Telegram work without accounts?
Telegram Mini Apps provide authenticated user context without traditional registration or passwords. When a user opens the Mini App, Telegram injects a signed initData string containing the user's unique Telegram ID, name, and a cryptographic hash.
The backend verifies this signature using the directory bot’s API secret key. Once validated, the server uses the verified Telegram user ID as a unique identifier in PostgreSQL. The system records ratings against this ID, preventing duplicate votes per channel while keeping the interaction seamless. Outside Telegram, web users can browse aggregated scores, while write access is restricted or managed via separate verification.
How do Telegram Stars payments and refunds work for a directory?
Telegram Stars allow Mini Apps and bots to accept in-ecosystem payments for digital features, such as sponsored channel listings, premium badges, or priority directory placement. The backend generates an invoice using the Telegram Bot API (createInvoiceLink). When a user checks out, Telegram handles the payment flow natively and sends a pre_checkout_query followed by a successful_payment update to the studio's webhook.
If a purchase requires reversal—for instance, if a listing fails moderation—the platform can trigger an immediate refund programmatically via the Bot API (refundStarPayment) using the associated transaction identifier.
What does it cost to build a directory like this?
Pricing depends on the scope of the infrastructure. At WEB3 Build Studio, a dedicated Telegram Mini App starts at $700 (standard $1,000–$1,500, pro from $2,000), while a full web app or SaaS MVP starts from $2,500 (standard $4,000–$7,000, pro from $9,000). A dual-surface system featuring crawling pipelines, searchable listings, and payment integration is scoped as a custom build.
Every starting price includes design, development, deployment, and 30 days of bug fixes. Optional ongoing hosting and care starts at $79 monthly for Mini Apps and $99 for web apps. Exact fixed-price quotes are provided after a scoping call via /#/contact. Details are on /#/home/pricing.