How pgap22/muo works
Main Components
• Client/User Interface: Represent the public website (pages, home, CSS, JS, images) that end users interact with in their web browsers.
• Administration Portal: The “admin” directory holds pages for managing items (categorías, expo, museos). This is a separate UI layer for admins.
• API Endpoints: The “api” folder contains PHP scripts (addFavorite, changeLanguage, getData, etc.) that likely serve AJAX or external requests.
• Authentication & Authorization: The “auth” folder handles login, logout, email verification, and password reset functionality.
• Business Logic Layer: The “clases” directory provides the core logic – classes for ActiveRecord, Handling categories, expositions, museums, comments, favorites, and so on. This is your domain/model layer.
• Supporting Libraries & Templates: The “includes” directory (with subdirectories for PHPMailer, DB, functions, and templates) handles database connections, utility functions, email notifications, and shared header/footer templates.
• Database: Although not a physical PHP file, the MySQL database (set up via the provided SQL files) is central to storing users, items, and other site data.
• Assets: CSS (organized by feature and responsive design-related directories) and JavaScript (various functionality including general interactions, admin scripts, language switching, search, and dynamic content) that provide front-end behavior and styles.
Relationships and Interactions
• The front-end code (JS and CSS) loads template components (header, footer) from the “includes/templates” directory.
• Both the public pages and API scripts call into the “clases” to execute business logic and interact with the database through “includes/db.php.”
• The authentication processes (in the “auth” folder) interact with the user model (in “clases/Usuarios.php”) and involve sending emails using PHPMailer (in “includes/PHPMailer”).
• The API endpoints are used to facilitate AJAX requests (managing favorites, language change, etc.) and further interact with the core models.
Architectural Patterns and Design Principles
• The project structure suggests an MVC-like separation even if it’s not a full framework – you have visual presentation (pages/templates/CSS/JS), business logic (clases), and a data access layer (MySQL via includes/db.php).
• There is a clear separation between public user paths and admin paths (directories “home,” “pages” vs. “admin”).