DEV Community

Jenie
Jenie

Posted on

I dont think anyone will read this. I built a group chat app with vanilla JS and Firebase, no build step

I made Flami for my friends: group chat with voice notes, calls, party games and watch parties, all in the browser. The frontend is plain JavaScript, no bundler, no build step. Free Firebase plan.

Live: https://flami-7ea7b.web.app
Source (MIT): https://github.com/exodusssss7/flami

Firebase loads as ES modules straight from a CDN. Edit the file, refresh, done. The tradeoff: no JSX, no hot reload, and one big app.js I have to keep tidy myself. For this size it's worth it.

Firestore rules are the whole backend

There is no server, so the security rules are the only thing between users and each other's data. Chats and media are readable only by members, writes are size-capped, and you can only edit your ownn messages. Firebase web API keys aren't secrets,,, so test your rules like code.

Watch party sync
The host's player is the source of truth, with a heartbeat every 3 seconds. Viewers fix small drift by nudging playbackRate to 1.06 or 0.94 instead of seeking. Google Drive links don't work (the browser blocks the stream), so use Dropbox or a direct mp4.

What it doesnt do

  • No end-to-end encryption
  • Calls only ring while the app is open
  • Free-tier limits (calls use a free relay capped at about 500 MB a month)

Full list: https://github.com/exodusssss7/flami/blob/main/SECURITY.md

If you've built realtime sync or WebRTC on Firebase free tier, I'd like to hear what broke for you.

Top comments (3)

Collapse
 
alexcodebytes profile image
Oleksandr •

The playbackRate nudge is the smartest bit here — seeking on drift is what makes watch parties feel broken, and 1.06/0.94 is subtle enough that nobody notices the correction. Most people reach for currentTime and live with the jump.

"Test your rules like code" is the sentence more Firebase tutorials need to lead with. The emulator makes it cheap, and almost nobody uses it until something's already leaking.

To your question: I haven't shipped WebRTC on the free tier, so I can't trade war stories — but how are you testing the rules? Emulator with a fixture set, or manual probing from the console?

Collapse
 
jenie_592668bec868f9b3700 profile image
Jenie •

Thanks Oleksandr. The drift thing was exactly the problem - a hard seek every few seconds feels broken, so nudging the rate won. 1.06/0.94 was the biggest correction I could get away with before anyone noticed.

On rules testing, it's manual so far. I make throwaway accounts and try to break things: read a chat I'm not a member of, edit someone else's message, push an oversized write, and check the rules refuse each one. No emulator fixture set yet, though after this comment it's going on the list.

If you do ship WebRTC on the free tier at some point, I'd be curious what broke for you too - my calls work, but only ring while the app is open, and the free relay caps around 500 MB a month.

Collapse
 
alexcodebytes profile image
Oleksandr •

1.06/0.94 is exactly the sweet spot — noticeable enough to fix the drift, but subtle enough that it doesn't look like a glitch.

Manual testing is a rite of passage, but moving to emulator fixtures will save you so much time. Glad it made the list!

And yeah, 500MB/month for WebRTC is practically a countdown timer. Explains why calls drop the second the app closes.