Project Overview
Relevant source files
The following files were used as context for generating this wiki page:
The IT Management System is a comprehensive, multi-tenant IT Asset Management (ITAM) platform built with PHP and MySQL. It is designed to manage IT infrastructure, employees, budgets, and helpdesk operations with zero external dependencies, prioritizing security through mandatory CSRF protection and prepared SQL statements.
The system supports multiple companies through strict company_id scoping, ensuring data isolation across different tenants. It features a wide array of modules ranging from equipment and network management to financial reporting and organizational charts.
Sources: README.md:1-10, AGENT_NOTES.md:3-10, wiki/Home.md:3-15
System Architecture
The project follows a legacy PHP architecture (PHP 7.4.33) utilizing the MySQLi extension instead of PDO. The application flow moves from web entry points through a shared core into company-scoped MySQL data, with integrated audit logging for all mutations.
High-Level Request Flow
The following diagram illustrates how user requests are processed through the system:
Sources: README.md:104-108, wiki/Home.md:58-62
Technical Stack
| Component | Specification |
|---|---|
| Language | PHP 7.4.33 |
| Database | MySQL 8.0+ (MySQLi) |
| Web Server | Apache 2.4+ |
| Frontend | Vanilla JavaScript + CSS |
| Dependencies | Zero (No Composer, No NPM) |
Sources: README.md:155-162, wiki/Home.md:25-30
Core Features and Modules
The system is organized into specialized modules, most of which follow a standard CRUD (Create, Read, Update, Delete) pattern.
Primary Modules
- Infrastructure Management: Includes Equipment tracking (with Switch Port Manager), IDF rack visualizers, IPAM (IP Address Management), and Rack Planning.
- Resource Tracking: Dedicated modules for Printers, Workstations, and general Inventory.
- Organizational Management: Employee tracking, interactive Org Charts with drag-and-drop, and Department management.
- Operational Tools: Ticket management system for support, a secure Passwords vault with encryption, and a file Explorer.
- Financials: Budgeting, forecasting, and read-only budget reporting.
Sources: README.md:120-145, wiki/Modules.md:15-35
Standard Module Structure
Standard CRUD modules typically contain the following files:
index.php: List view with search, sort, and pagination.create.php/add.php: Forms for creating new records.edit.php: Form for updating existing records.view.php: Detail view for a single record.delete.php: Handler for record removal.
Sources: wiki/Modules.md:10-14, templates/AGENT_NOTES.md:57-64
Security and Multi-Tenancy
Data isolation is enforced through a session-based company_id check. Almost all database tables include a company_id column to ensure that users only interact with their own tenant's data.
Security Requirements
- CSRF Protection: Mandatory for all POST requests via
csrf_tokenorX-CSRF-Tokenheader. - SQL Injection Prevention: Strict use of prepared statements via
mysqli. - Audit Logging: Mutations (Insert, Update, Delete) are tracked via database triggers or explicit logging functions (
itm_log_audit).
Sources: AGENT_NOTES.md:6-10, scripts/api.php:123-132, scripts/scripts.php:385-395
Authentication Flow
Sources: scripts/api.php:123-138, AGENT_NOTES.md:6-8
Maintenance and Developer Tools
The scripts/ directory contains various utilities for system administration, testing, and documentation.
Key Utilities
- API Documentation (
api.php): An HTML reference for JSON endpoints and import routes. - Database Design (
DBdesign.php): Generates ER-style diagrams (Mermaid/JSON) fromdatabase.sql. - Audit Scanners: Tools like
check_csrf_coverage.phpandcheck_sql_injection_coverage.phpfor static security analysis. - QA Runner (
module_browser_qa_runner.php): Performs full-module QA across all entries to verify database integrity and UI functionality.
Sources: scripts/scripts.php:75-82, scripts/scripts.php:95-102, scripts/scripts.php:345-360
Summary
The IT Management System provides a robust, zero-dependency environment for managing complex IT assets and organizational data. Its architecture prioritizes tenant isolation and security while offering high extensibility through its modular PHP design. Developers must adhere to the company_id scoping and CSRF protection standards defined in the project guardrails to maintain system integrity.
Sources: AGENT_NOTES.md:3-15, wiki/Home.md:3-10