← /work/privachat
# case · 01 / 06 · 2025
● live in productionmobilereal-timesecurity

PrivaChat — a messaging platform where the operator stays in control of every conversation.

role
sole engineer · system design
stack
react native · node · ws
timeline
q1 — q3 2025
status
production · mvp shipped
PrivaChat login screen
login
PrivaChat projects list
projects
PrivaChat voice call with admin monitoring
voice call
privachat · v1.2
iphone 15 pro · ios 17
#01 · the problem
// brief

Operators wanted to moderate every interaction without rebuilding chat from scratch.

No phone numbers in DMs. No off-platform calls. No back-channel coordination between users on the platform.

Consumer chat assumes good actors. This product couldn't.

// constraints
  • p95 < 100msmessage delivery globally
  • admin-gatedevery call requires approval
  • server-sidemoderation, never client-trusted
  • auditableevery state change logged
  • mobile-firstrn for ios + android, single codebase
#02 · system design

Three planes. Each one auditable.

clients
· react native ios
· react native android
· admin web (next.js)
wss · tls 1.3
edge
· auth · jwt
· rate limit
· schema validation
moderation
· phone · email regex
· handle detection
· obfuscation scorer
pub/sub
control
· postgres (supabase)
· approval state machine
· audit log
realtime
· redis pub/sub
· websocket fanout
· sfu (mediasoup)
plane · 01
control
admin queue, role assignments, approval state. postgres source of truth, every state change audited.
plane · 02
signaling
websocket fanout for presence, typing, call invites. server validates approvals before forwarding.
plane · 03
media
webrtc routed through sfu. calls drop instantly if approval is revoked mid-session.
#03 · content moderation

Detection runs before the message ships.

moderation/pipeline.ts
1// composable rule engine
2export const moderate = async (msg) => {
3 const r = await pipe(msg)
4 .then(detectPhone)
5 .then(detectEmail)
6 .then(detectHandle)
7 .then(scoreObfuscated);
8
9 if (r.score > 0.7)
10 return redact(r.spans);
11 return msg;
12};
// what recipients see
reach me at +91 98765 43210 after the call.
ⓘ contact info auto-redacted by platform
reach me at ███ ████ ████ after the call.
regex
phone · email · handle
heuristic
obfuscated forms
threshold
score > 0.7
#04 · outcomes · 90-day window
<80ms
p95 message delivery
12K+
msgs / day at mvp
100%
admin-gated calls
0
platform bypasses observed
← /work
all projects
next case →
Lynkboard