Engineers ke liye

Yeh product asli mein bana kaise hai

Read in English

Chitrio ek chalta hua SaaS product hai: front pe React, back pe C# aur .NET, SQL Server, background jobs, aur video ka kaam FFmpeg karta hai. Yeh page basics se shuru hota hai - har React hook aur woh asli mein kahan use hua hai - phir un bugs tak jaata hai jo production tak pahunche aur unko theek karne wala code. Sab asli shipped code hai, koi banaya hua example nahi.

74
React components
144
C# services
39
API controllers
64k
lines of code

Padhne se pehle, product ko ek baar use karke dekho

Neeche har chapter ek asli product banate waqt liya gaya decision hai. Jab tumne dekh liya ki yeh banata kya hai, tab yeh sab kaafi zyada samajh aata hai: home page pe ek topic likho aur doosri taraf se poori video nikalte dekho. Wahan das minute lagane se yeh page theoretical se practical ho jaata hai.

Card ki zarurat nahi, aur pehli script ka koi paisa nahi lagta.

Buniyaad

Yahin se shuru karo. Har ek cheez ek building block hai jo har project mein kaam aayegi, aur saath mein wahi code hai jo abhi is product mein yeh kaam kar raha hai.

The problem

Ek normal JavaScript variable value to rakh leta hai, par usse badalne se screen dobara draw nahi hoti. Box mein type karo, variable mein rakho, aur screen pe kuch nahi hota.

Why it happens

useState do cheezein deta hai: abhi ki value, aur usse set karne wala function. Setter ko call karna React ko batata hai ki "yeh badal gaya, dobara draw karo". Bas itna hi idea hai, aur lagbhag har interactive component yahin se shuru hota hai. Is codebase mein 74 files ise use karti hain.

Real code from this product

const [topic, setTopic] = useState('');

<input
  value={topic}
  onChange={(e) => setTopic(e.target.value)}
  placeholder="e.g. Why the sky is blue"
/>
<button disabled={!topic.trim()}>Generate script</button>

What to take away

Input wahi dikhata hai jo state kehti hai, aur type karne se state update hoti hai. Yeh loop - state screen banati hai, events state badalte hain - ek line mein React hai. Dhyan do ki button bhi wahi state padhkar decide karta hai ki woh chalne layak hai ya nahi: ek hi sach, do jagah use ho raha hai.

Try it yourself

Ek box banao jo batata ho ki tumne kitne characters type kiye. Phir wahi cheez normal variable se karke dekho aur dekho ki kuch nahi hota.

Kaam aaya?

Every React hook in this codebase

Counted across 74 components. The pattern worth noticing: the two simplest hooks do almost all the work, and the exotic ones appear once or twice for one reason each.

HookFilesWhat it is forWhere we use it
useState74Screen pe badalne wali cheez yaad rakhnaHar jagah. Topic box, har toggle, har khulne-band hone wala panel.
useEffect72React ke bahar ki duniya se baat karnaRender ka progress poochna, archive fetch karna, Escape key sunna.
useCallback33Do renders ke beech function ki identity same rakhnaChild panels ko diye gaye handlers, taaki woh bevajah dobara render na hon.
useRef30Yaad rakhna, bina dobara render kiyeEk baar wale guards ("yeh sirf ek baar default karo"), aur DOM node pakadna.
useMemo7Mehngi cheez baar baar calculate karne se bachnaLambi archive list ko search box mein type karte waqt filter aur group karna.
useContext2Har level pe props bheje bina data share karnaKaun signed in hai. Ek AuthContext, jise koi bhi component padh sakta hai.
useLayoutEffect1Browser ke paint karne se PEHLE page naapnaShare dropdown ki position. useEffect se woh visibly jump karta dikhta.
useSearchParams1State ko URL mein rakhnaDashboard tab: ?tab=history refresh ke baad bhi rehta hai aur share ho sakta hai.

Also used: createPortal in 19 components (modals, dropdowns and toasts), which is not a hook but solves the same class of problem - getting out of a parent that clips you.

Docker aur scale

Ek hi build har jagah kaise chalta hai, kaam queue kaise hota hai, aur traffic aane par asli mein hota kya hai. Patterns, humare servers ka naksha nahi.

Security

Woh galtiyan jinse product breach hote hain, aur woh structural aadatein jo un galtiyon ko karna mushkil bana deti hain.

AI jo khud ko sambhaalta hai

Do system jo zyadatar products mein hote hi nahi: production errors jo pull request ban jaate hain, aur ek product jo user feedback se seekhta hai bina koi model dobara train kiye. Patterns, humara internal setup nahi.

Mehngi seekhein

Woh bugs jo production tak pahunch gaye. Har ek ne asli time ya paisa liya, aur inmein se koi bhi kisi tutorial mein nahi milega.

What should we explain next?

This page grows from what readers ask for. Tell us what you are stuck on, or what was unclear above.

Imaandar stack list

React 18 with plain JavaScript (no TypeScript in this codebase), Tailwind for styling, ASP.NET Core 8 and C# on the server, Entity Framework Core over SQL Server, Hangfire for background jobs, FFmpeg for every frame of video, and a set of AI APIs for script, voice, images and motion. Nothing here is chosen to sound impressive - each piece is doing a job you can see in the product.

The most useful habit behind all of it: when something looks wrong, measure the actual output rather than trusting the log line. Most of the lessons above were found by opening a finished file, not by reading code.

Your next 30 videos are one topic away.

Type a topic. Watch a finished video come back. Decide after you have seen it.

No card neededFree credits on signupFirst video in about 3 minutesCancel anytime, keep your credits