How davidquicoc/biblioteca_mvc_coding works
Biblioteca_MVC_coding is a PHP MVC library-management application for user registration and login, book CRUD, loans and returns, and a dashboard of library and user-loan statistics. The main workflow starts at the front controller, routes an action to a controller, uses models for database operations, and renders a view; loan actions also update book availability. The README documents the CRUD domains, while the sampled source confirms routing and much of the runtime flow. Prestamo model and some views are indexed but not sampled, so their internal behavior is not expanded.
Main entry points: PrestamoController.php Loan controller · router.php Action router · BookController.php Book controller · Libro.php Book model
Components 22
Application Core
- Front controller
index.php - Action router
core/router.php - Session helpers
core/session.php - DB connection
config/config.php - Dashboard controller
controllers/DashboardController.php
Authentication
- Auth controller
controllers/AuthController.php - User model
models/Usuario.php
Book Catalog
- Book controller
controllers/BookController.php - Book model
models/Libro.php
Loan Management
- Loan controller
controllers/PrestamoController.php - Loan model
models/Prestamo.php
Views
- Login view
views/auth/login.php - Registration view
views/auth/register.php - Book list view
views/libros/index.php - Book creation view
views/libros/create.php - Book edit view
views/libros/edit.php - Loan view
views/prestamos/index.php - Dashboard view
views/index.php - Shared header
views/layout/header.php - Shared footer
views/layout/footer.php
Other components
- Library user
- Biblioteca database
Connections 36
- Library user → Front controller: requests pages
index.php - Front controller → Session helpers: starts session
index.php - Front controller → Action router: loads routes
index.php - Action router → Auth controller: dispatches auth
core/router.php - Action router → Book controller: dispatches books
core/router.php - Action router → Loan controller: dispatches loans
core/router.php - Action router → Dashboard controller: dispatches default
core/router.php - Action router → Session helpers: loads helpers
core/router.php - Auth controller → User model: checks or saves
controllers/AuthController.php - Auth controller → Login view: renders login
controllers/AuthController.php - Auth controller → Registration view: renders registration
controllers/AuthController.php - Book controller → Session helpers: requires login
controllers/BookController.php - Book controller → Book model: performs CRUD
controllers/BookController.php - Book controller → Book list view: renders list
controllers/BookController.php - Book controller → Book creation view: renders form
controllers/BookController.php - Book controller → Book edit view: renders form
controllers/BookController.php - Loan controller → Session helpers: requires login
controllers/PrestamoController.php - Loan controller → User model: loads users
controllers/PrestamoController.php - Loan controller → Book model: checks availability
controllers/PrestamoController.php - Loan controller → Loan model: records loan
controllers/PrestamoController.php - Loan controller → Book model: updates availability
controllers/PrestamoController.php - Loan controller → Loan view: renders loans
controllers/PrestamoController.php - Loan view → Library user: submits loan actions
views/prestamos/index.php - Dashboard controller → Book model: loads book stats
controllers/DashboardController.php - Dashboard controller → User model: counts users
controllers/DashboardController.php - Dashboard controller → Loan model: loads loan stats
controllers/DashboardController.php - Dashboard controller → Dashboard view: renders dashboard
controllers/DashboardController.php - Dashboard view → Shared header: includes header
views/index.php - Dashboard view → Shared footer: includes footer
views/index.php - Book model → DB connection: loads connection
models/Libro.php - User model → DB connection: loads connection
models/Usuario.php - Loan model → DB connection: loads connection
models/Prestamo.php - DB connection → Biblioteca database: opens connection
config/config.php - Book model → Biblioteca database: queries books
models/Libro.php - User model → Biblioteca database: queries users
models/Usuario.php - Loan model → Biblioteca database: queries loans