How devil7645/library-management-system works
Project type and purpose
• This is a monolithic, full‑stack PHP web application called “Library‑Management‑System.”
• It provides user login/signup, an admin dashboard for managing books (add, delete, export CSV), and a user dashboard.
File structure
• Top‑level entry‑points (index.php, login.php, dashboard.php, logout.php) act as controllers/views.
• includes/ holds shared modules: db.php (data‑access), auth.php (session check), header/footer templates.
• admin/ is a sub‑area for admin pages, actions, and assets.
• assets/ contains CSS/JS for styling and behavior; static files served directly.
• actions/ and admin/actions/ contain form handlers (login_action.php, signup_action.php, add_book_action.php, etc.).
• LMS_db.sql is the MySQL schema.
README for insights
• The README confirms the simple MVC‑style layering:
• Views: .php pages
• Controllers: entry‑point pages + action scripts
• Model: db.php, MySQL schema
• No external third‑party services beyond the database.
a. Client (Web Browser with HTML/CSS/JS)
b. Web Server + PHP Engine
• Router/Entry Points (index.php, login.php, etc.)
• Controllers/Actions (actions/*.php, admin/actions/*.php)
• View Templates (includes/header.php, footer.php, admin/includes/*)
• Data Access Layer (includes/db.php)
c. Database Server (MySQL using LMS_db.sql)
d. Static Asset Store (assets/css, assets/js, admin/assets)
e. Optional: CSV export module (exportCSV_books.php)
Relationships & data flows
• Browser → HTTP request → Web Server/PHP
• If it’s a form submit: routed to an action script → includes/db.php → MySQL
• On page loads: entry‑point .php loads includes/auth.php → queries DB → renders header, footer, page template → HTML back to browser
• Browser loads CSS/JS from assets directories (static GET requests)
• Admin area separated by URL path (e.g., /admin/*) guarded by auth.php
Architectural patterns & design principles
• Layered MVC style:
• Presentation: .php views + HTML/CSS/JS
• Business logic: action scripts
• Data access: single db.php
• DRY via includes for headers, footers, auth checks
• Single‑database monolith—no microservices
Technologies & frameworks
• PHP 7+ (server‑side scripting)
• MySQL (relational database)
• Apache/Nginx (web server)
• HTML5/CSS3, vanilla JavaScript
• CSV export via PHP file output