Project: A Student Dashboard
💻 ReactBuild a small dashboard with data loading, search, routing and reusable cards.
This project brings components, props, state, effects and routing together into one interface you could show a school.
- Structure a small React app.
- Load and filter data.
- Handle loading, error and empty states.
Plan the Screens
Build a dashboard page that lists students, a search field and a detail page. Keep the data fetching in one place and pass results down as props.
Search and Filter
Derive the filtered list during render instead of storing it in state. Derived values cannot fall out of sync.
const [query, setQuery] = useState("");
const filtered = students.filter(student =>
student.name.toLowerCase().includes(query.toLowerCase())
);Reusable Cards
Build a StudentCard that takes a student and an onSelect callback. The card does not fetch anything, which makes it easy to reuse and test.
States
Show loading first, then an error, then an empty result, then the list. Handle every one explicitly so the screen never looks broken.
Practice
- Add a filter by level.
- Show the number of matching students.
- Add a detail page that fetches one student by id.
Hands-on exercise
Build the student dashboard.
1. Fetch students on mount.
2. Show loading, error and empty states.
3. Search by name.
4. Render each result with a reusable StudentCard.
5. Link each card to /students/:id.
Recap
A real interface combines data loading, derived state, reusable components and explicit empty and error states.
Example
const [query, setQuery] = useState("");
const filtered = students.filter(student =>
student.name.toLowerCase().includes(query.toLowerCase())
);
Exercises
1. Fetch students on mount.
2. Show loading, error and empty states.
3. Search by name.
4. Render each result with a reusable StudentCard.
5. Link each card to /students/:id.
Expected Output
A searchable dashboard with all states handled.
Lesson Nav
React Course
0/9 lessons completed
- 1 Thinking in Components Tutorial
- 2 Props and Composition Tutorial
- 3 State and Events Tutorial
- 4 Lists, Keys and Conditional Rendering Tutorial
- 5 Forms in React Tutorial
- 6 Effects and Data Fetching Tutorial
- 7 Routing and Layouts Tutorial
- 8 Context and Shared State Tutorial
- 9 Project: A Student Dashboard Project