惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
CXSECURITY Database RSS Feed - CXSecurity.com
D
Docker
有赞技术团队
有赞技术团队
WordPress大学
WordPress大学
Jina AI
Jina AI
小众软件
小众软件
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
美团技术团队
爱范儿
爱范儿
V
V2EX
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
J
Java Code Geeks
博客园 - 司徒正美
博客园 - 叶小钗
S
SegmentFault 最新的问题
量子位
S
Secure Thoughts
月光博客
月光博客
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
O
OpenAI News
L
LINUX DO - 最新话题
罗磊的独立博客
SecWiki News
SecWiki News
雷峰网
雷峰网
Recent Announcements
Recent Announcements
V2EX - 技术
V2EX - 技术
T
Tailwind CSS Blog
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
云风的 BLOG
云风的 BLOG
Schneier on Security
Schneier on Security
T
The Blog of Author Tim Ferriss
IT之家
IT之家
博客园 - 聂微东
腾讯CDC
N
News | PayPal Newsroom
P
Proofpoint News Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
Hacker News: Ask HN
Hacker News: Ask HN
aimingoo的专栏
aimingoo的专栏
Webroot Blog
Webroot Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Google DeepMind News
Google DeepMind News
K
Kaspersky official blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How My Team from Risevest Academy and I Built an End-to-End Encrypted Messaging App in 3 Weeks
Victor Ayoola · 2026-05-29 · via DEV Community

We were each asked to come up with an Idea of a project we would like to build. I have always wondered what the tech behind messaging platforms is like, so for me it was easy. Build a secure messaging platform. After a bit of research, I thought I understood what that meant. After the past three weeks, having built something I'm really proud of, I can tell you that I had no idea what I was getting into. Not in a bad way, but in a way that meant I was bound to learn.

This is the story of how a team of four backend developers built a real-time, end-to-end encrypted messaging platform with WebSocket messaging, media sharing, push notifications, and a functioning encryption layer.


Where We Started

The idea was initially simple; build something like WhatsApp, but with privacy as the foundation. Messages had to be encrypted on the sender's device and decrypted only on the recipient's. So not even our servers could reach the messages.

That last requirement changed everything about how my vision for the system looked. Building a simple CRUD app is relatively easy, REST APIs, maybe a real-time feature here and there. E2EE is a different ball game entirely. It forces you to think about different boundaries, what does the server know? What should it know? And what is off limit?

Before we started actually coding, we spent time on three questions: what were we actually building, what did each piece of the stack need to do, and what were the dependencies between them?


The Tech Stack and Why We Chose It

We landed on Node.js, TypeScript, Express, PostgreSQL, Redis, and Socket.io for the backend.

TypeScript with strict mode was non-negotiable. With four people writing backend code simultaneously as well as working on the frontend, type safety is what keeps everyone honest. Every API response shape, every socket event payload, every database model is fully typed. When a response shape changes the frontend catches it at compile time.

Express.js was a deliberate choice. We considered other choices - briefly, but Express felt like the obvious choice: every developer on the team already knows it - for one. We built a clean middleware stack on top of it — validation, JWT auth, error handling and request logging.

PostgreSQL and Knex because relational data fits our domain. Users, conversations, members, messages — these have clear relationships and constraints. Knex gave us type-safe migrations and query building without the magic of a full ORM. We wrote our migrations in dependency order and never had a schema conflict.

Socket.io with Redis adapter for real-time messaging. Socket.io's room abstraction maps perfectly to chat conversations — a socket joins the conversation room, messages are emitted to the room, everyone in it receives them. The Redis adapter is what allows this to scale: when you have multiple server instances, a message arriving at server A needs to reach a user connected to server B. Redis pub/sub is the channel between them.

BullMQ for offline message delivery. When a recipient is offline, the message queues. A background worker processes the queue and triggers push notifications. Jobs retry automatically with exponential backoff. This is the kind of infrastructure that feels like overkill until the day it saves you.

Firebase for three separate things: Authentication through firebase phone verification. Cloud Messaging handles push notifications. We originally planned to use Firebase Storage for media but switched to Cloudinary midway through because of its built-in transformation pipeline.


The Architecture Decision That Defined Everything

Early in week one we made a decision that shaped everything that followed: the server would store ciphertext and nothing else.

This sounds obvious for an E2EE app but the implications run deep. It means:

  • The backend has no business logic that depends on message content
  • Encryption and decryption happen entirely on the client
  • If our database is breached, the attacker gets encrypted blobs they cannot read
  • The server cannot comply with a request to hand over message contents because it genuinely does not have them

We used the Web Crypto API on the frontend — ECDH for key agreement and AES-256-GCM for symmetric encryption. Private keys are stored in IndexedDB as non-extractable CryptoKey objects. So even JavaScript cannot read them back out. They can only be used to perform cryptographic operations.

