Skip to main content

NexGate Live: revamp requirements

Version: 0.1 ยท Started: 2026-11-23 ยท Status: being discussed with the owner, nothing built from this yet

How live streaming should work after the revamp: what NexGate takes from TikTok, Instagram, YouTube, Twitch and Whatnot, and what is new to NexGate. This is a living document. Every topic we discuss is added here.

The current technical spec is VP_LIVE_SPEC.md (repo root). Where this document disagrees with it, this document wins and the spec is updated when we build.

Marks used

Mark Meaning
โœ… Agreed with the owner
๐ŸŸก Proposed, waiting for the owner's answer
โฌœ Not discussed yet
โŒ Decided against

Rules that apply everywhere

  • The backend decides, the app shows. Lists, order, reasons, which buttons and pills appear all come from the backend. The app never decides.
  • A person is identified only by accountId.
  • Never reshape an existing response. Something new gets a new endpoint or an added optional field.
  • Never reorder a list under the user's thumb. A new order comes on refresh; a card that changes is changed in place.
  • Every live endpoint needs a signed-in account (owner 2026-11-23). Today this already holds for the API (only the SRS hooks are open, checked by a shared secret). The video itself is not protected yet: anyone with the HLS / FLV address can watch. After the revamp, watching needs a short-lived play token from the backend (bound to the account and phone), checked by SRS / the edges when playback starts. The same token gives "one phone per ticket" (ยง7.10).
    • Juma taps a live โ†’ the backend checks signed in, not blocked, valid ticket if needed โ†’ address with a play token (a few minutes to start, bound to his account and phone) โ†’ the edge asks the backend once when playback starts.
    • Ali copies the address to his laptop โŒ: wrong phone, expired.
    • Comments: every request reaches the backend (no shared CDN copy); the list is built once every 2 s and served from memory; checking the token needs no database. Fine for 1,000s; more backend copies at 10,000+.
    • Shared links: someone not signed in sees a preview (title, cover, host, "Sign in to watch"), like any shared post; watching needs signing in.

1. What exists today (2026-11-23)

Area What is there
Kinds Video live and audio radio (radio has a 32 kbps version for slow networks). Spaces moved to chat.
Going live Host creates a stream, gets a secret key, sends video to our media server (SRS). The stream only becomes LIVE when the media server says video arrived.
Who can go live Account at least 3 days old, 18 years or older. No follower minimum.
Watching HLS through the CDN. Delay about 4โ€“10 seconds.
Comments Kept in Redis for 6 hours, never chat messages. App reads them every 2 s; every viewer gets the same list. Host can mute a person and turn on slow mode. 1 comment every 2 s.
Selling Attach products, tickets etc.; pin one; tap โ†’ normal product page โ†’ normal checkout. Taps counted. Orders are not linked to the stream.
Scheduling Book a time; followers told at booking and at start; Remind me; abandoned bookings closed after 24 h. No edit, no cancel, no lists.
Recording / replay Every stream recorded; File Thunder makes a replay; pins replay at the right second. No list of replays anywhere.
Discovery (built 2026-11-21, unpushed) Viewer counts by heartbeat, GET /live/now ranked per person with reasons, cards pop in / out on the feed live channel, author.live ring on posts and clips.
Missing Report a stream, reactions, gifts, guests / co-hosts, battles, moderators chosen by the host, word filter, polls, sales numbers, shop live, never tested on a real phone.

2. Recording and replay

โœ… No recording at all. A live exists only while it is on air.

  • Remove the recording from SRS, the File Thunder replay handoff, and the states PROCESSING, REPLAY_READY and FAILED. A stream goes LIVE โ†’ ENDED and stops there.
  • Why: no disk, no processing load on the box, and nobody could find replays anyway.
  • Cost accepted: a report can only be acted on while the live is on, and seller disputes have no video proof. Automatic pause on reports (ยง10) becomes more important.
  • โœ… When someone reports a stream, keep the last 5 minutes of comments and one picture from the video with the report (ยง10, S1).

3. Where lives appear

3.1 Lives have their own feeds

โœ… The post feed stays posts only. No live cards mixed between posts. Lives get their own feeds:

Live feed What it is Like Backend
Live feed (list) Who is live, ranked for you with a reason on each card; a "Later today" section at the bottom TikTok LIVE tab GET /live/now (exists)
Live swipe Full screen; one live plays; swipe up and the next one plays at once TikTok LIVE swipe new GET /live/swipe, gives the next few in order so the app preloads
Live shopping Only shop lives that are selling, each with its product strip TikTok Shop LIVE, Taobao Live a kind=SHOP filter on the two above, same engine

All three use the same ranking (ยง3.3), the same live events (pop in, ended, counts) and the same rules.

