How aghontpi/infra-management-system works
Project type and purpose
• This is a monolithic, full-stack PHP web application (“PHP-Infra-Management-System”) for managing infrastructure assets.
• Purpose: let admins/register users add, remove, update, assign devices to users, plus account activation.
File structure
• Top-level PHP scripts (each acts as its own controller/action):
– index.php, register.php, activateusers.php, redirect.php (authentication & onboarding)
– dashboard.php, users.php, worker.php (admin/user dashboards)
– addnew.php, loanitems.php, updateitems.php (asset-management flows)
– header.php (shared UI include), Database.php (PDO DB connector)
• Static assets:
– css/ (normalize.css, skeleton.css, main.css)
– js/main.js
• Database dump: dump.sql for MySQL/MariaDB schema & seed data.
Extract architecture hints from README
• Built with raw PHP + PDO, JS, custom CSS (no framework).
• LAMP-style stack: Apache/Nginx + PHP + MySQL.
• Sloppy code organization—no MVC folder separation.
Main components
a. Client (Web Browser)
– Sends HTTP(s) requests, loads HTML/CSS/JS, triggers form submissions & AJAX.
b. Web Server + PHP Runtime
– HTTP listener (Apache or Nginx + PHP-FPM)
– Routes requests to specific .php files.
c. Application Modules (grouped by function)
• Auth Module: index.php (login), register.php, activateusers.php, redirect.php
• Dashboard Module: dashboard.php, users.php, worker.php
• Inventory Module: addnew.php, loanitems.php, updateitems.php
• Shared: Database.php (PDO connector), header.php (UI template)
d. Database
– MySQL/MariaDB instance with tables for users, devices, assignments (from dump.sql)
e. Static Asset Service
– Serves CSS and JS files directly from css/ and js/ folders.
Relationships & data flows
• Browser → Web Server: GET/POST requests to *.php endpoints
• *.php endpoints → Database.php → MySQL: CRUD via PDO
• PHP scripts → header.php → generate HTML → Browser
• Browser → JS (main.js): optional client-side interactivity (e.g., form validation)
• Browser ← CSS: styling via main.css etc.
Architectural patterns & principles
• Single monolith: no microservices or external APIs.
• Functional grouping by script file rather than strict MVC folders.
• Shared library (Database.php) for Data-Access Layer (DAL).
• Template include (header.php) for shared UI—primitive view composition.
Technologies & frameworks
• LAMP stack – PHP 7+ with PDO, MySQL/MariaDB
• Plain JavaScript for front-end behavior
• Custom CSS + Skeleton CSS (abandoned) + Normalize.css