How poxndering/book_library works
Book Library App is a full-stack personal book catalog with login, book management, and category statistics. Users enter through the login page; the login form delegates authentication state to the context, while the frontend services communicate with the Express API. API routes dispatch to authentication and book controllers, which access the configured database. The README documents PostgreSQL and SQLite options and describes the protected book dashboard. Some dashboard-to-component and context-to-service wiring is not shown in the sampled source, so those links are marked unverified.
Main entry points: page.js Book dashboard · LoginForm.js Login form · BookForm.js Book form · api.js API client
Components 25
Frontend app
- Login page
frontend/app/(auth)/login/page.js - Login form
frontend/components/features/auth/LoginForm.js - Auth context
frontend/context/AuthContext.js - Book dashboard
frontend/app/(protected)/book-dashboard/page.js - Book form
frontend/components/features/books/BookForm.js - Book list
frontend/components/features/books/BookList.js - Book statistics
frontend/components/features/books/BookStats.js - Auth service
frontend/services/authService.js - Book service
frontend/services/bookService.js - API client
frontend/services/api.js - Token storage
frontend/utils/auth.js
Backend API
- Express server
backend/src/server.js - API route index
backend/src/routes/index.js - Auth routes
backend/src/routes/auth.routes.js - Book routes
backend/src/routes/book.routes.js - Login controller
backend/src/controllers/auth.controller.js - Book controller
backend/src/controllers/book.controller.js - Auth middleware
backend/src/middlewares/auth.middleware.js
Data storage
- Database config
backend/src/config/db.js - Knex configuration
backend/knexfile.js - PostgreSQL / SQLite
UI components
- Input control
frontend/components/ui/Input.js - Button control
frontend/components/ui/Button.js - Select control
frontend/components/ui/Select.js
Other components
- Library user
Connections 30
- Library user → Login page: opens
README.md - Login page → Login form: renders
frontend/app/(auth)/login/page.js - Login form → Auth context: uses login
frontend/components/features/auth/LoginForm.js - Login form → Input control: renders
frontend/components/features/auth/LoginForm.js - Login form → Button control: renders
frontend/components/features/auth/LoginForm.js - Auth context → Auth service: delegates
- Auth service → API client: sends login
frontend/services/authService.js - Auth service → Token storage: stores token
frontend/services/authService.js - API client → Token storage: reads token
frontend/services/api.js - API client → Express server: calls API
- Library user → Book dashboard: manages books
README.md - Book dashboard → Book form: uses
- Book dashboard → Book list: uses
- Book dashboard → Book statistics: uses
- Book form → Select control: renders
frontend/components/features/books/BookForm.js - Book form → Input control: renders
frontend/components/features/books/BookForm.js - Book form → Button control: renders
frontend/components/features/books/BookForm.js - Book dashboard → Book service: loads books
- Book service → API client: sends requests
frontend/services/bookService.js - Express server → API route index: mounts routes
backend/src/server.js - API route index → Auth routes: registers
backend/src/routes/index.js - API route index → Book routes: registers
backend/src/routes/index.js - Auth routes → Login controller: dispatches login
backend/src/routes/auth.routes.js - Book routes → Book controller: dispatches books
backend/src/routes/book.routes.js - Book routes → Auth middleware: protects writes
backend/src/routes/book.routes.js - Login controller → Database config: queries users
backend/src/controllers/auth.controller.js - Book controller → Database config: queries books
backend/src/controllers/book.controller.js - Database config → Knex configuration: loads config
backend/src/config/db.js - Knex configuration → PostgreSQL / SQLite: configures connection
README.md - Database config → PostgreSQL / SQLite: accesses records