Measured runtime and rendering behavior
preloadAuthQuery in server layouts/pages to reduce initial client waterfalls.usePaginatedQuery) and intersection-based infinite scrolling for feed and notifications.next/dynamic (ssr: false) for edit/delete dialogs.next/image with lazy loading and video pause-on-scroll via IntersectionObserver).useDebounce) to limit unnecessary backend traffic.Trust boundaries and protection model
proxy.ts by session-token cookie checks, redirecting unauthenticated users away from protected routes.requireAuth / requireAuthUserId helpers and return Unauthorized when missing auth.postMedia, avatar, chatImage) require authenticated middleware and enforce file type/size limits.What improved engineering quality over time
Resulting system quality and product impact
Building a serious product with high engineering standards? Let's architect it with clarity.
Start a Conversation
Slide 1 of 10
Z-Social is a full-stack Next.js 16 + Convex social platform that implements authenticated real-time feed, messaging, notifications, follow-requests for private accounts, and search over posts/usernames.
Implemented a hybrid feed system that combines follow-based pagination with discovery injection from friends-of-friends and engagement-ranked strangers.
Built real-time direct messaging with optimistic UI, image upload flow, cancel/retry handling, read-state updates, typing status, and online presence.
Implemented privacy-aware social graph behavior with private accounts, follow requests (pending/accepted/rejected), and conditional profile/post visibility.
Constraints and product-level risks
Implementation direction and execution strategy
Z-Social is a full-stack social networking application built with Next.js 16 App Router and Convex.
It delivers authenticated real-time feed, messaging, notifications, search, and profile workflows in a single web app.
The core goal is to provide a modern social experience with privacy-aware follow mechanics and responsive real-time updates.
System boundaries and layered decisions
The app uses Next.js App Router with server components for route/layout composition and metadata generation, then hydrates client feature components for interactive real-time behavior through Convex subscriptions.
Convex serves as backend, database, and real-time transport, with typed tables/indexes/search-indexes and dedicated modules for posts, comments, follows, messages, notifications, users, and search.
Business logic is implemented in Convex mutations/queries: feed construction and discovery injection, reaction/comment/mention notifications, private-account follow-request workflows, messaging presence/read-state, and profile visibility gating.
Next.js App Router
Structured Data Layer
Domain Boundaries
Runtime Discipline
Trust Boundaries
The app uses Next.js App Router with server-rendered route shells and metadata, then hydrates client feature modules that subscribe to live Convex queries.
(See architecture visual below.)