Takebana — streaming platform

An international site where people and businesses go live, talk to their audience and sell. Nine languages, including Arabic.

RoleSole developer: architecture, backend, frontend and design system, video, calls, AI features, server, SEO, deployment and support
StackNode.js 24 · Express · EJS · MongoDB · Socket.IO · ffmpeg · WebRTC · OpenAI · nginx — no frontend frameworks
Site languages9: English, Russian, Spanish, Portuguese, Turkish, Korean, Chinese, Hindi, Arabic

The code is private: the repository belongs to the client, so there is no GitHub link. How it all works inside is described in the technical part below.

In short — if you are not a developer

What the project is

Takebana is an international site where people and businesses go live, talk to their audience and sell. A blogger streams from a phone, a café shows its hall on a live camera, a shop uploads its catalogue, and a buyer “tries on” an item on their own photo — all in one place and in nine languages.

The project came to me as a prototype — roughly a tenth of what exists now. I took it on my own to a working product with real users: designed and built the core features, put the site on a server, got it into search engines and set it up to run reliably and report its own problems.

What the site does

  • Go live in a minute straight from a phone — no apps to install. Or from studio software when you need several cameras. Followers get a push notification, and the recording saves itself in three qualities — for fast and slow connections alike.
  • Reliable video uploads. Send a large video and move to another page — the upload carries on. If the connection drops, it resumes from the same spot. Subtitles appear automatically.
  • A messenger like the ones people know — read receipts, voice and video notes, disappearing messages, groups, audio and video calls for up to four people.
  • Talking without a shared language. Any message is translated into the reader’s language: a viewer from Brazil writes in the stream chat in Portuguese, a viewer from Korea reads it in Korean.
  • A page for a venue — a café, bar or shop: photos, map, opening hours, ratings, a video menu and a live camera of the hall. The site knows whether the place is open right now by its local time.
  • A product catalogue with AI try-on. The whole catalogue is uploaded from Excel. A buyer sees the item on their own photo, and furniture or decor in a photo of their own room.
  • An admin panel — moderation, users, streams, server load, storage and AI spending by day. It works on a phone too.

What it achieved

  • Fast and usable for everyone. Google Lighthouse on the 29 main pages: 100 out of 100 for accessibility, best practices and SEO, 98 on average for performance — on both phone and desktop. Before my work, mobile performance was 92 and best practices 77.
  • Handles the load. One server holds 60 simultaneous streams, 10,000 viewers of a single stream or 300 calls — tested on the live site, not on paper. After the rework the server carries 15 times more streams than at the start.
  • Works where providers block third-party services: video and calls have fallback routes.
  • Costs under control. A venue camera costs nothing while nobody is watching it. Every dollar spent on AI is accounted for, and models and limits are changed without a programmer.
  • Visible in search on Google, Yandex and Bing in nine languages: every page has its own language version.
  • Reports its own problems. For every person you can see at which step and on which network something failed — issues are found before anyone complains.
  • Safe updates. A new version ships with one button; if something breaks, the site rolls back on its own, and while streams and calls are running the update waits. Daily backups, regularly checked by an actual restore.

In depth — for developers

Stack

  • Server: Node.js 24, Express 4, EJS (server-side rendering), a single process under pm2; MongoDB 7 and Mongoose 9, TTL indexes for logs and telemetry.
  • Real-time: Socket.IO 4 — presence, messaging, stream rooms, call signalling.
  • Video: node-media-server (RTMP ingest), MediaMTX (WHIP ingest), ffmpeg (transcoding, HLS, concatenation, re-encoding), hls.js; in the browser — WebCodecs and Mediabunny.
  • Calls: Daily (WebRTC SFU) and an own WebRTC path through a self-hosted TURN server (coturn).
  • Media and CDN: sharp (WebP, thumbnails, watermark, EXIF stripping, OG cards), Bunny Storage and Pull Zone.
  • AI: OpenAI — translation, speech-to-text, reading text in photos, photo checks, try-on generation; fal — alternative try-on models.
  • Map: MapLibre GL and PMTiles, an own worldwide Protomaps basemap served from our domain.
  • Frontend: 66 own scripts and 31 stylesheets, a design system on CSS tokens; zero frameworks and bundlers, esbuild only minifies on the fly.
  • Infrastructure: Hostinger VPS (4 vCPU), Ubuntu, nginx, Let’s Encrypt, GitHub Actions, Web Push, Resend.

