Prasoon Soni

All projects

Social Media Backend

A production-shaped REST backend for a social app.

Source code

Overview

A complete Node/Express backend implementing the core of a social network — authentication, users, and social operations — with JWT auth, hashed passwords, and a clean controllers/models/routes structure ready to build a client on top of.

The problem

Every social app re-implements the same backbone: secure auth, user models, and social-graph operations. This is a reusable, well-structured starting point for exactly that groundwork.

Architecture

  1. Client: Your app (Web or mobile, built on top)
  2. (REST + JWT) Routes [Express app]: Express routes (REST endpoints)
  3. Logic [Express app]: Controllers (Auth, users, social operations)
  4. Models [Express app]: Mongoose models (Users and the social graph)
  5. Data: MongoDB

Routes, controllers and models are kept apart, so each feature has an obvious place to live.

Approach

JWT auth + hashed passwords

Authentication with JSON Web Tokens and bcrypt-hashed credentials, so the auth layer is production-shaped from the start.

A clean architecture

Separated controllers, Mongoose models, and routes keep the codebase readable and easy to extend as features grow.

Quality tooling

ESLint and Prettier enforce consistency, and a Vercel-ready config makes deployment a one-step affair.

Highlights

  • JWT authentication with bcrypt-hashed passwords
  • Mongoose models over MongoDB
  • Controllers / models / routes separation
  • ESLint + Prettier, Vercel-ready

Stack

Node.js, Express.js, MongoDB, Mongoose, JWT