Apps and websites · React · Node · PostgreSQL · Socket.io · Summer 2026

CodeReview

A collaborative web app for inline code commenting with live updates. Paste or upload code, share the link, and leave comments on specific lines. Comments appear instantly for everyone viewing the same snippet, no refresh. Full-stack, with its own server and database. The free server sleeps when nobody uses it, so the first visit can take a minute.

React + Vite Node + Express PostgreSQL Socket.io JWT Auth

The real app runs a Node + Postgres + Socket.io backend, which can't run inside a static page. This is a small client-only version of the core interaction: click a line number, leave a comment, and watch what happens when someone else is viewing the same snippet at the same time, the way new_comment events work over the real WebSocket connection. For the full thing with real accounts and sharing, use the live link above.

auth.js 👥 1 viewing

Technical decisions, straight from the project's own notes.

Backend
Node.js + Express
Database
PostgreSQL (Neon)
Real-time
Socket.io
Frontend
React + Vite
Styling
Tailwind CSS
Auth
JWT + bcryptjs
Deployment
Render (backend) · Neon (database) · Vercel (frontend)
🔌
Why Socket.io over SSE
Presence (who's viewing) needs bidirectional communication. Server-Sent Events are one-directional, so they can't tell the server when a user joins or leaves. Socket.io also handles reconnection automatically, which matters for a real-time app.
🔑
JWT in memory, not localStorage
Storing tokens in localStorage makes XSS attacks more dangerous, any malicious script can read it. Keeping the token in React state means it dies on refresh, an acceptable trade-off for this app. In production, httpOnly cookies would be the better choice.
🎲
crypto.randomBytes over nanoid
nanoid v4+ is ESM-only, which breaks CommonJS require. Node's built-in crypto.randomBytes(6).toString('base64url') gives the same 8-character URL-safe ID with no extra dependency.
🏗️
Render + Vercel, not one platform
Vercel's CDN is faster for static assets. Render runs a normal long-lived server, which WebSockets need, unlike serverless functions, which have timeouts that would kill a Socket.io connection mid-session.

Real files from the deployed project.

What I learned

Never trust what the client sends.

A socket message can contain anything, also from someone who is not using my page. The server checks every value before using it, because one unexpected type can take the whole server down for everyone.

Rooms make live updates simple.

Each snippet is a room. A new comment is sent only to the people in that room, and leaving has to be handled for closed tabs and lost connections too, or the viewer count goes wrong.

Working locally is only half of it.

Deployed, the frontend and backend have different addresses, so CORS, environment variables and the socket address all have to be right. None of that shows up on my own machine.