Architecture

  • A monolith in one process. Streams, calls and presence live in process memory — simpler and faster at the current scale. The growth path is written down in advance: the Socket.IO Redis adapter, then separate video ingest servers.
  • Server rendering, no SPA. A page arrives ready and deferred scripts bring it to life. Multi-page navigation is handled everywhere: a video upload survives following links, a call survives a page change.
  • Configuration in the database, not in code. AI models, limits, subtitle modes, watermark placement and spending caps are changed in the panel without a deploy; the server rereads them every minute.
  • External services are optional. Without a key for any provider (Daily, Bunny, OpenAI, fal, Web Push, Resend, Metrica) its feature switches off and disappears from the interface while the rest of the site keeps working. A separate panel tab checks that each key is not just set but actually works.
  • Scale: ≈96k lines of own code (JS ≈66k, CSS ≈18k, EJS ≈9k), 40 Mongoose models, 60+ route files, 131 business-logic modules, 104 templates, 19 runtime npm packages.

Video: streams, recordings, uploads

  • Three inputs into one pipeline: OBS over RTMP; browser streaming through a private Daily room with RTMP output back to our own ingest; venue cameras over WHIP into MediaMTX. From there it is always ffmpeg → HLS on disk → nginx → Bunny CDN.
  • Signed publishing. The stream key is visible to any viewer, so the right to publish comes from a separate expiring signature — nobody can hijack someone else’s stream. Cameras get a one-time key valid for 5 minutes.
  • Browser-stream viewers are not in Daily. They watch HLS through the CDN: a minute of RTMP output for the whole stream costs many times less than paying per viewer-minute.
  • A camera streams only while someone watches. The viewer count comes from the socket room; with no viewers the stream stops. Outbound traffic is one copy per camera, however many people watch.
  • Watermark — a ×15 ceiling. Re-encoding with the watermark in the frame capped 4 cores at 4 streams. Overlaying it in the player for live video and burning it in only for saved recordings raised the ceiling to 60 streams without weakening protection of recordings.
  • Stream recording: ffmpeg writes chunks without a second encode, and at the end they are joined into an MP4 with pauses cut out. In the background — HLS 720p / 480p / 360p, each quality as a single file with byte ranges instead of thousands of segments.
  • Chunked uploads with resume. The file sits in IndexedDB and goes up in chunks; following links does not break the upload, Web Locks stop two tabs uploading the same file, and the server rejects a chunk at the wrong offset.
  • Compression on the phone via WebCodecs down to 720p — uploads are many times faster. We skip it if the gain is under 40% or the codec is unsupported; on any failure the original is sent.
  • Disk protection: file intake stops early while there is still space — a full disk would stop every stream and the database.
  • Fallback route for media. If a provider blocks the CDN, the server swaps the CDN address for its own domain in responses, and the same files arrive directly.

Messenger and calls

  • Messaging on Socket.IO: delivered and read, replies, forwarding, editing, delete for me or for both, mentions, pinning, search, a panel with all files of a conversation.
  • Attachments are checked by content, not by the browser’s type: images → WebP without EXIF and with a watermark, voice notes → AAC (Chrome’s webm does not play on older iPhones), video notes → a 480 px square; HTML and SVG are rejected. Files are served from a separate cookie-less domain.
  • Disappearing messages. Until a message is opened, the browser receives neither its text nor the file address; the file is served through the server without a permanent URL.
  • Calls for up to four people (mesh) over two transports: Daily with private rooms and permissions in the token, and own WebRTC through coturn with temporary credentials (TURN REST API). The own path exists because some providers throttle connections to Daily.
  • A socket drop on a network change does not end a call for 20 seconds; camera, microphone and connection are checked before a call. Sockets are rate-limited with three buckets per connection.

