Skip to main content

Tech Stack

Frontend — React.js

The client is a single-page application built with React.js.

ConcernApproach
UI renderingFunctional components with React hooks
RoutingClient-side routing (React Router)
API communicationDedicated API client layer (fetch/axios wrapper)
State managementComponent-local state + React Context for auth/user
Optimistic updatesApplied to likes and follow actions for snappy UX
Error handlingCentralized error boundary and per-request error states

Why React?

React's component model allows clean separation of UI concerns. Its large ecosystem, strong TypeScript support, and Vercel's first-class deployment make it a natural fit for this project.


Backend — Node.js + Express

The server is a RESTful API built with Node.js and Express.

ConcernApproach
API styleREST — resource-oriented routes
MiddlewareAuth verification, input validation, error handler
AuthenticationJWT (access + refresh tokens)
Response formatConsistent JSON envelope ({ data, error, status })
Error handlingCentralized Express error middleware

Why Express?

Express is lightweight and unopinionated, which kept the server simple and easy to reason about. Middleware composition made it straightforward to add auth, validation, and logging cross-cutting concerns.


Database — MongoDB

MongoDB stores all application data using a document-oriented model.

ConcernApproach
UsersSingle collection, indexed by email/username
Posts & repliesSeparate collections or nested docs
FollowsJunction-style documents (followerId, followingId)
LikesJunction-style documents (userId, postId)
IndexingCompound indexes on author + createdAt, follower pairs

Why MongoDB?

The flexible document model suits social content (variable post structure, embedded counts). It also allowed rapid iteration on the data schema during development.


Deployment — Vercel

Both the frontend (React SPA) and the Node.js API are deployed on Vercel.

ConcernApproach
Frontend hostingVercel static/SPA hosting
API hostingVercel Serverless Functions
Environment separationDev vs. Production via Vercel project settings
Secrets managementEnvironment variables configured in Vercel dashboard (not in code)

Why Vercel?

Vercel provides zero-config deployment for React and Node.js projects, integrated preview deployments for every PR, and a generous free tier suitable for portfolio projects.


Summary table

LayerTechnologyVersion range
FrontendReact.js18.x
RoutingReact Router6.x
BackendNode.js20.x
FrameworkExpress4.x
DatabaseMongoDB7.x
ODMMongoose (or native driver)8.x
AuthJSON Web Tokens (JWT)
DeploymentVercel