โœ… Live row above the home feed: a few circles of who is live now, above the feed list (like Instagram's stories row). Tapping one opens the live swipe. Only lives that are on now, never scheduled ones.

3.2 Lives in the post feed only through real posts

โœ… A live reaches the post feed only as a real post that the host writes, with the live attached. The post feed treats it like any post.

โœ… A live is an attachment type, not a post type (owner 2026-11-23). Posts today have two types (REGULAR, POLL) and many attachments (products, shops, events, buy-together groups, instalment plans, links). The live joins the attachments, stored like events (post_events โ†’ a post_streams row: postId + streamId).

  • The post stays a normal post: text, photos, products and the live together.
  • One live per post.
  • โœ… Anyone can attach anyone's live (owner 2026-11-23), the same rule as products: anyone shows.
    • Mama Yoyo attaches her own live, or her shop's live โœ…
    • Juma attaches Mama Yoyo's live: "Don't miss this Friday!" โœ…. Remind me on his post joins the same list.
    • Only a scheduled or live stream can be attached, never an ended or cancelled one.
    • Not when either side blocked the other.
  • The attachment's state (scheduled / live / ended / cancelled) is read from the live system when the post is served, never copied into the post.
  • โœ… "Share as a post" is an app shortcut only. The backend has no share-as-post switch: the normal create-post call accepts a live attachment, and the app's button just opens the composer with the live already attached.

The attachment changes by itself:

When The attachment shows Tap
Before (scheduled) ๐Ÿ“… Friday 8 pm ยท ๐Ÿ”” Remind me ยท "120 waiting" joins the same remind-me list
During ๐Ÿ”ด LIVE now ยท 340 watching opens the live
After "Live ended" (+ "Next: Saturday 8 pm" if another is booked) opens the host's profile or shop
Cancelled "This live was cancelled" profile or shop
  • โœ… "Share as a post" when going live now (not scheduled): an app shortcut that opens the composer with the live attached (see above). The app decides where the button sits.
  • โœ… After the live ends the post stays, shows "Live ended", and the feed ranks it lower.

3.2a "Your friends are watching" on every live card

โœ… Owner 2026-11-23. Every live card (the live attached to a post, Live feed, live row, swipe, profile / shop, Live now) can carry who you know is watching right now.

Example. Juma scrolls and sees Mama Yoyo's post with her live attached:

๐Ÿ”ด LIVE ยท Mama Yoyo ยท ๐Ÿ‘€ 410 ยท Josh, Eli and 3 friends are watching

  1. Josh and Eli are Juma's friends and are watching now โœ… โ†’ named (at most 2 names, then "and N friends").
  2. Rose is his friend but turned off "Show when I join a live" (ยง8.3) โŒ โ†’ never named, not counted.
  3. Josh is on screen as a guest โ†’ "Josh is on screen" wins over "watching".
  4. Neema (a stranger to Juma) watching โ†’ not shown to him.
  5. Josh leaves โ†’ the card changes in place within seconds (Centrifugo / the feed live channel), never reordered.

Rules (backend decides)

  • "Friends" = the existing friends rule of the people engine; the backend sends the names already chosen (accountId, name, photo) + a count. The app only shows them.
  • Watching now = the existing heartbeats in Redis, matched with the viewer's friends (cheap set match, no database).
  • Also a ranking reason: friends watching raises the live in Live now (like "following").

3.3 Who gets a live recommended

โœ… Built 2026-11-21 for people (weights out of 100): you follow the host 100 ยท people you may know 70 ยท trending up to 60 (15 ร— log10(1 + watching)) ยท just started (< 10 min) 10 ยท selling live 5. Never: your own live, hosts blocked either way.

โœ… Shop lives add:

Reason Card says Weight
You follow the shop "Duka la Mama is live" 100
You bought from this shop before "You bought here before" 80
It sells things you looked at "Kangas, like you looked at" 50
Friends follow or buy here "Juma + 2 friends follow this shop" 40
Near you, delivers to you "Near you ยท delivery today" 30
Never shops you blocked or hid, shops that don't deliver to you, a shop's live on its own owner's or staff's list โ€”

3.4 The live ring

โœ… Built: author.live on post and clip authors while that person is live.

  • Mama Yoyo (owner) live as her shop โ†’ her own posts get the ring too, and tapping opens the shop's live.
  • Neema (staff) live from the shop terminal โ†’ no ring on Neema's personal posts. The terminal never touches her personal account.

โฌœ Ring on more places (profile, comments, chat lists, contacts, requests, people you may know) and a "๐Ÿ”ด live now: selling this" badge on product, shop and event pages.


4. Scheduling

4.1 Rules

โœ… All agreed 2026-11-23:

  • No private bookings. Every scheduled live is announced to followers. A host who only wants to remember uses their phone's alarm.
  • Book from 15 minutes to 30 days ahead.
  • At most 5 bookings waiting, counted separately for the person and for each shop (Mama Yoyo 5, Duka la Mama 5).
  • At least 2 hours apart for the same person or the same shop.
  • A person can't be booked as herself and as her shop at the same time. A shop has one live at a time, staff bookings included.
  • Edit: time, title, cover, description. Time changes lock 30 minutes before the start.
  • The time can move more than once. Each move sends one message to remind-me people only: "Juma moved his live to Saturday 8 pm". A title or cover change sends nothing.
  • Cancel: the post's attachment shows "cancelled", and remind-me people are told. Followers who didn't tap Remind me are not told.
  • Reminders to remind-me people: 24 hours before and 15 minutes before, and "is live now" at the start. A person is notified at most once per event, however many places they tapped Remind me.
  • โœ… The viewer picks when to be reminded, from a fixed list (owner 2026-11-23). A fixed enum, never a free time, so each reminder is one small row and one job query per choice.
    • โœ… Choices ReminderLead: DAY_BEFORE (24 h) ยท HOUR_BEFORE (1 h) ยท MINUTES_15 ยท AT_START.
    • โœ… A viewer can tick more than one. Default when tapping Remind me: 24 h + 15 min, and AT_START is always on ("is live now" is the point of Remind me).
    • Stored on the existing reminder row as a small set of these values. Times are counted from the stream's current start time, so when the host moves the live, every reminder moves with it.
    • The host's own "get ready" stays fixed at 15 min.
    • Example: Juma taps Remind me โ†’ pills [ 24 h โœ“ ] [ 1 h ] [ 15 min โœ“ ] ยท "and when it starts". He untaps 24 h โ†’ he gets only the 15-minute reminder and "is live now".
  • The host always gets "Your live starts in 15 min ยท get ready".
  • 30 minutes late: cards show "starting soonโ€ฆ". 24 hours with no live: closed quietly (as today).
  • The host sees who tapped Remind me ("120 waiting: Juma, Neemaโ€ฆ"). Viewers see only the number, hidden under 10.
  • Share: Share link (WhatsApp and others) and share into NexGate chats.
  • No repeating schedules. After a live ends, one tap: "Book again next Friday 8 pm?".
  • Lists: "My lives" for the host; "Upcoming" on profile and shop pages; "Later today" on the Live feed (tomorrow's at most 3).

4.2 The journey

Mama Yoyo books a live (5 taps)

  1. Taps ๐Ÿ”ด Go live.
  2. [ ๐Ÿ”ด Now ] [ ๐Ÿ“… Later ] โ†’ Later.
  3. Live as [ Me ] [ ๐Ÿ› Duka la Mama ] ยท title ยท cover ยท [ ๐ŸŽฅ Video ] [ ๐ŸŽ™ Audio ].
  4. When [ Today 8 pm ] [ Tomorrow 8 pm ] [ ๐Ÿ—“ Pick ]. The quick pills follow her habit.
  5. "Followers will be told and can tap Remind me." ยท Also share as a post [ off ]. On โ†’ the post composer opens with her title, cover and the live attached; she taps Post.

Done: "โœ… Booked ยท Friday 8 pm" with [ ๐Ÿ”— Share link ] [ โœ๏ธ Edit ] [ ๐Ÿ“ Post it ].

What happens by itself

When What
Straight away Followers notified; post in the feed with Remind me; "Upcoming" on her profile or shop
Thursday 8 pm Remind-me people: "Mama Yoyo goes live tomorrow at 8 pm"
Friday 7:45 pm Mama Yoyo: "starts in 15 min ยท get ready" (opens the device check with her setup filled in). Remind-me people: "goes live in 15 min"
Friday 8:00 pm She taps Start. Remind-me people: "is live now". The post shows ๐Ÿ”ด LIVE
Friday 9:00 pm She ends. The post shows "Live ended". She gets "Book again next Friday 8 pm?"

Juma (follower): sees the post on Monday โ†’ taps ๐Ÿ”” Remind me โ†’ gets the 24-hour and 15-minute reminders โ†’ gets "is live now" โ†’ taps โ†’ watches.

My lives (profile โ†’ Lives): each booking with [ โœ๏ธ Edit ] [ ๐Ÿ“ Post it ] [ โœ– Cancel ]. "Post it" and "Also share as a post" are app shortcuts to the composer with the live attached; a live can be posted more than once, by anyone.

From the post composer: [ + Live ] โ†’ pick a booking or make one (same When pills) โ†’ attached.

4.3 Learned from others

Instagram TikTok YouTube NexGate
Book ahead 1 h โ€“ 90 days 1 h โ€“ ~10 days any 15 min โ€“ 30 days
Followers find out feed post, story sticker countdown on profile, share in messages "Upcoming" in subscriptions notification, post with the live attached, Upcoming, Later today
Reminders 24 h + 15 min when about to start when live 24 h + 15 min + live now
Edit lock 45 min before โ€” โ€” 30 min before
Host sees who registered โ€” yes โ€” yes

5. Shop live

โœ… "Go live as": Me or my shop. A shop live shows the shop's name and logo; the shop's followers are told; the shop page shows ๐Ÿ”ด LIVE; coupon drops, pins and sales count for the shop.

  • A shop can't hold a phone: a person always presses Go live and talks.
  • โœ… Mama Yoyo's personal followers are not notified when she goes live as the shop. They see her ring if they come across her posts.

5.1 Who can go live for the shop

โœ… The owner, from her own phone, always.

โœ… Staff, only from a shop terminal, never from their personal phone (the team rule: staff work only on shop devices).

  • Staff need both keys: the right "Go live for the shop" given by the owner, and the terminal permission "Go live" set when the device was linked (rights โˆฉ terminal permissions, as for chat and calls).
  • Viewers see "Duka la Mama ยท live" with "hosted by Neema" small underneath. Neema is known from who unlocked the terminal (face or PIN); the activity log records it.
  • Staff can always go live as themselves from their personal phone: a person's live, no shop, no shop tools.

โœ… The app: a separate "NexGate Shop" Android app (the planned Android terminal app, brought forward). Linked by QR, staff unlock with face or PIN. Its first feature is go live; orders, chat and alerts come later.

โฌœ Later, with the desktop terminal: OBS from a shop computer (real camera and lights) using the stream key over RTMP, which SRS already accepts.

5.2 What staff can do while live

โœ…

Neema live for Duka la Mama from the shop tablet
Pin and show products โœ…
Drop a coupon the owner prepared ("Live drops: 2,000 off, 20 people, budget 100,000") โœ…
Create a new coupon or change a discount โŒ owner only
Start a group buy at the product's group price โœ…
Lower the group price, "give everyone the group price" โŒ owner only
Mute people, slow mode โœ…
Hand over to Ali without ending the live (shift change) โœ… if Ali is also allowed

Separate right "Use prepared live drops", so a staff member can host without dropping coupons. The owner can step in from her own phone while staff are live: drop or create coupons, pin products, without being on camera.

5.3 One at a time

โœ… One live per person, one live per shop, at the same time.

Case
Mama Yoyo live as herself and as Duka la Mama at once โŒ
Mama Yoyo live as herself, Neema live as Duka la Mama โœ…
Neema and Ali both live as Duka la Mama โŒ "Duka la Mama is already live (Neema)"
Branches live at once (Kariakoo + Mwenge) โŒ for now

5.4 Why the shop must own its live

In China, more than half of Taobao Live's sales now come from store-run lives (the shop's own hosts in turns), because brands that relied on star hosts lost their audience when the star left. Lesson: the shop owns the device, the audience and the live, whoever holds the phone.


6. Showing and selling products

โœ… Anyone shows, only the shop sells.

Who Product Show it (pin, tap โ†’ product page โ†’ normal checkout) Live tools (coupon drop, group buy, auction, bargain)
Juma (no shop) Mama Yoyo's kanga โœ… card says "from Duka la Mama" โŒ
Mama Yoyo (co-host) her own kanga โœ… โœ… from her side of the live
Juma Neema's shoes โœ… "from Neema Shoes" โŒ
  • Showing = discovery, as for posts today. The buyer pays the normal price; the shop gets a normal sale.
  • Live tools = money promises: only that shop's owner (or allowed staff, ยง5.2) while in the live as host or co-host.
  • A co-host brings their own shop and its tools. That is how several sellers share one live.
  • Every pinned product that isn't the host's own says "from ".
  • โœ… Shop setting "Others can pin my products in their lives", on by default.
  • โŒ Affiliate share (a host without a shop earns a % of another shop's sale): not now. Later only if the shop turns it on.

7. Money and selling tools

The owner likes all nine first ideas (โœ… 2026-11-23). On 2026-11-23 the list was widened to every money tool, to be checked one after another. Data saver moved to ยง9 (speed): it is not a money tool. Shop live is ยง5.

โœ… Every tool works for both products and event tickets (owner 2026-11-23), except instalments: products only. Free delivery has no meaning for a ticket (nothing is delivered), so it is products only too (โœ… confirmed, ยง7.4).

# Tool What it is Products Event tickets Builds on Status
M1 Live coupon drop first N watching grab a coupon โœ… โœ… organiser drops ticket coupons coupons โœ… ยง7.1
M2 Live group buy "6 of 10", price drops when full โœ… โœ… group tickets group purchase, ticket groups โœ… ยง7.2 (tickets included)
M3 Sales numbers after the live "You sold 14 kangas, 230,000 TZS" / "You sold 40 tickets" โœ… โœ… orders, tickets โœ… ยง7.3
M4 Free delivery during the live "Free delivery on orders from this live" โœ… โž– nothing to deliver shipping campaigns โœ… ยง7.4
M5 Flash price the price drops for N minutes, for people watching โœ… โœ… products, ticket types โœ… ยง7.5
M6 Bargain live a viewer sends an offer, the host accepts it on screen โœ… โœ… chat offers โœ… ยง7.6
M7 Live auction bids with a countdown, the winner's money held in the wallet โœ… โœ… (e.g. a VIP table) wallet, escrow โœ… ยง7.8
M8 Instalments on the live "Pay in 3" pinned next to the product โœ… โŒ products only instalment plans โœ… ยง7.7
M9 Live gifts viewers send animated gifts that land in the host's gift balance host, not a product host, not a ticket wallet, ledger โœ… ยง7.9
M11 Ticket live sell event tickets during a live; a paid-only stream for ticket holders โž– โœ… event tickets โœ… ยง7.10
M12 Paid live pay to watch (a class, a show) for people without an event โž– โž– wallet โŒ not needed (owner 2026-11-23); an online event with NexGate Live (ยง7.10) covers it

โŒ Not now (owner 2026-11-23): M10 paid comments, M13 fan subscriptions, M14 giveaway.

Note: the existing "no commission" rule is about riders only. Live gifts: no platform cut for now (ยง7.9).

7.1 Live coupon drop

โœ… Agreed 2026-11-23.

Example. Mama Yoyo is live, 300 watching.

  1. She taps Drop coupon: "2,000 off ยท 20 people ยท 60 seconds" (a coupon she made before, or a new one on the spot).
  2. Everyone watching sees "๐ŸŽŸ๏ธ 2,000 off ยท 20 left ยท 0:59", counting down live.
  3. Juma taps Grab โœ… โ†’ it lands in My coupons.
  4. Neema taps after all 20 are gone โŒ "All taken. Stay for the next drop!"
  5. Ali has the code from a WhatsApp screenshot but isn't watching โŒ.

Rules

  • First N to grab (not to buy).
  • How long a grabbed coupon can be used: the shop owner picks at drop time from a fixed list 1 h ยท 6 h ยท 24 h (default) ยท 3 days ยท 7 days, counted from the grab, never past the coupon's own end date (ticket coupons never past the end of ticket sales). Grabbed coupons are never shortened; a new drop can use a new time.
  • One reminder before a grabbed coupon ends: "Your 2,000 off ends in 1 hour" (15 min for a 1 h coupon).
  • The host chooses what it covers; default the whole shop.
  • Who drops: the shop owner (staff only prepared drops, ยง5.2). For events, the organiser drops ticket coupons. A host with no shop can't drop.
  • Who can grab: accounts at least 3 days old that have watched for at least 30 seconds.
  • The shop pays, from its spending limit, as shop coupons do today.
  • Switch "Only people watching can grab", on by default, on the coupon itself and at drop time. Off = a normal coupon announced live (the code works anywhere).
  • New in coupons: a limit on how many can grab (today coupons only limit uses), the drop card, the countdown, "only people watching".

Editing a drop

While it runs
Add more people (20 โ†’ 30) โœ…
Add more time โœ…
Stop early (grabbed coupons stay) โœ…
Lower the discount โŒ
Change what it covers or the minimum order โŒ
Go below the number already grabbed โŒ
After it ends
Restart the same drop โŒ drop a new one (one tap, last settings filled in)
Take back or shorten grabbed coupons โŒ

7.2 Live group buy

โœ… Agreed 2026-11-23.

Today: a product can have group buying on (group price, number of people, time limit in hours). A buyer starts a group; others join by paying at checkout (money waits in escrow); full โ†’ orders created; time out โ†’ everyone refunded. One price only.

Example. Mama Yoyo is live with a kanga: 25,000 normally, 20,000 in a group of 10.

  1. She taps Start group buy on the pinned kanga.
  2. Everyone watching sees "๐Ÿ‘ฅ Group 20,000 ยท 6 of 10 ยท 0:09:59".
  3. Juma taps Join โ†’ normal checkout โ†’ 7 of 10 for everyone; "Juma joined ๐ŸŽ‰" shows briefly.
  4. 10 reached โ†’ "Group done!", orders made. Time out at 8 of 10 โ†’ refunds (as today), unless the host gives it through.

Rules

  1. The host starts it (one group for the whole live, not many small ones).
  2. The host picks the time (5, 10, 30 min); it can stay open at most 30 minutes after the live ends.
  3. Switch "Only people watching can join", on by default.
  4. "Give everyone the group price": the host completes it early with fewer people.
  5. One price, no steps ("5 people โ†’ 22,000, 10 โ†’ 20,000") for now.
  6. While running: add time โœ…, lower the price โœ…, give it through early โœ…; raise the price โŒ, raise the number of people โŒ.

Tickets (โœ… agreed 2026-11-23): ticket types already have groups (a buyer starts one, seats, per-seat escrow, refund on time out). In the live, the same rules as products, with seats:

  • DJ Mike starts "๐Ÿ‘ฅ VIP 40,000 ยท 3 of 10 seats ยท 9:59" on the pinned VIP ticket; the organiser starts it without buying a seat; full โ†’ all get VIP tickets; time out โ†’ refunds, unless he gives it through.
  • Never after the event starts or ticket sales close: the group ends at that moment.
  • One group per ticket type per live; one deal per ticket type at a time; no coupon on top.
  • One person can buy several seats, up to the ticket type's "max per person".
  • (Products too: in a live the host starts the group without buying.)

7.3 Sales numbers after the live

โœ… Agreed 2026-11-23.

Today: an order's "source" says how it was bought (buy now, cart, instalment, group, chat offer), not where it was found. No order or ticket knows about a live.

How a purchase is linked to a live (example)

  1. Mama Yoyo is live. Juma taps the pinned kanga โ†’ the product page opens carrying "from Mama Yoyo's live".
  2. He buys now โœ…, tonight from his cart โœ…, tomorrow morning โœ…: counted, within 24 hours of his tap.
  3. He buys 3 days later โŒ: no longer the live's sale.
  4. He taps the kanga in Mama Yoyo's live, then in Neema's live, and buys โœ…: counted for Neema's (the last live tapped wins).
  5. A coupon grabbed in the live or a group buy started in the live โœ…: always linked, no tap needed.
  6. Tickets the same: Juma taps the pinned ticket and buys โ†’ counted for the live.

What the host sees

  • Right after ending (end screen + a notification): length, peak watching, people who watched, new followers, orders and money paid, coupon drop (grabbed โ†’ used), group buy (joined of needed), best product (taps โ†’ orders).
  • Later in My lives โ†’ that live: the same, plus refunds subtracted once they happen ("2 refunded, 200,000 net").
  • Money is counted when paid, at once; the net after refunds follows later.
  • During the live, the host only: "5 orders so far" (counts, no money).

Who sees what

Case Sees
Juma pins Mama Yoyo's kanga in his live Juma: "30 taps โ†’ 4 orders", no money (not his sale)
Same Mama Yoyo: "4 orders came from Juma's live" in her shop reports
Neema hosts the shop live from the terminal Owner: everything, money included. Neema: counts only, no money (team rule)

Backend: one shared sale origins table for the whole platform (live is only the first user), see ยง13.6. Taps are counted separately from orders (a counter during the live, totals saved in the live summary).

7.4 Free delivery during the live

โœ… Agreed 2026-11-23. Products only (tickets have nothing to deliver).

Today: a shop can run a delivery campaign (free / percentage / fixed off, a cap per order, areas, paid from its spending limit). M4 is that campaign tied to one live.

Example. Mama Yoyo is live.

  1. She taps Free delivery: free or half off, a cap (up to 5,000 per order), areas (Dar only or everywhere).
  2. Everyone watching sees "๐Ÿšš Free delivery on orders from this live".
  3. Juma taps the kanga in the live and buys โœ… โ†’ free delivery.
  4. Ali opens her shop the normal way and buys โŒ โ†’ normal delivery.
  5. Juma buys tomorrow morning, within 24 h of his tap โœ… (the same "from live" link as ยง7.3).

Rules

  • Only orders from the live (ยง7.3 link), not the whole shop.
  • The owner starts it; staff only start ones the owner prepared (as coupon drops).
  • For people who tapped, it lasts 24 h after their tap, like the sale link, even after the live ends.
  • The shop pays, within the cap and its spending limit, as campaigns today.

7.5 Flash price

โœ… Agreed 2026-11-23. Products and ticket types.

Example. Mama Yoyo pins the kanga (25,000).

  1. She taps Flash price: 18,000 for 5 minutes, only 10 pieces at that price.
  2. Everyone watching sees "โšก 18,000 (was 25,000) ยท 7 left ยท 4:59".
  3. Juma taps Buy at 4:30, pays at 4:45 โœ… 18,000.
  4. Neema starts checkout at 4:58, pays at 5:20 โœ… 18,000 (10 minutes to pay once checkout started).
  5. Ali taps after the 10 are gone โŒ "Sold out at flash price, still 25,000."
  6. Timer ends โ†’ back to 25,000 for everyone.
  7. Tickets the same: the organiser sets "VIP 50,000 โ†’ 40,000 for 5 min, 20 tickets".

Rules

  • Time from a fixed list: 1 ยท 3 ยท 5 ยท 10 minutes; piece limit optional.
  • Switch "Only people watching can buy", on by default, set when starting it (as the coupon drop and group buy). Off = the flash price works for anyone during those minutes (shop page, product page), announced in the live.
  • No coupon on top of a flash price.
  • One deal per product at a time (no flash price and group buy together on the same product).
  • Starting checkout holds the piece for 10 minutes; not paid โ†’ it goes back to the flash pieces.
  • While it runs: lower the price more โœ…, add pieces โœ…, stop early โœ…; raise the price โŒ.
  • The owner starts it; staff only start ones the owner prepared.

Sizes and colours (today a product has one stock number for all; colours may have a price difference; sizes are only details; each ticket type has its own price and count)

  • The flash price takes the same amount off every colour: kanga 25,000 โ†’ 18,000 (7,000 off); gold (+2,000) 27,000 โ†’ 20,000.
  • The piece limit counts all sizes and colours together (red M and gold L both count in the same 10).
  • A flash price on one colour only โŒ not now (needs stock per colour / size first).
  • Tickets: one flash price per ticket type (VIP 40,000 doesn't touch Regular); one deal at a time per type.
  • The buyer picks size and colour at checkout as usual; the 10-minute hold keeps one flash piece whatever they pick.

7.6 Bargain live

โœ… Agreed 2026-11-23. Products; ticket types too (off by default).

Today: chat offers: a seller sends one person a special price in chat, it's paid at checkout and expires by itself. In the live it goes the other way: the viewer offers, the host answers on screen; an accepted price becomes the same kind of personal offer, so checkout already works.

Example. Mama Yoyo pins a handbag (60,000) and turns on Bargain.

  1. Juma taps Make an offer: 45,000.
  2. Her screen lists: "Juma 45,000 ยท Neema 50,000 ยท Ali 30,000".
  3. Everyone watching briefly sees "๐Ÿ’ฌ Juma offered 45,000".
  4. She taps Counter 52,000 โ†’ Juma sees [Accept] [No]; he accepts โ†’ 15 minutes to pay, for him only โœ….
  5. She accepts Neema's 50,000 โœ… โ†’ 15 minutes to pay.
  6. She says No to Ali's 30,000 โŒ โ†’ "Not this time".
  7. The live ends with offers unanswered โ†’ closed quietly.

Rules

  • Optional lowest price, hidden ("never below 40,000"): lower offers refused at once.
  • No auto-accept for now; the host decides live.
  • Everyone watching sees offers; refused ones without the amount.
  • One open offer per person per product; at most 3 tries per product per live; account 3 days old and watched 30 s.
  • 15 minutes to pay after accepting, then it closes and the piece goes back.
  • One piece per offer for now.
  • Sizes and colours as in the flash price: the buyer picks at checkout; a dearer colour keeps its difference.
  • Tickets: the organiser can turn bargaining on per ticket type, off by default.
  • Only the owner turns it on; no coupon on top; one deal per product at a time.

7.7 Instalments on the live

โœ… Agreed 2026-11-23. Products only.

Today: a shop attaches instalment plans to a product (number of payments, weekly / monthly, optional interest, minimum down payment, ship after the first payment or only after the last).

Example. Mama Yoyo pins a sofa (300,000) with a "Pay in 3 months" plan.

  1. The pinned card shows by itself "300,000 ยท or Pay in 3 ยท 100,000 now".
  2. Juma taps Pay in 3 โ†’ the normal instalment checkout โœ…, counted as a sale from the live (ยง7.3).
  3. The kanga has no plan โ†’ no "Pay in 3".

Rules

  • The card shows the product's existing plans; no new live tool.
  • A live-only special (0% interest, lower down payment) โŒ later.
  • Flash or bargain price in instalments โŒ for now (one deal at a time; the flash card shows no "Pay in 3").
  • Group buy with instalments โŒ (group buys pay in full, as today).
  • Sales numbers show both: "2 on instalments: 200,000 paid now of 600,000".
  • Check first: a cancelled instalment order really puts the stock back (open backlog item).

7.8 Live auction

โœ… Agreed 2026-11-23. Products and tickets.

Today: wallet payments and escrow exist; there is no "hold" on a wallet, so the current top bid waits in escrow and goes back the moment someone bids higher.

Example. Mama Yoyo pins a vintage watch: start 20,000, steps of 1,000, 60 seconds.

  1. Everyone watching sees "๐Ÿ”จ Watch ยท 20,000 ยท 0:59 ยท [Bid 21,000]".
  2. Juma bids 21,000 โ†’ the backend checks his wallet and puts 21,000 in escrow โœ….
  3. Neema bids 22,000 โ†’ hers in escrow, Juma's 21,000 back to his wallet at once โœ….
  4. Ali has 10,000 โ†’ "Top up to bid" โŒ.
  5. Juma bids 25,000 with 5 s left โ†’ the timer goes back to 10 s.
  6. Time ends โ†’ "Juma wins at 25,000 ๐ŸŽ‰" โ†’ his order is made from the held money; he picks delivery or pickup.

Rules

  • Only the top bid is held; outbid = money back at once.
  • Optional hidden lowest price; not reached โ†’ no winner, money back; viewers see "lowest price not reached yet".
  • Times from a fixed list 30 s ยท 1 ยท 3 ยท 5 min; a bid in the last 10 s puts the timer back to 10 s.
  • Steps from a fixed list 500 ยท 1,000 ยท 5,000 ยท 10,000; one-tap bid buttons, no typing.
  • Switch "Only people watching can bid", on by default; account 3 days old and watched 30 s.
  • One piece per auction.
  • Tickets: the winner gets a ticket ("VIP table for 10").
  • No backing out after winning; the host can cancel before the end (all money back); after the end it is a normal paid order with normal refund rules.
  • The live ends mid-auction โ†’ the auction finishes on its own timer, the winner still wins.
  • Only the owner starts it; no coupon on top; one deal per product at a time.

7.9 Live gifts

โœ… Agreed 2026-11-23. Called just gifts in the app (the earlier idea "Shangwe" dropped); in the backend its own type (live gift), never mixed up with gift cards.

Example. Juma is singing live.

  1. Neema taps ๐ŸŽ โ†’ ๐Ÿ”ฅ Fire ยท 1,000 TZS, paid from her wallet in one tap.
  2. Everyone watching sees the fire animation and "Neema sent ๐Ÿ”ฅ".
  3. Juma's gift balance goes up 1,000 โœ… ("Neema sent you a gift โ†’ in your gift balance").
  4. Next week he buys a kanga for 25,000: 1,000 from gift balance, 24,000 from his wallet โœ… (as gift cards today).
  5. He tries to withdraw the 1,000 to M-Pesa โŒ: gift balance never goes out.
  6. Neema tries to pay a gift from her gift balance โŒ: "gift balance can't buy gifts" (existing rule).
  7. Top of the screen: "Top fans: Neema 6,000 ยท Ali 2,000"; after the live: "38 gifts ยท 54,000 TZS".

Rules

  • Paid from the wallet only, in TZS, no coins.
  • Lands in the host's gift balance (spend only, never withdrawn, never transferred, never expires).
  • Later, if creators ask: hosts who verify their identity can move gift earnings into their wallet, with a waiting period against fraud.
  • No platform cut for now: 100% to the host. โš ๏ธ Before building, check the current Apple and Google store rules.
  • Personal live โ†’ the host's gift balance. Shop live โ†’ the shop (owner); staff never see the money. Off for shop lives by default, the owner can turn it on.
  • Giver's account at least 3 days old; daily giving limit 100,000 TZS; never given back once sent.

The gift list is made by admin, only for lives:

  • Each item: key (fixed, e.g. fire), name, icon, price, order on the list, on / off.
  • The live event carries the key; the app plays the animation for that key.
  • A key the app doesn't know yet (admin added drum, the phone has an old app): the event also carries the icon, the app shows a simple fly-up of it. Admin can add gifts any time without an app release.
  • Never deleted, only turned off; each send keeps the price paid at that moment.

7.10 Ticket live

โœ… Agreed 2026-11-23.

Today: events are in person, online or hybrid; an online event only holds a typed meeting link (Zoom etc.); ticket types can be marked online; tickets already have group buying.

A. Selling tickets in a live (already covered): the organiser pins a ticket type and can use flash price, bargain, auction, coupon drop and group buy on it. DJ Mike pins "VIP ยท 50,000" two days before his show, runs "VIP 40,000 for 5 min", Juma buys โ†’ counted for the live (ยง7.3).

B. A live only ticket holders can watch (new): for online and hybrid events NexGate Live replaces the meeting link.

Example. Neema runs an online "Business class: selling on Instagram", 10,000, Saturday 10:00.

  1. On the event she picks "Stream on NexGate Live" instead of a meeting link โ†’ a live is booked automatically for Saturday 10:00 (as her or her shop).
  2. Juma buys an online ticket โ†’ 09:45 "Your class starts in 15 min" โœ… (the ticket counts as Remind me).
  3. 10:00 he opens it and watches โœ… โ†’ counted as his check-in.
  4. Ali has no ticket โ†’ ๐Ÿ”’ in the live feeds, "Buy ticket to watch" โ†’ buys โ†’ in within seconds โœ….
  5. Juma's brother logs in on another phone โŒ "Already playing on another device" (one phone per ticket).
  6. Comments and gifts only from ticket holders.
  7. Watch later โŒ: no recording; the ticket says "Live only, no replay".

Rules

  • "Stream on NexGate Live" is a choice on online / hybrid events next to the meeting link; the live is booked from the event time.
  • Watching = check-in for online tickets.
  • No free preview: lock + "Buy ticket to watch".
  • One phone at a time per ticket.
  • Shown in the live feeds with the lock; only ticket holders can open it.
  • Event moved or cancelled โ†’ the live moves or is cancelled with it (ticket holders get the existing messages).
  • Hybrid: only online tickets can watch the stream.

8. Taking part

โœ… Owner 2026-11-23: T1โ€“T6 are needed; T7 battles and T8 not. Discussed one by one below.

# Idea What it is Status
T1 Guests and co-hosts others on screen with the host (split screen); co-hosts bring their own shop and tools (ยง6) โœ… ยง8.1
T2 Reactions (YouTube style) tap an emoji, it floats up for everyone, no names, no counts โœ… ยง8.2
T3 "Juma joined" a short line when someone arrives โœ… ยง8.3
T4 Who's watching a viewer list โœ… ยง8.4
T5 Polls "Red or blue kanga?" with live results โœ… ยง8.5
T6 Questions viewers send questions, the host pins one on screen โœ… ยง8.6
T7 Battles two hosts on split screen, gifts decide the winner โŒ not needed (owner 2026-11-23)
T8 Send viewers on when ending, send everyone to a friend's live โŒ not needed

8.1 Guests and co-hosts

โœ… Agreed 2026-11-23.

  • Guest: joins for a while (a viewer asking on camera), then leaves. Co-host: sells with the host for the whole live with their own shop and tools (ยง6).

Example. Mama Yoyo is live.

  1. Juma taps Ask to join (video or voice only) โ†’ "Juma wants to join ยท [Accept] [No]".
  2. She accepts โ†’ the screen splits Mama Yoyo | Juma; everyone watching sees both โœ….
  3. She taps Remove โ†’ Juma is back to watching โœ…. Juma can also leave by himself.
  4. She invites Neema (Neema Fashions) as co-host โ†’ both pin their own products, Neema runs her own coupon drop โœ….
  5. Ali, whom Neema has blocked, asks to join โŒ (blocks of anyone on screen apply).
  6. Mama Yoyo ends the live โ†’ it ends for everyone.

Rules

  • Seats decided by the backend: up to 5 guests and co-hosts per live (host + 5 = 6 on screen); each live gets a "seats now" number from the backend, 3 for now (host + 2), less for a weak phone. Raising it needs no app update.
  • Guests: request (host accepts) or invite; co-hosts: invite only; accounts at least 3 days old.
  • Voice-only guests allowed in video lives; radio lives: voice only.
  • Host tools: accept ยท ignore ยท remove ยท block from asking again in this live ยท turn requests off.
  • The host is responsible for what happens in their live (as YouTube); fast tools matter.

When the screen is full: invites and requests can always be sent; the seat is checked when someone goes on screen. Mama Yoyo has 3 seats, Juma and Neema are on (full).

  1. She invites Ali โœ… โ†’ her screen: "Full ยท remove someone to bring Ali in".
  2. Ali taps Join while full โŒ "Mama Yoyo's screen is full"; his invite stays open.
  3. She removes Juma โ†’ Ali gets "A seat is free ยท Join now" โœ….
  4. Ali and Rose tap Join at the same moment for the last seat โ†’ only one gets it (seat taken in one safe step); the other โŒ "Screen is full".
  5. Zawadi asks to join while full โœ… โ†’ waits in the list; the host's Accept is greyed ("Full") until a seat frees.
  • The invited person is in their own live โŒ "End your live to join Mama Yoyo's" (one live per person).
  • Invites expire after 5 minutes or when the live ends.
  • When a seat frees, only invited people are told; requests stay in the host's list and the host picks.
  • Co-hosts and guests use the same seats.

Compared with others

TikTok Instagram YouTube NexGate
On screen host + 5 host + 3 host + 1 host + 5 allowed, host + 2 for now (backend decides)
Getting in request (video or voice) โ†’ host accepts request or host invites host's invite link, waiting room request or invite; co-host invite only
Voice only โœ… โŒ โŒ โœ… (radio: always)
Blocks โ€” anyone blocked by anyone on screen can't join โ€” same as Instagram
Host tools accept, ignore, block, remove, layout add, remove swap guest accept, ignore, remove, block for this live, requests off
Who's responsible โ€” โ€” the host the host
Who makes the picture phone, server for weak phones โ€” โ€” the host's phone (server for weak phones later)

How the picture is made: on the host's phone, not the server. Mixing one live with guests on the server takes about 3โ€“4 CPU cores (LiveKit's own numbers); our box shows about 4. So:

  1. Host and guests connect through LiveKit, which only passes their video between them (cheap).
  2. The host's phone draws the guests next to its own camera.
  3. It sends one mixed picture to SRS, as today; viewers watch as today.
  • The backend tells each phone how many guests it can take (weak phone โ†’ 1).
  • Later, when we have more servers: mix on the server only for phones that are too weak (ByteDance's own approach: client mixing when the phone and network are good enough, server mixing otherwise).

8.2 Reactions (the YouTube way)

โœ… Agreed 2026-11-23 (owner: copy YouTube).

Example. Mama Yoyo shows a new kanga.

  1. Juma taps ๐Ÿ˜ โ†’ it floats up the side for everyone โœ….
  2. 50 people tap ๐Ÿ”ฅ at once โ†’ the side fills with ๐Ÿ”ฅ โœ…; she sees "they love this one".
  3. She makes a joke โ†’ ๐Ÿ˜‚ everywhere.
  4. No names, no counts on screen.
  5. After the live, the host only: "2.1K reactions ยท most ๐Ÿ”ฅ".

Rules

  • A reactions button opens a row: โค๏ธ ๐Ÿ˜‚ ๐Ÿ”ฅ ๐Ÿ˜ ๐Ÿ‘, a fixed list in the backend (LiveReaction).
  • Viewers see no counts; the host sees totals after the live.
  • Reactions push the live up in Trending a little.
  • Radio lives too (emoji float over the radio picture).
  • Light on the backend: the phone counts taps and sends one message every few seconds ("๐Ÿ”ฅ ร—12, ๐Ÿ˜‚ ร—3"); one Redis counter per emoji, no row per reaction; everyone gets the mix for the last 2 s with the comments; at most 15 a second per person counted.
TikTok Instagram YouTube NexGate
How tap the screen anywhere heart button reactions button reactions button (YouTube)
Kinds hearts hearts โค๏ธ ๐Ÿ˜‚ ๐ŸŽ‰ ๐Ÿ˜ฎ ๐Ÿ’ฏ โค๏ธ ๐Ÿ˜‚ ๐Ÿ”ฅ ๐Ÿ˜ ๐Ÿ‘
Names shown โ€” โ€” โŒ โŒ
Count shown โœ… to everyone โŒ โŒ โŒ (host after the live)
Used for ranking โœ… โ€” โ€” โœ… a little

8.3 "Juma joined"

โœ… Agreed 2026-11-23. The app decides how joins look; the backend delivers the right joins with the right facts.

Every 2 s, with the comments:

Field Example Why
who Juma's accountId, name, photo "Juma joined"
hostFollows true Mama Yoyo knows him
topFan rank 1 the app can make a bigger entrance
friendOfYou true (for this viewer) "your friend Juma joined"
joinedCount 43 in the last 2 s "+43 joined" in busy rooms

Rules (backend)

  • At most 10 joins per 2 s, most important first (top fans, people the host follows, friends), plus the count.
  • Switch "Show when I join a live", on by default; off โ†’ the name is never sent, only counted.
  • Top fan rank = gifts in this host's lives over the last 30 days.
  • Joins come from the existing heartbeats; no new messages from phones. Shop lives the same.
TikTok Instagram YouTube NexGate
Shows joins โœ… line at the bottom โœ… in comments โŒ โœ… (app decides the look)
Big rooms flies past; big entrance for top fans lost in comments โ€” 10 most important per 2 s + "+N joined"
Hide my join โœ… โ€” โ€” โœ… switch, on by default

8.4 Who's watching, and how people get on screen

โœ… Agreed 2026-11-23.

What the backend delivers

  • Everyone: the viewer count (exists) and the top 3 fans (gift givers).
  • Host and co-hosts: the full list, page by page: name, photo, watching for, follows you, top fan, ๐Ÿ› bought in this live (ยง7.3 link). Order: top fans โ†’ people the host follows โ†’ newest. From the existing heartbeats in Redis; nothing new stored.
  • Staff hosting a shop live: the list with names; never money ("bought" is only a mark).
  • Someone who turned off "Show when I join" still appears in the host's list (only the joined line is hidden).
  • Host actions from the list: invite to join ยท mute ยท remove from live (can't come back to this live).

Example. Mama Yoyo, 300 watching.

  1. Juma (viewer) taps ๐Ÿ‘€ โ†’ "300 watching ยท Top fans: Neema, Ali, Rose"; no full list.
  2. Mama Yoyo taps ๐Ÿ‘€ โ†’ the full list with [Invite to join] [Mute] [Remove from live]; "๐Ÿ› bought" next to Zawadi.

Three ways onto the screen (viewers only ever ask; only the host invites)

Tab Who's in it For
Requests viewers who tapped Ask to join guests
Watching the viewer list above guests or co-hosts already watching
Invite search with suggestions: people she follows, friends, past co-hosts mostly co-hosts who aren't watching
  • Neema (not watching) gets a notification "Mama Yoyo invites you to co-host her live" [Join] โ†’ opens the live โ†’ on screen (seat checked then, ยง8.1); the invite expires in 5 minutes.
  • Invites from search only to people connected to the host (she follows them or they follow her); blocks apply.
  • Switch "Allow live invites", on by default; off โ†’ nobody can invite her.
TikTok Instagram YouTube NexGate
Viewer count everyone everyone everyone everyone
Viewer list top viewers to everyone, host more host nobody top 3 fans to everyone, full list to host / co-hosts
Invite from requests, viewers, search requests, search invite link requests, watching, search (connected people only)
Turn off invites โœ… โœ… โ€” โœ… "Allow live invites"

8.5 Polls

โœ… Agreed 2026-11-23. Separate from post polls: short, in Redis like comments; the final result kept in the live summary.

Example. Mama Yoyo is live.

  1. Poll: "Which colour next week?" Red ยท Blue ยท Gold, 2 minutes.
  2. Everyone sees the card; Juma taps Blue โœ… (one vote, no changing).
  3. Live results for everyone: Red 30% ยท Blue 55% ยท Gold 15%.
  4. Timer ends โ†’ "Blue wins! ๐Ÿ’™" (or she ends it early).
  5. Product options: "Which kanga do you want?" with three pinned kangas โ†’ Buy on the winner โœ….
  6. Summary: "Poll: 180 votes, Blue 55%".

Rules

  • Made by the host and co-hosts; staff hosting a shop live too (no money involved).
  • 2โ€“4 options; timer 1 ยท 2 ยท 5 min or until ended.
  • One vote each, no changing; voter names hidden from everyone, host included.
  • One poll at a time.
  • Anyone watching can vote (no 3-day rule; that is for money tools).
TikTok YouTube Instagram NexGate
Who makes it host, moderators host, moderators no live polls host, co-hosts, staff host
Options 2โ€“4 2โ€“4 โ€” 2โ€“4, can be pinned products
Results live % live % โ€” live % for everyone
Voter names hidden hidden โ€” hidden, host included

8.6 Questions

โœ… Agreed 2026-11-23.

Example. Mama Yoyo, a dress pinned.

  1. Juma taps Ask: "Does this come in XL?" โ†’ the questions list, linked to the pinned dress โœ….
  2. Neema taps ๐Ÿ™‹ Me too โ†’ 12 ๐Ÿ™‹, it moves up โœ….
  3. She opens Questions (most ๐Ÿ™‹ first) โ†’ Answer now.
  4. Everyone sees a big card: "Juma: Does this come in XL?" with Buy for the dress โœ….
  5. Done โ†’ marked answered, card gone.
  6. After the live: "6 questions not answered" โ†’ she can reply to each person in chat.

Rules

  • A separate Ask button and list, not mixed into comments.
  • ๐Ÿ™‹ Me too pushes popular questions up.
  • On-screen card, with Buy when it is about a product.
  • One question every 30 s per person, at most 150 characters, the comment word filter (ยง10).
  • Kept 6 hours (as comments) so unanswered ones can be answered in chat.
  • Host, co-hosts and a staff host can answer.
Instagram TikTok YouTube NexGate
Ask Ask button Q&A button host starts Q&A Ask button, linked to the pinned product
Support a question โŒ โœ… like โŒ โœ… ๐Ÿ™‹ Me too
On screen big card on screen highlighted big card + Buy
After the live โ€” unanswered kept โ€” unanswered kept 6 h, reply in chat

9. Speed and data saver

โœ… Agreed 2026-11-23. Target: TikTok level. About 2โ€“3 s behind the host, no buffering on weak 3G, listen only on 2G.

Today (checked in srs/srs.conf): viewers get HLS in 4 s pieces โ†’ about 6โ€“12 s behind the host; video has one quality (whatever the host's phone sends), so weak 3G buffers; radio has a 32 kbps version; the server makes no extra video qualities (no CPU for it); SRS already makes HTTP-FLV, not used for viewers.

9.1 Delay

Step What Delay Notes
1 (quick) HLS pieces 1 s, host phone sends a keyframe every 1 s 3โ€“5 s still through the CDN, same cost per viewer
2 (TikTok way) HTTP-FLV to viewers, one continuous stream 2โ€“3 s delivered by SRS edge servers (ours, small, near users, e.g. Nairobi / Johannesburg; SRS's own design for scale), cost check first; HLS stays as the backup
3 (agreed in ยง8.1) people on screen talk through LiveKit < 1 s guests and co-hosts only
  • Android's standard player plays FLV; iPhone and web need a player library.
  • Timers and deals follow the backend clock, never the video: auction, flash price, coupon drop, group buy and poll timers reach phones with the comments, so they are fair even when the video is late.

9.1a Where the delay comes from

Two different waits:

  • Delay: how far behind the host a viewer is, for the whole time they watch (Mama Yoyo waves, Juma sees it 10 s later).
  • Opening time: from tapping a live to seeing the picture, once, when joining.

The delay, step by step (today, HLS with 4 s pieces). Mama Yoyo waves at 8:00:00.

# Where What happens Today 1 s pieces (step 1) FLV (step 2)
1 Host phone camera โ†’ compress 0.2 s 0.2 s 0.2 s
2 Host upload phone โ†’ SRS 0.3 s 0.3 s 0.3 s
3 SRS cuts pieces waits until a piece is complete up to 4 s up to 1 s none (continuous)
4 CDN / edge playlist cached a moment ~1 s ~0.5 s ~0.1 s
5 Viewer's player keeps 2โ€“3 pieces in hand, plays that far behind the newest 4โ€“8 s 2โ€“3 s ~1โ€“1.5 s buffer
6 Viewer download โ†’ phone 0.3 s 0.3 s 0.3 s
Total 6โ€“12 s 3โ€“5 s 2โ€“3 s

Steps 3 and 5 are the big ones and both grow with piece size; FLV has no pieces.

Timers are separate. The auction ending at 8:05:00 (backend clock) shows "0:05 left" at the right moment even if Juma's video is 6 s late; his bid at 8:04:58 counts. The delay makes the live feel slow; it never makes a deal unfair.

Opening time

Today (HLS, 4 s pieces) With FLV
What happens fetch the piece list โ†’ download a whole 4 s piece โ†’ start the server sends from the last keyframe at once
Time to picture 1โ€“3 s under 1 s
  • Instant feel (TikTok's trick): in the swipe feed (/live/swipe) the app loads the next live while you watch the current one.
  • Catch-up: after the network stutters the player has fallen further behind (10 s โ†’ 20 s) and never comes back by itself. The player plays at 1.1ร— until caught up, or jumps to now if far behind.

What each delay feels like (why 2โ€“3 s is the target)

Delay Feels like Who uses it
< 0.5 s a phone call, real back and forth video calls; our guests on screen (LiveKit)
1โ€“2 s almost instant some apps on perfect networks
2โ€“3 s โœ… Juma comments "red one!", Mama Yoyo holds up red, he sees it ~3โ€“5 s after typing (with the comment refresh): feels live TikTok, Douyin, Instagram
6โ€“12 s (today) the answer comes after he's moved on: feels like TV old-style streaming
20โ€“30 s a broadcast YouTube's normal setting

Why not lower: the last 1โ€“2 s are the viewer's player keeping about 1 s in hand so it doesn't freeze when the signal wobbles; half-second drops are common on Tanzanian mobile networks, and freezing is worse than 2 s of delay. Only people talking on screen need under 0.5 s, and they have LiveKit.

9.1b Is 2โ€“3 s affordable? The math

Assumptions (to re-check with real numbers): average watched quality about 0.8 Mbps (mix of 720p 1.5 ยท 480p 0.8 ยท 240p 0.3) โ†’ 0.36 GB per viewer-hour. Prices looked up 2026-11-23: Vultr Johannesburg small server $12/month with 3 TB, extra traffic $0.01/GB; bunny.net CDN Middle East & Africa $0.06/GB. Cloudflare's free / Pro CDN is not allowed for video (their terms: video needs Stream / R2 or Enterprise), and today HLS is still served straight from the SRS box (VP_LIVE_SPEC).

Viewer-hours a month Traffic bunny.net CDN (HLS only, no FLV) SRS edges on Vultr Johannesburg (FLV + HLS)
10,000 (โ‰ˆ 330 a day) 3.6 TB ~$216 ~$18 (1 server)
100,000 36 TB ~$2,160 ~$300 (3 servers)
1,000,000 360 TB ~$21,600 ~$3,750 (โ‰ˆ 6 servers)
  • One edge with a 1 Gbps port serves roughly 800โ€“1,200 viewers at once at 0.8 Mbps.
  • Main box โ†’ edge traffic is small (one copy of each live per edge).
  • Dar โ†’ Johannesburg is about 40โ€“60 ms away: fine for 2โ€“3 s.
  • Result: SRS edges are both the fastest option and about 6ร— cheaper than a CDN. Start with one edge, add more as viewers grow.

Data paid by people (their phone bundles)

Who Quality Per hour
Viewer 720p / 480p / 240p / listen only ~675 MB / ~360 MB / ~135 MB / ~15 MB
Host sending 3 qualities 720p + 480p + 240p ~1.2 GB
Host sending 1 quality 720p ~675 MB

The host's upload cost matters on mobile data: 3 qualities on Wi-Fi, 2 on mobile data (decided by the backend per phone, as ยง9.2).

9.2 Quality and data saver

  • The host's phone sends 3 qualities (720p ยท 480p ยท 240p); the server only passes them along (no re-encoding); the player switches automatically with the viewer's network. A weak host phone sends 2 or 1; the backend tells each phone what to send.
  • Listen only ๐ŸŽง for 2G: the server copies just the sound (cheap, no re-encoding); the product card and Buy stay.
  • Switch "Data saver" in settings: every live starts in low quality.
  • Later, with more servers: the server makes extra qualities for hosts whose phones can't.
Today After step 1 After step 2 (target) TikTok
Delay 6โ€“12 s 3โ€“5 s 2โ€“3 s 2โ€“3 s
Weak 3G buffers 240p, plays 240p, plays plays
2G buffers listen only listen only โ€”
Our server CPU low low low โ€”

10. Safety

โœ… Agreed 2026-11-23.

Today: host can mute a person and turn on slow mode; only accounts 18+ and 3 days old go live; posts have reporting (reasons list + admin review: PostReportEntity, ReportReason); lives have no reporting, and with no recording there is no evidence afterwards.

TikTok YouTube Instagram NexGate
Report a live โœ… โœ… โœ… โœ… + a picture + last 5 min of comments
Moderators chosen by the host โœ… (up to 20) โœ… โŒ โœ… up to 10
Host's blocked words โœ… โœ… โœ… โœ… up to 100 + NexGate's list
Hold risky comments โœ… โœ… โ€” โœ… phone numbers and links
Mute for a time โœ… โœ… โ€” โœ… 1 min ยท 5 min ยท whole live
Automatic video checks โœ… โœ… โœ… later
Platform stops a live / bans โœ… โœ… โœ… โœ…

S1. Report a live. โ‹ฏ โ†’ Report โ†’ a reason (the same list as posts). At that moment the backend grabs one picture from the video (a single frame from SRS, cheap) and the last 5 minutes of comments; admin sees what the reporter saw.

S2. Automatic pause. 5 reports from different people within 2 minutes (more in big rooms, scaled with viewers; the number is a setting) โ†’ the live is paused ("This live is being reviewed") until admin lets it continue or ends it. Only accounts at least 3 days old count, so fresh accounts can't kill a rival's live.

S3. Moderators chosen by the host. Up to 10; they can mute, remove from live, hold or delete comments; they can't start deals, end the live or see money. Shop lives: the owner picks staff, only through the shop terminal (team rules).

S4. Word filter.

  • NexGate's list (insults, scam words like "send money to this number") always applies.
  • The host's own list, up to 100 words.
  • A filtered comment is shown only to its writer.
  • Phone numbers and links are held for the host or moderators to approve (stops "call me for cheaper" scams).

S5. Mute, remove, block. Mute 1 min ยท 5 min ยท whole live; remove from the live (T4); block = never watches this host again.

S6. Admin. End any live now; ban from going live 1 day ยท 7 days ยท 30 days ยท forever; every action in the admin audit log. Under 18: can watch, can't send gifts, can't join on screen.

Later: automatic video checks (a machine looks at pictures for nudity etc.); costs CPU or a paid service.

11. After the live

โœ… Agreed 2026-11-23. Brings together ยง7.3 (sales numbers), gifts, reactions, polls, questions and "Book again".

TikTok YouTube Instagram NexGate
Summary right after ending โœ… โœ… โœ… short โœ… everything in one place
Viewers over time graph โœ… โœ… โŒ โœ… with markers for what the host did
Where viewers came from โœ… โœ… โŒ โœ…
Average watch time โœ… โœ… โŒ โœ…
History of all lives โœ… โœ… โŒ โœ… My lives

A. Host's end screen (right after End)

Your live ยท 1 h 05 min ๐Ÿ‘€ 410 at the peak ยท 1.2k watched ยท average 6 min each ยท +38 followers ๐Ÿ› 14 orders ยท 230,000 TZS ยท best: Kanga red (30 taps โ†’ 8 orders) ๐ŸŽŸ๏ธ Coupon drop 20 โ†’ 9 used ยท ๐Ÿ‘ฅ Group 10/10 โœ… ยท ๐Ÿ”จ Watch sold 25,000 ๐ŸŽ 38 gifts ยท 54,000 in gift balance ยท top fan: Neema ๐Ÿ”ฅ most reactions ยท ๐Ÿ“Š Poll: Blue 55% ยท โ“ 6 questions not answered โ†’ [Reply in chat] [Book again next Friday 8 pm?] [See full numbers]

Money for the shop owner / personal host only (staff and other people's products: counts, ยง7.3).

B. Full numbers (My lives โ†’ that live)

  1. Viewers per minute graph with markers: "8:20 coupon drop โ†’ +80 viewers", "8:40 flash price โ†’ 5 orders" (from heartbeats; no video needed).
  2. Where viewers came from: Live feed ยท Swipe ยท notification ยท a post with the live ยท profile ยท shared link ยท followers (the app says where the tap came from, like the sales link).
  3. Products: taps โ†’ orders โ†’ money, per product.
  4. Refunds subtracted later.

C. Viewer's screen when a live ends

Live ended ยท [Follow Mama Yoyo] (if not yet) Next live: Friday 8 pm [Remind me] (if booked) Live now: 3 lives he might like (from /live/now)

"From my last live": the pinned products stay in a row on her profile / shop for 24 h; late buys still count for the live (ยง7.3).

D. Kept

What Kept
Summary and numbers of each live forever (a few rows per live)
Viewers-per-minute graph forever (one number per minute)
Comments, questions 6 hours, then gone
Video never recorded

12. Open questions waiting for the owner

None right now. Q1 and Q3โ€“Q9 (live row, post stays after the live, owner's personal followers, shop reasons and weights, staff tools, group buy rules, others can pin my products, reminder choices) were all agreed on 2026-11-23.

# Question Answer
Q1 Live row above the home feed? yes
Q3 Post stays after the live ends, ranked lower? yes
Q4 Owner's personal followers not notified when she goes live as the shop? yes
Q5 Shop live reasons and weights (ยง3.3) as in the table
Q6 What staff can do while live (ยง5.2) as in the table
Q7 Group buy rules (ยง7.2) as listed
Q8 "Others can pin my products in their lives" shop switch yes, on by default
Q9 Reminder choices (ยง4.1): 24 h ยท 1 h ยท 15 min ยท at start; tick more than one; default 24 h + 15 min; at start always on as listed

13. What the backend needs

For everything agreed (all topics discussed by 2026-11-23).

13.1 Keep as is

  • Going live: create, ingest key, end, SRS callbacks publish / unpublish.
  • Comments: post, read, mute, slow mode (read changes: built once every 2 s, served from memory to signed-in viewers, ยงRules).
  • Pins: attach, list, pin, unpin, remove, tap.
  • Discovery: GET /live/now, POST /live/now/open, POST /live/streams/{id}/watching.
  • Remind me: PUT /live/streams/{id}/reminder (gains the lead choices, ยง4.1).

13.2 Change

What Change
Create a live + as (me / which shop); + booking rules (15 min โ€“ 30 days, 5 waiting per person and per shop, 2 h apart, one live per person and per shop)
Stream + shop (null for a person's live); + hosted by (the staff member, for a terminal live)
Reminder + the chosen leads (ReminderLead set)
Create a post + accepts a live attachment (an added optional field; post_streams table like post_events); the post answer gets an optional live attachment with its state read at serve time
Coupon + only people watching switch; + grab limit
Playback address now carries a play token (short-lived, account + phone), checked by SRS / edges at start (ยงRules)
SRS HLS pieces 4 s โ†’ 1 s; FLV to viewers through SRS edges; three qualities from the host phone; listen-only sound copy (ยง9)
Shop settings + Others can pin my products in their lives (on by default)

13.3 New

Topic Endpoints
My lives GET /live/mine?status=&as=: personal and all my shops' lives (including staff-hosted), each with as, title, cover, status now (scheduled / live / ended / cancelled), when, numbers, and buttons decided by the backend
Someone's lives GET /live/people/{accountId}, GET /live/shops/{shopId}: upcoming + live now only, with Remind me or Watch
Scheduling edit ยท cancel ยท who is waiting (host only) ยท book again
Live feeds GET /live/swipe (next few, in order, for preloading) ยท kind=SHOP filter on /live/now and /live/swipe
Coupon drop drop ยท change (add people, add time, stop) ยท grab ยท hold time from a fixed list ยท "ends in 1 h" reminder
Ticket live "Stream on NexGate Live" on online / hybrid events (live booked from the event, moved / cancelled with it) ยท watch only with a valid online ticket, one phone at a time ยท watching = check-in
Live gifts admin list (key, name, icon, price, order, on/off) ยท send (wallet โ†’ host's or shop's gift balance, daily limit) ยท top fans ยท event with the key for the animation
Auction start (start price, step, time, lowest price) ยท bid (top bid held in escrow, outbid released) ยท cancel ยท end โ†’ order or ticket for the winner
Bargain turn on per pinned product (lowest price optional) ยท offer ยท counter / accept / no ยท accepted = personal offer with 15 min to pay
Flash price start ยท change (lower, add pieces, stop) ยท hold a piece at checkout 10 min; checkout and quotation use the flash price
Free delivery a shop delivery campaign with audience "from this live" (start, stop); quotation checks the ยง7.3 link
Sales numbers optional "from live" on product orders and ticket purchases (24 h after the tap, last live wins; coupon / group buy always) ยท live summary for the host (counts; money for the shop owner only) ยท "from other people's lives" in shop reports
Group buy start (host, no seat bought) ยท change (add time, lower price, give through); joining uses the existing checkout; tickets with seats, several seats per person
Instalments pinned card shows the product's existing plans (no new tool)
Guests and co-hosts request ยท invite (watching / search, connected people only) ยท accept / ignore / remove / block for this live / requests off ยท seats (5 allowed, "seats now" from the backend) taken in one safe step ยท "Allow live invites" setting ยท LiveKit room tokens for people on screen
Reactions send (batched, fixed LiveReaction list, 15/s per person) ยท mix for the last 2 s with the comments ยท host totals
Joins up to 10 per 2 s with facts (host follows, top fan, friend of you) + count ยท "Show when I join a live" setting
Who's watching count + top 3 fans for everyone ยท full list for host / co-hosts (bought mark) ยท mute / remove from the list
Polls start (2โ€“4 options, products allowed, 1 ยท 2 ยท 5 min or open) ยท vote once ยท end ยท result into the summary
Questions ask (linked to the pinned product) ยท Me too ยท answer now / done ยท unanswered after the live
Safety report (picture + last 5 min of comments) ยท auto-pause and admin continue / end ยท moderators (up to 10) ยท word filter (NexGate + host list) ยท held phone numbers and links ยท mute 1 / 5 min / whole live ยท block ยท admin end live and ban from going live ยท under-18 limits
After the live end summary ยท viewers per minute with event markers ยท where viewers came from ยท per product numbers ยท viewer's end screen ยท "From my last live" row 24 h
Data saver qualities per phone decided by the backend (Wi-Fi 3, mobile data 2) ยท listen-only address
Staff from the terminal go live for the shop ยท hand over to another staff member ยท the NexGate Shop app's allowed paths (team rule 2)

The composer's + Live picker uses /live/mine?status=upcoming,live. To attach someone else's live, the person starts from that live (its card or page โ†’ Share as post).

13.4 Live events on screen: real time through Centrifugo

โœ… Agreed 2026-11-23 (owner: "we need it").

  • Sending = API (as today and as TikTok): comment, vote, bid, ask, grab, joinโ€ฆ each checked properly (signed in, money, one vote) and safe against double taps.
  • Receiving = push. Each watching phone keeps one open connection to Centrifugo (a small open-source server built only for real-time delivery; handles hundreds of thousands of connections on a small server; checks our sign-in tokens). The backend decides everything and tells Centrifugo "send X to this live's room"; Centrifugo only delivers, about every 0.3 s.
  • One channel per live carries everything: comments, reactions, joins, poll results, questions, coupon counts ("20 left"), group buy ("7 of 10"), auction bids, timers, pins, "live paused".
  • Events stay a key + an id, never display text, as pins do today.
  • Connection drops (weak network) โ†’ the app falls back to asking every 2 s until it reconnects; nothing is lost.
  • Cards can arrive before the video shows the host saying it (video is 2โ€“3 s behind): harmless; timers follow the backend clock.
  • Example: Juma taps Bid 22,000 โ†’ API checks and holds it โ†’ the backend pushes "Juma 22,000 ยท 0:08" โ†’ all 300 phones see it in under half a second.
  • New infrastructure: Centrifugo runs on the box (later next to the SRS edges); Redis lets several backend copies publish to it. Later it can also carry the feed's live counts and calls / meetings events.
Today After
Others' actions reach me up to 2 s (asking every 2 s) under 0.5 s (push)
Requests with 1,000 viewers and nothing happening ~500 a second ~0 (open connections, quiet)
Auction last seconds can be 2 s late fair and instant

13.5 Notifications (each one also goes into the notification workbook)

Reminder 24 h ยท reminder 1 h ยท reminder 15 min ยท host "get ready" ยท moved ยท cancelled ยท "book again" after the live ยท grabbed coupon ends in 1 h ยท co-host invite ยท ticket live starts in 15 min ยท live summary ready ยท your live was paused / ended by NexGate ยท banned from going live.

13.6 Sale origins (shared, not only live)

Agreed 2026-11-23: where a sale came from is kept in one new table, not as columns on orders, because it will also be used for sales from feed posts, reels, events, shared links and more.

  • One row per purchase that came from somewhere (most purchases have none): which purchase (product order or event booking order + its id) ยท from where (SaleOriginKind, VARCHAR: LIVE first; later POST, CLIP, EVENT, SHARE_LINK, CHAT) ยท which one (stream / post / clip / event id) ยท whose it was (the account that brought the buyer, kept even if the post is deleted later) ยท when tapped ยท when bought.
  • The tap is remembered by the backend, not carried by the app: tapping a product or ticket from a live / post / reel notes "this person, this product, from here, at this time" for 24 hours (Redis, expires by itself). At payment the backend looks it up and writes the row. The last place tapped wins.
  • Existing order tables and responses stay unchanged; reports ("orders from my live", "4 orders came from Juma's post") read this one table.

13.7 Remove

SRS recording (dvr) + the on_dvr callback ยท the replay service + its File Thunder contexts (STREAM_VIDEO, STREAM_AUDIO) ยท the states PROCESSING, REPLAY_READY, FAILED.


14. Research sources (read 2026-11-23)

Some sources disagree on details (follower minimums, replay days, flash-sale limits). Good for ideas; check again before copying an exact rule.


Change log

Version Date What
0.1 2026-11-23 First write-up: today's state, no recording, live feeds, scheduling, shop live, staff via terminal + Shop app, anyone shows / only the shop sells, coupon drop, group buy proposal, open questions; a live on a post is an attachment type, anyone can attach anyone's live, share-as-post is an app shortcut; viewer picks reminder times from a fixed list; ยง13 what the backend needs; Q1, Q3โ€“Q9 agreed (group buy rules, staff tools, shop reasons, reminder choices); full money tools list M1โ€“M14; M10, M13, M14 not now; every tool for products and tickets except instalments; M3 sales numbers agreed (ยง7.3); coupon drop hold time picked by the owner; M4 free delivery agreed (ยง7.4); one shared sale origins table for live, posts, reels, events (ยง13.6); M5 flash price agreed (ยง7.5) with the "only people watching" switch, sizes and colours; M6 bargain live agreed (ยง7.6); M8 instalments agreed (ยง7.7); M7 live auction agreed (ยง7.8); M9 live gifts agreed (ยง7.9): gifts land in the gift balance; M11 ticket live agreed (ยง7.10); M12 paid live not needed; group buy tickets side agreed (ยง7.2); money tools list finished; taking part T1โ€“T7 needed, T8 not; T1 guests and co-hosts agreed (ยง8.1), mixed on the host's phone; seats decided by the backend (5 allowed, 3 now), full screen checked when someone goes on, comparison table; T2 reactions the YouTube way (ยง8.2); T3 joins delivered by the backend, shown by the app (ยง8.3); T4 who's watching + three ways onto the screen (ยง8.4); T5 polls with product options (ยง8.5); T6 questions with Me too (ยง8.6); T7 battles not needed; ยง9 speed and data saver: target 2โ€“3 s (1 s HLS pieces, then FLV via SRS edges), host phone sends 3 qualities, listen only, timers on the backend clock; delay breakdown, opening time, catch-up, cost math (SRS edges ~6ร— cheaper than a CDN), what each delay feels like; ยง10 safety agreed (report with a picture + comments, auto-pause, moderators, word filter, held phone numbers and links, admin bans, under-18 rules); every live endpoint and the video itself need a signed-in account (play token), shared link preview; ยง11 after the live agreed; ยง13 complete; real time through Centrifugo (sending by API, receiving by push, fall back to asking every 2 s); "your friends are watching" on every live card (ยง3.2a)