Nine languages and AI translation

  • Server and client dictionaries in 9 languages, ≈2,050 interface strings per language. Arabic is right-to-left, with a mirrored layout and RTL labels on the map.
  • User text is declared as data: “ignore your instructions” gets translated, not executed. Links, emails, @mentions and #hashtags are replaced with placeholders — if a placeholder is lost, the translation is rejected.
  • “Answer in the wrong language” defects are caught and retranslated. Whether translation is needed at all is decided before the call, by detecting the text’s language.
  • Public texts are translated into all languages by a background queue and stored with the text — the same translations serve as language versions of pages for search engines.
  • Subtitles: the main transcription model has no timestamps, so audio is cut at pauses and each chunk becomes its own call and WebVTT lines.
  • Cost tracking: every call is logged with model, tokens and price; daily limits per person and per site, spending by day and by user in the panel.

Venues, catalogue and AI try-on

  • Opening hours are computed in the venue’s own time zone, and the zone is derived from its point on the map.
  • An own map. A worldwide Protomaps basemap (≈69 GB) is cut out of the planet build with range requests and served by nginx from our domain — no third-party tiles and no limits.
  • An own .xlsx parser (zip, zlib and parsing the sheet XML) and .xlsx writer instead of megabyte-sized libraries. Zip-bomb protection, headers in any of the nine languages, a change summary before publishing.
  • Try-on: the photo is checked by a model before generation, so an obviously failed generation is never paid for. Each item type has its own model, chosen in the panel; nine models were compared on my own test bench for quality, time and price.
  • A daily limit per person and a spending cap for the whole site. People’s photos and results live outside the public folder and are served only to their owner.

Security

  • bcrypt and two-stage brute-force protection: after three failures — an invisible proof-of-work in the browser, after five — a growing delay per “account + address” pair, so nobody can lock someone else out.
  • Rate limits on sign-in, registration, attachments, search, views and the geocoder.
  • Search bots are verified by reverse and forward DNS — the user-agent string is not trusted.
  • Daily — private rooms with permissions in the token, RTMP — a signature, MediaMTX — one-time keys, TURN — temporary credentials.
  • Account deletion cascades: files, rooms, an ongoing broadcast, subscriptions, messages. Telemetry stores only the network, not the full IP.

Speed and SEO

  • Lighthouse, 19.11.2026, 29 public pages: Performance 98 on average (mobile 92–100, desktop 94–100); Accessibility, Best Practices and SEO — 100. CLS 0 and 0 ms total blocking time on every page. Before the work, mobile was 92 / 95–99 / 77 / 100.
  • Own fonts with preload and metric-matched fallbacks — no layout shift. The first two images get fetchpriority=high, the rest are lazy.
  • Analytics loads on the person’s first interaction. Its third-party cookies cost 77 in Best Practices, and parsing its response cost about 600 ms of blocking on mobile. I found that in a Chrome trace, not by guessing.
  • Language URLs (/, /ru, /es…) with hreflang and x-default; a four-part sitemap; IndexNow for new and removed pages.
  • JSON-LD: VideoObject with a speech transcript, ProfilePage, SocialMediaPosting, LocalBusiness, Menu, Product, FAQPage; sign-in-gated content is marked up the way Google requires.
  • For an untitled video a model writes a title and description from the transcript — only into meta and markup; the author’s text is never touched.

Quality and operations

  • 182 scenarios in real Chrome via the DevTools Protocol with no dependencies: streams, calls between two browsers with a fake camera, messaging, uploads, translation, try-on, markup, layout at four widths.
  • Deploy on push to main: GitHub Actions logs into the server with a key that can only run the deploy script. On failure — rollback to the previous commit; if streams or calls are running, the deploy waits.
  • Load tested on the live site: separately 60 streams, 10,000 viewers of one stream and 300 calls on 4 vCPU. Messaging hits the ceiling first; the growth path is laid out step by step.
  • Attempt telemetry: every user action — a stream, a call, an upload — is one record with stages, route, outcome, country and provider. Any wait longer than a couple of seconds is explained to the person in words.
  • Daily backups verified by restoring into a separate database and comparing document counts.

What next

Other work is in the portfolio on the home page. If you need a similar site, timelines and price ranges are on the how much a website costs page.