Here is what that looks like in practice. When a user sends a message:

  1. The frontend fetches the recipient's public key from the backend
  2. An ephemeral key pair is generated for this specific message
  3. ECDH key agreement derives a shared secret using the ephemeral private key and the recipient's public key
  4. The message is encrypted with AES-256-GCM using that shared secret
  5. The encrypted blob is sent to the backend
  6. The backend stores it without reading it
  7. The recipient's frontend receives the blob, derives the same shared secret from the other side, and decrypts locally

We originally planned to use the Signal Protocol library on both frontend and backend. We ran into a hard wall, which was that libsignal is a Node.js library with native bindings that does not run in the browser. The frontend had to use a different approach. We chose the Web Crypto API — it's built into every modern browser, has no dependencies, and the non-extractable key storage in IndexedDB was more secure than what most apps do.


The 3-Week Sprint

We split the work across four backend developers with clear ownership each week.

Week one was foundation — Express scaffold, TypeScript config, database migrations, Firebase Auth integration, JWT session management, and the encryption key management infrastructure. The primary thing in week one was to get the auth middleware right. Everything else depended on it. We used Firebase Auth for phone number verification and OTP, then exchanged the Firebase ID token for our own internal JWT pair. Fifteen-minute access tokens, thirty-day refresh tokens and silent renewal on 401 responses.

Week two was the core product — Socket.io server with Redis adapter, message routing, message persistence, delivery status tracking, group messaging, media pipeline, and push notifications. This was the hardest week. Getting real-time messaging right requires thinking about state in multiple places simultaneously: the socket connection registry in Redis, the message status in PostgreSQL, the optimistic UI on the frontend, the BullMQ queue for offline delivery. We had moments where all four of us were debugging the same flow from different angles.

Week three was integration. The frontend and backend had been built largely side by side and week three was where we wired them. This is where the choice to use TypeScript paid off most visibly — the type definitions meant most things just worked, and where they didn't the errors were specific, easy to trace and fixable.


What Actually Went Wrong

I want to be honest about the things that did not go smoothly.

The authentication flow this wasn't much of an issue but we most definitely struggled with finalizing and understanding the authentication flow on registration, and how to properly integrate firebase auth into the mix.

The libsignal mismatch cost us a lot of time. We had built the backend key validation assuming the frontend would use Signal Protocol. When we discovered libsignal doesn't run in browsers we had to strip the validation out of the keys routes and rethink the frontend encryption approach. The lesson: validate your stack choices before you build anything on top of them.

Route ordering in Express this one hurt a bit, and genuinely had me thinking I was losing it. In reality, it is a genuinely easy mistake to make and we made it. Parameterised routes like /:id will swallow everything that comes after them if registered in the wrong order. GET /users/level-up must come before GET /users/:id or search is unreachable — Express matches top to bottom and has no way to know that search is not a UUID. We caught this problem during integration and it was quite mind boggling, one of those mistakes I most definitely won't be making again.


What I Would Do Differently

Start with a shared Type contract. A shared type contract would have helped avoid some of the issues we faced while building and integrating the front and backend, as it ensures both sides are always on the same page about how data is sent and received.

Do a dependency audit before starting. Know which tasks are truly parallel and which are blocked.

Proper research on stack choice. This is definitely a hard check for me from now on, even when it feels like you're using the industry standard. It's always best to ensure what you go with aligns perfectly with your goals and works properly with all other tools being used in the project.


What I'm Most Proud Of

Building this in three weeks, with four developers on a project of this complexity, We pushed to see it through and it most definitely wasn't smooth sailing all through but we were able to pull it off.


The Stack in One Place

For anyone who wants the full picture of our full tech stack, this is what it looked like:

Backend: Node.js, TypeScript, Express.js, PostgreSQL, Knex, Redis, Socket.io, BullMQ, Firebase Admin SDK, Cloudinary, Zod, jose, Multer

Frontend: React, TypeScript, Web Crypto API, IndexedDB, Socket.io client, Firebase Auth SDK, Axios

Infrastructure: Redis Cloud, Cloudinary, Firebase (Auth + FCM), PostgreSQL


What's Next

The backend is built to support Android — the API doesn't care whether the client is a browser or a mobile app. React Native is next.

Voice and video calls are Phase 2. WebRTC for peer-to-peer, our signalling server already handles the connection infrastructure.

Full Signal Protocol on the frontend is something I want to revisit. The Web Crypto API approach works and is genuinely secure but Signal's Double Ratchet algorithm provides forward secrecy that our current implementation lacks — if a key is compromised, past messages should remain safe. That's the next cryptographic milestone.


If you're thinking about building something similar, my advice is this: make the hard architectural decisions first. For us, the decision that the server would never read message content was not a negotiable. Everything else followed from it. Start with your constraints, not your components.

The code is messy in places, some corners were cut, and the UI could definitely do with some improvement. But it works, and messages encrypted on one device are being decrypted on another without our server ever knowing what was said.

That's the thing we set out to build. That's the thing we built.


I am a fullstack developer who built the backend architecture (alongside my team) and the frontend for Culver as part of a 3-week mentorship project. These are the repo links, Backend, Frontend.