How phone-myint-arkar/rsu-bgc works
BoardHub is a board-game lending application: members browse games, request quantities, and track borrowing status; staff manage inventory and requests, while admins manage user roles. The graph follows the documented UI-to-API paths where excerpts show them and the auth/database layer. Several pages and endpoints are indexed but not excerpted, so links for those capabilities rely on index references; uncertain internal calls are omitted.
Main entry points: auth.js Session and permissions · db.js MySQL pool · route.js Borrowings API · AuthForm.js Login and registration form
Components 20
Member experience
- Catalog and game cards
components/GameCatalog.js - Game detail
app/games/[id]/page.js - Borrow request action
components/BorrowButton.js - Login and registration form
components/AuthForm.js - My borrowings
app/my-borrowings/page.js
Staff operations
- Inventory management
components/StaffGameManager.js - Request review
components/RequestManager.js - User role management
components/UserManager.js
Application API
- Games API
app/api/games/route.js - Game item API
app/api/games/[id]/route.js - Borrowings API
app/api/borrowings/route.js - Borrowing status API
app/api/borrowings/[id]/route.js - Users API
app/api/users/route.js - Login endpoint
app/api/login/route.js - Registration endpoint
app/api/register/route.js - Session endpoints
app/api/me/route.js
Identity and persistence
- Session and permissions
lib/auth.js - Role permission rules
lib/rbac.js - MySQL pool
lib/db.js
Other components
- Member or visitor
Connections 27
- Member or visitor → Catalog and game cards: browses
- Catalog and game cards → Game detail: opens game
- Game detail → Borrow request action: offers request
app/games/[id]/page.js - Borrow request action → Borrowings API: creates request
app/api/borrowings/route.js - Member or visitor → Login and registration form: submits credentials
components/AuthForm.js - Login and registration form → Login endpoint: posts login
components/AuthForm.js - Login and registration form → Registration endpoint: posts registration
components/AuthForm.js - My borrowings → Borrowings API: loads requests
app/api/borrowings/route.js - Inventory management → Games API: adds game
components/StaffGameManager.js - Request review → Borrowing status API: updates status
components/RequestManager.js - User role management → Users API: changes role
components/UserManager.js - Games API → Session and permissions: checks permission
app/api/games/route.js - Game item API → Session and permissions: checks permission
app/api/games/[id]/route.js - Borrowings API → Session and permissions: checks permission
app/api/borrowings/route.js - Borrowing status API → Session and permissions: checks permission
app/api/borrowings/[id]/route.js - Users API → Session and permissions: checks permission
app/api/users/route.js - Login endpoint → Session and permissions: creates session
app/api/login/route.js - Registration endpoint → Session and permissions: creates session
app/api/register/route.js - Session endpoints → Session and permissions: reads session
app/api/me/route.js - Session and permissions → MySQL pool: loads current user
lib/auth.js - Session and permissions → Role permission rules: checks role
lib/auth.js - Games API → MySQL pool: reads and writes games
app/api/games/route.js - Game item API → MySQL pool: accesses game
app/api/games/[id]/route.js - Borrowings API → MySQL pool: creates and lists
app/api/borrowings/route.js - Borrowing status API → MySQL pool: updates borrowing
app/api/borrowings/[id]/route.js - Users API → MySQL pool: reads and updates users
app/api/users/route.js - Registration endpoint → MySQL pool: creates account
app/api/register/route.js