React Basics · Course lab · about 240 minutes · 6 tasks · marked out of 100, pass at 60
The fee tracker in React, deployed to a real URL
The situation
You built the fee tracker in plain JavaScript. Now build it the React way — components, props, state, derived values — add a live users directory that fetches real data and handles every state, deploy it to a public URL, and open it on your phone. The comparison with your plain-JS version is the point of the course, and you will write it down.
What you'll be able to show
- Compose an app from components in their own files
- Render lists from data with map and key, and pass functions down
- Keep state minimal and derive everything else in render
- Fetch with loading, error and success states, and deploy
What you need
- Node LTS, a Vite React app, VS Code
- jsonplaceholder's users endpoint
- A free host (Netlify or Vercel) and your phone
Tasks
-
1Components in filesCreate Header, StudentCard and Footer in their own files and compose them in App. Render StudentCard three times from an array with map and a key. Pass an onSelect function down; clicking a card logs that student's name from the parent.A correct result: Three cards from data; a console log from the parent on click.
-
2The tracker, in stateStudents array in state; a controlled add-form (name, fee due, fee paid); add via spread into a new array; delete via filter; a live total outstanding derived from the array in render; an all-clear message that renders only when nothing is due.A correct result: Adding, deleting and the total all work with no second copy of any number in state.
-
3The comparisonPut your plain-JS tracker and the React one side by side. Write five sentences: line count, what got simpler, what got harder, and where React's rules stopped a bug you had before.A correct result: Five honest sentences with the two line counts.
-
4The users directoryFetch jsonplaceholder users on mount. Render loading, error and success states. Add a controlled search box that filters by name as a derived value — no second list in state. UserCard is its own component. Kill your wifi mid-load once to see the error state earn its keep.A correct result: All three states visible on demand; search filters without a second list.
-
5Deploynpm run build, deploy to Netlify or Vercel, open the live URL on your phone. Put the link somewhere permanent (CV draft, LinkedIn).A correct result: A public URL that works on a phone.
-
6The 30-day planWrite four named projects with dates. Start the first today — even if only the empty Vite app and a README stating what it will become.A correct result: Four projects with dates and the first repo created.
What to hand in
The repo URL, the live URL, a phone screenshot, the five comparison sentences, and the 30-day plan.
How it is marked
| Criterion | Points |
|---|---|
| Components composed from files with map, key and a passed-down function | 15 |
| Tracker works with minimal state and derived totals | 25 |
| Comparison is honest and specific | 10 |
| Directory handles loading, error and success; search is derived | 25 |
| Deployed and checked on a phone | 15 |
| 30-day plan with the first project started | 10 |
| Total · pass at 60 | 100 |
صورتحال
آپ نے فیس tracker سادہ JavaScript میں بنایا۔ اب اسے React کے طریقے سے بنائیں — components، props، state، derived values — ایک live users directory شامل کریں جو حقیقی data fetch کرے اور ہر state سنبھالے، اسے public URL پر deploy کریں، اور اپنے phone پر کھولیں۔ اپنے سادہ-JS نسخے سے موازنہ ہی کورس کا مقصد ہے، اور آپ اسے لکھیں گے۔
آپ کیا دکھا سکیں گے
- اپنی اپنی files میں components سے app بنانا
- map اور key سے data سے lists render کرنا، اور functions نیچے بھیجنا
- state کم سے کم رکھنا اور باقی سب render میں نکالنا
- loading، error اور success states کے ساتھ fetch کرنا، اور deploy کرنا
آپ کو کیا چاہیے
- Node LTS، ایک Vite React app، VS Code
- jsonplaceholder کا users endpoint
- ایک مفت host (Netlify یا Vercel) اور آپ کا phone
کام
-
1files میں componentsHeader، StudentCard اور Footer اپنی اپنی files میں بنائیں اور App میں جوڑیں۔ StudentCard کو array سے map اور key کے ساتھ تین بار render کریں۔ ایک onSelect function نیچے بھیجیں؛ card پر click کرنے سے parent اس student کا نام log کرے۔درست نتیجہ: data سے تین cards؛ click پر parent سے console log۔
-
2tracker، state میںstate میں students کی array؛ ایک controlled add-form (نام، فیس واجب، فیس ادا)؛ spread سے نئی array میں شامل کرنا؛ filter سے delete؛ render میں array سے نکلا ہوا live کل بقایا؛ ایک all-clear پیغام جو صرف تب render ہو جب کچھ واجب نہ ہو۔درست نتیجہ: شامل کرنا، delete اور total سب کام کریں، state میں کسی نمبر کی دوسری copy کے بغیر۔
-
3موازنہاپنا سادہ-JS tracker اور React والا ساتھ ساتھ رکھیں۔ پانچ جملے لکھیں: lines کی تعداد، کیا آسان ہوا، کیا مشکل ہوا، اور React کے اصولوں نے کہاں آپ کا پرانا bug روکا۔درست نتیجہ: دونوں line counts کے ساتھ پانچ ایماندار جملے۔
-
4users directorymount پر jsonplaceholder users fetch کریں۔ loading، error اور success states render کریں۔ ایک controlled search box شامل کریں جو نام سے derived value کے طور پر filter کرے — state میں دوسری list نہیں۔ UserCard اپنا الگ component ہو۔ load کے دوران ایک بار wifi بند کریں تاکہ error state اپنا کام کرتی دکھے۔درست نتیجہ: تینوں states مانگنے پر نظر آئیں؛ search دوسری list کے بغیر filter کرے۔
-
5deploynpm run build، Netlify یا Vercel پر deploy کریں، live URL اپنے phone پر کھولیں۔ link کہیں مستقل رکھیں (CV کا مسودہ، LinkedIn)۔درست نتیجہ: ایک public URL جو phone پر کام کرے۔
-
630 دن کا منصوبہتاریخوں کے ساتھ چار نامزد projects لکھیں۔ پہلا آج ہی شروع کریں — چاہے صرف خالی Vite app اور ایک README جو بتائے کہ یہ کیا بنے گا۔درست نتیجہ: تاریخوں کے ساتھ چار projects اور پہلا repo بنا ہوا۔
کیا جمع کروانا ہے
repo کا URL، live URL، phone کا screenshot، موازنے کے پانچ جملے، اور 30 دن کا منصوبہ۔
نمبر کیسے ملیں گے
| معیار | نمبر |
|---|---|
| files سے components، map، key اور نیچے بھیجا ہوا function | 15 |
| tracker کم سے کم state اور derived totals کے ساتھ کام کرتا ہے | 25 |
| موازنہ ایماندار اور مخصوص ہے | 10 |
| directory loading، error اور success سنبھالتی ہے؛ search derived ہے | 25 |
| deploy ہوا اور phone پر چیک ہوا | 15 |
| 30 دن کا منصوبہ، پہلا project شروع | 10 |
| کل · پاس 60 | 100 |
Hand in your lab
Create a free BvLogic ID to hand in your lab, get it marked, and have it on your certificate.
Create your BvLogic IDAlready have one? Sign in and this course will be added to it.