# mkbang2411-oss/block-4 architecture

> Architecture diagram of the GitHub repository mkbang2411-oss/block-4, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mkbang2411-oss/block-4
- Repository: https://github.com/mkbang2411-oss/block-4

## Overview

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: [`frontend/src/App.jsx`](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/App.jsx) (App State and Routes), [`frontend/src/components/StudentForm.jsx`](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentForm.jsx) (Student Form), [`frontend/src/pages/StudentsPage.jsx`](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/StudentsPage.jsx) (Directory Page), [`frontend/src/pages/Home.jsx`](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/Home.jsx) (Home Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client App"]
  node_app["App State and Routes<br/>[App.jsx]"]
  node_home["Home Page<br/>[Home.jsx]"]
  node_register["Registration Page<br/>[RegisterPage.jsx]"]
  node_form["Student Form<br/>[StudentForm.jsx]"]
  node_classselect["Class Selector<br/>[ClassSelect.jsx]"]
  node_clientvalidation["Client Validation<br/>[validators.js]"]
  node_error_boundary["Error Boundary<br/>[ErrorBoundary.jsx]"]
  node_bootstrap["React Bootstrap<br/>[main.jsx]"]
end

subgraph group_directory["Student Directory"]
  node_students_page["Directory Page<br/>[StudentsPage.jsx]"]
  node_student_ops["Search and Sort<br/>[students.js]"]
  node_student_list["Student List<br/>[StudentList.jsx]"]
  node_student_row["Student Row<br/>[StudentRow.jsx]"]
  node_detail["Student Profile<br/>[StudentDetail.jsx]"]
end

subgraph group_backend["API and Storage"]
  node_api_client["API Client<br/>[api.js]"]
  node_api_server["Student JSON API<br/>[server.js]"]
  node_server_validation["Server Validation<br/>[validators.js]"]
  node_sqlite[("SQLite Store<br/>[server.js]")]
end

subgraph group_presentation["Navigation and Effects"]
  node_transitions["Route Transitions<br/>[Transition.jsx]"]
  node_bubble["Bubble Titles<br/>[Bubble.jsx]"]
  node_piano["Piano Visual<br/>[Piano.jsx]"]
  node_effects["Global Effects<br/>[effects.js]"]
end

node_visitor(("Visitor"))

node_visitor -->|"opens app"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_students_page
node_app -->|"routes to"| node_detail
node_register -->|"renders"| node_form
node_form -->|"renders"| node_classselect
node_form -->|"validates with"| node_clientvalidation
node_form -->|"calls onAdd"| node_app
node_app -->|"fetches and creates"| node_api_client
node_api_client -->|"sends JSON requests"| node_api_server
node_api_server -->|"validates with"| node_server_validation
node_api_server -->|"reads and writes"| node_sqlite
node_app -->|"passes state"| node_students_page
node_students_page -->|"filters and sorts"| node_student_ops
node_students_page -->|"renders rows"| node_student_list
node_student_list -->|"renders"| node_student_row
node_app -->|"passes state"| node_detail
node_home -->|"renders"| node_piano
node_home -->|"renders"| node_bubble
node_app -->|"renders"| node_transitions
node_transitions -->|"renders"| node_bubble
node_transitions -->|"triggers bursts"| node_effects
node_bubble -->|"uses colors"| node_effects
node_app -->|"starts global effects"| node_effects
node_bootstrap -->|"renders"| node_app
node_bootstrap -->|"wraps app"| node_error_boundary

click node_app "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/App.jsx"
click node_home "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/Home.jsx"
click node_register "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/RegisterPage.jsx"
click node_form "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentForm.jsx"
click node_classselect "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/ClassSelect.jsx"
click node_clientvalidation "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/validators.js"
click node_students_page "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/StudentsPage.jsx"
click node_student_ops "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/students.js"
click node_student_list "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentList.jsx"
click node_student_row "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentRow.jsx"
click node_detail "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/StudentDetail.jsx"
click node_api_client "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/api.js"
click node_api_server "https://github.com/mkbang2411-oss/block-4/blob/main/backend/server.js"
click node_server_validation "https://github.com/mkbang2411-oss/block-4/blob/main/backend/validators.js"
click node_sqlite "https://github.com/mkbang2411-oss/block-4/blob/main/backend/server.js"
click node_transitions "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/Transition.jsx"
click node_bubble "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/Bubble.jsx"
click node_piano "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/Piano.jsx"
click node_effects "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/effects.js"
click node_error_boundary "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/ErrorBoundary.jsx"
click node_bootstrap "https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/main.jsx"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_home,node_register,node_form,node_classselect,node_clientvalidation,node_error_boundary,node_bootstrap toneBlue
class node_students_page,node_student_ops,node_student_list,node_student_row,node_detail toneAmber
class node_api_client,node_api_server,node_server_validation,node_sqlite toneMint
class node_transitions,node_bubble,node_piano,node_effects toneRose
class node_visitor toneIndigo
```

## Components

### Client App

- [App State and Routes](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Home Page](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/Home.jsx): `frontend/src/pages/Home.jsx`
- [Registration Page](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/RegisterPage.jsx): `frontend/src/pages/RegisterPage.jsx`
- [Student Form](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentForm.jsx): `frontend/src/components/StudentForm.jsx`
- [Class Selector](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/ClassSelect.jsx): `frontend/src/components/ClassSelect.jsx`
- [Client Validation](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/validators.js): `frontend/src/lib/validators.js`
- [Error Boundary](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/ErrorBoundary.jsx): `frontend/src/components/ErrorBoundary.jsx`
- [React Bootstrap](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`

### Student Directory

- [Directory Page](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/StudentsPage.jsx): `frontend/src/pages/StudentsPage.jsx`
- [Search and Sort](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/students.js): `frontend/src/lib/students.js`
- [Student List](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentList.jsx): `frontend/src/components/StudentList.jsx`
- [Student Row](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/StudentRow.jsx): `frontend/src/components/StudentRow.jsx`
- [Student Profile](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/pages/StudentDetail.jsx): `frontend/src/pages/StudentDetail.jsx`

### API and Storage

- [API Client](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/api.js): `frontend/src/lib/api.js`
- [Student JSON API](https://github.com/mkbang2411-oss/block-4/blob/main/backend/server.js): `backend/server.js`
- [Server Validation](https://github.com/mkbang2411-oss/block-4/blob/main/backend/validators.js): `backend/validators.js`
- [SQLite Store](https://github.com/mkbang2411-oss/block-4/blob/main/backend/server.js): `backend/server.js`

### Navigation and Effects

- [Route Transitions](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/Transition.jsx): `frontend/src/components/Transition.jsx`
- [Bubble Titles](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/Bubble.jsx): `frontend/src/components/Bubble.jsx`
- [Piano Visual](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/components/Piano.jsx): `frontend/src/components/Piano.jsx`
- [Global Effects](https://github.com/mkbang2411-oss/block-4/blob/main/frontend/src/lib/effects.js): `frontend/src/lib/effects.js`

### Other components

- **Visitor**

## Connections

- Visitor → App State and Routes: opens app (evidence: `README.md`)
- App State and Routes → Home Page: routes to (evidence: `frontend/src/App.jsx`)
- App State and Routes → Registration Page: routes to (evidence: `frontend/src/App.jsx`)
- App State and Routes → Directory Page: routes to (evidence: `frontend/src/App.jsx`)
- App State and Routes → Student Profile: routes to (evidence: `frontend/src/App.jsx`)
- Registration Page → Student Form: renders (evidence: `frontend/src/pages/RegisterPage.jsx`)
- Student Form → Class Selector: renders (evidence: `frontend/src/components/StudentForm.jsx`)
- Student Form → Client Validation: validates with (evidence: `frontend/src/components/StudentForm.jsx`)
- Student Form → App State and Routes: calls onAdd (evidence: `README.md`)
- App State and Routes → API Client: fetches and creates (evidence: `frontend/src/App.jsx`)
- API Client → Student JSON API: sends JSON requests (evidence: `README.md`)
- Student JSON API → Server Validation: validates with (evidence: `backend/server.js`)
- Student JSON API → SQLite Store: reads and writes (evidence: `README.md`)
- App State and Routes → Directory Page: passes state (evidence: `frontend/src/App.jsx`)
- Directory Page → Search and Sort: filters and sorts (evidence: `frontend/src/pages/StudentsPage.jsx`)
- Directory Page → Student List: renders rows (evidence: `frontend/src/pages/StudentsPage.jsx`)
- Student List → Student Row: renders (evidence: `frontend/src/components/StudentList.jsx`)
- App State and Routes → Student Profile: passes state (evidence: `frontend/src/App.jsx`)
- Home Page → Piano Visual: renders (evidence: `frontend/src/pages/Home.jsx`)
- Home Page → Bubble Titles: renders (evidence: `frontend/src/pages/Home.jsx`)
- App State and Routes → Route Transitions: renders (evidence: `frontend/src/App.jsx`)
- Route Transitions → Bubble Titles: renders (evidence: `frontend/src/components/Transition.jsx`)
- Route Transitions → Global Effects: triggers bursts (evidence: `frontend/src/components/Transition.jsx`)
- Bubble Titles → Global Effects: uses colors (evidence: `frontend/src/components/Bubble.jsx`)
- App State and Routes → Global Effects: starts global effects (evidence: `frontend/src/App.jsx`)
- React Bootstrap → App State and Routes: renders (evidence: `frontend/src/main.jsx`)
- React Bootstrap → Error Boundary: wraps app (evidence: `frontend/src/main.jsx`)
