Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

19. Summary of Our Backend Series

Lesson 19 of 23 in the free Backend Development notes on Siksha Sarovar, written by Rohit Jangra.

The Complete Backend Journey

This lesson recaps everything built throughout the backend series — from the fundamental concepts to a full production-grade backend. By the end of this series, you have built a YouTube-like backend with users, videos, subscriptions, likes, comments, playlists, and tweets.

---

Architecture Overview

Client (React/Mobile)
     ↓ HTTPS
Nginx (Reverse Proxy, SSL Termination)
     ↓
Node.js + Express (Port 5000)
     ↓
Middlewares (CORS, Auth, Multer, Morgan)
     ↓
Routes → Controllers → Models
     ↓
MongoDB Atlas (Database)
     ↓ (for files)
Cloudinary (Image/Video Storage)

---

All Models Built — Recap Table

ModelKey FieldsPurpose
Userusername, email, password (hashed), avatar, coverImage, watchHistory, refreshTokenAuth + profile
VideovideoFile, thumbnail, title, description, duration, views, isPublished, ownerContent
Subscriptionsubscriber (User), channel (User)Follow system
LikelikedBy (User), video?, comment?, tweet?Polymorphic likes
Commentcontent, video, owner, createdAtVideo comments
Playlistname, description, videos[], ownerContent organisation
Tweetcontent (max 280 chars), ownerShort posts

---

All Controllers Built — Recap Table

FeatureControllers
AuthregisterUser, loginUser, logoutUser, refreshAccessToken
UsergetCurrentUser, getUserChannelProfile, getWatchHistory, updateAccountDetails, changeCurrentPassword, updateUserAvatar, updateCoverImage
VideogetAllVideos, publishVideo, getVideoById, updateVideo, deleteVideo, togglePublishStatus
CommentaddComment, updateComment, deleteComment, getVideoComments
LiketoggleVideoLike, toggleCommentLike, toggleTweetLike, getLikedVideos
PlaylistcreatePlaylist, getUserPlaylists, getPlaylistById, addVideoToPlaylist, removeVideoFromPlaylist, deletePlaylist
TweetcreateTweet, getUserTweets, updateTweet, deleteTweet
SubscriptiontoggleSubscription, getUserChannelSubscribers, getSubscribedChannels

---

Auth Flow Recap

  1. Register: validate → check duplicate → upload avatar → create user → return 201
  2. Login: find user → verify password → generate tokens → save refresh token → set cookies
  3. Authenticated Request: verifyJWT middleware reads cookie → verify JWT → attach req.user
  4. Token Refresh: read refresh cookie → verify → compare with DB → issue new access token
  5. Logout: clear cookies → remove refresh token from DB

---

File Upload Flow Recap

  1. Multer middleware reads multipart/form-data
  2. File saved to public/temp/ on server
  3. Controller reads req.file.path or req.files.fieldname[0].path
  4. uploadOnCloudinary(localPath) called
  5. Cloudinary returns { secure_url, public_id }
  6. Local temp file deleted
  7. secure_url stored in MongoDB

---

What to Build Next

TopicTool/Library
Unit and integration testingJest + Supertest
API documentationSwagger (swagger-jsdoc + swagger-ui-express)
Rate limitingexpress-rate-limit
Pagination (aggregation)mongoose-aggregate-paginate-v2
Full-text searchMongoDB Atlas Search or Algolia
CachingRedis + ioredis
Task queuesBull + Redis
Real-time featuresSocket.io (Lessons 22-23)

---

Career Path for Backend Developers

Entry Level (0-1 year):

  • REST API design and implementation
  • Mongoose, Express, basic auth with JWT
  • Deployment on Render/Railway

Mid Level (1-3 years):

  • System design basics (caching, queues, CDN)
  • PostgreSQL and SQL queries
  • Docker and basic CI/CD
  • Performance optimisation (indexes, N+1 queries)

Senior Level (3+ years):

  • Microservices architecture
  • Kafka/RabbitMQ for event-driven systems
  • Kubernetes, AWS/GCP cloud architecture
  • Database sharding and replication
  • Security auditing

---

Interview Topics to Prepare

  1. Explain the JWT authentication flow
  2. How does bcrypt work? Why is it used for passwords?
  3. What is CORS and how do you fix it?
  4. What is the difference between PUT and PATCH?
  5. What is an aggregation pipeline? Give an example
  6. How would you implement pagination in MongoDB?
  7. What is the N+1 problem? How do you solve it?
  8. Explain connection pooling
  9. What is the purpose of indexes in MongoDB?
  10. How does refresh token rotation prevent token theft?

Completing this backend series gives you the knowledge and portfolio project to confidently apply for backend developer roles in Indian tech companies.