How mkbang2411-oss/block-4 works
Block-4 is a client-rendered student registration and directory app. Visitors can browse the home page, register a student, search/filter/sort/page through the directory, and open student profiles. The main write flow is controlled form → App-owned add operation → JSON API → SQLite, then the saved record updates shared client state and appears in the directory. The graph also preserves the app’s navigation/visual-effects layer and both client- and server-side validation. Backend internals and the API helper are only partly sampled; documented links are cited to the README.
Main entry points: App.jsx App State and Routes · StudentForm.jsx Student Form · StudentsPage.jsx Directory Page · Home.jsx Home Page
Components 22
Client App
- App State and Routes
frontend/src/App.jsx - Home Page
frontend/src/pages/Home.jsx - Registration Page
frontend/src/pages/RegisterPage.jsx - Student Form
frontend/src/components/StudentForm.jsx - Class Selector
frontend/src/components/ClassSelect.jsx - Client Validation
frontend/src/lib/validators.js - Error Boundary
frontend/src/components/ErrorBoundary.jsx - React Bootstrap
frontend/src/main.jsx
Student Directory
- Directory Page
frontend/src/pages/StudentsPage.jsx - Search and Sort
frontend/src/lib/students.js - Student List
frontend/src/components/StudentList.jsx - Student Row
frontend/src/components/StudentRow.jsx - Student Profile
frontend/src/pages/StudentDetail.jsx
API and Storage
- API Client
frontend/src/lib/api.js - Student JSON API
backend/server.js - Server Validation
backend/validators.js - SQLite Store
backend/server.js
Navigation and Effects
- Route Transitions
frontend/src/components/Transition.jsx - Bubble Titles
frontend/src/components/Bubble.jsx - Piano Visual
frontend/src/components/Piano.jsx - Global Effects
frontend/src/lib/effects.js
Other components
- Visitor
Connections 27
- Visitor → App State and Routes: opens app
README.md - App State and Routes → Home Page: routes to
frontend/src/App.jsx - App State and Routes → Registration Page: routes to
frontend/src/App.jsx - App State and Routes → Directory Page: routes to
frontend/src/App.jsx - App State and Routes → Student Profile: routes to
frontend/src/App.jsx - Registration Page → Student Form: renders
frontend/src/pages/RegisterPage.jsx - Student Form → Class Selector: renders
frontend/src/components/StudentForm.jsx - Student Form → Client Validation: validates with
frontend/src/components/StudentForm.jsx - Student Form → App State and Routes: calls onAdd
README.md - App State and Routes → API Client: fetches and creates
frontend/src/App.jsx - API Client → Student JSON API: sends JSON requests
README.md - Student JSON API → Server Validation: validates with
backend/server.js - Student JSON API → SQLite Store: reads and writes
README.md - App State and Routes → Directory Page: passes state
frontend/src/App.jsx - Directory Page → Search and Sort: filters and sorts
frontend/src/pages/StudentsPage.jsx - Directory Page → Student List: renders rows
frontend/src/pages/StudentsPage.jsx - Student List → Student Row: renders
frontend/src/components/StudentList.jsx - App State and Routes → Student Profile: passes state
frontend/src/App.jsx - Home Page → Piano Visual: renders
frontend/src/pages/Home.jsx - Home Page → Bubble Titles: renders
frontend/src/pages/Home.jsx - App State and Routes → Route Transitions: renders
frontend/src/App.jsx - Route Transitions → Bubble Titles: renders
frontend/src/components/Transition.jsx - Route Transitions → Global Effects: triggers bursts
frontend/src/components/Transition.jsx - Bubble Titles → Global Effects: uses colors
frontend/src/components/Bubble.jsx - App State and Routes → Global Effects: starts global effects
frontend/src/App.jsx - React Bootstrap → App State and Routes: renders
frontend/src/main.jsx - React Bootstrap → Error Boundary: wraps app
frontend/src/main.jsx