How richardues/sarc-too works
Project type and purpose
• From the README title “Sistema de Atención y Resolución de Clientes (SARC)” and the file tree, this is a monolithic, full-stack PHP MVC web application.
• It implements user authentication, dashboards, error pages, and CRUD operations via its modules.
File structure
• App/Config: database connection and global configuration.
• App/Core: central Router and base Controller logic.
• App/Helpers: reusable PHP functions.
• App/Models: ORM-like classes mapping to DB tables (Cliente, Usuario, Rol, UserTypes).
• App/Modules: feature modules (Auth, Dashboard, Errors, Home) each with Controller, Service/Repository, optional GenericCrud.
• public/: entry point (index.php), static assets (CSS, JS, fonts).
• resources/views/: view templates organized by feature.
• composer.json: dependency management.
• dataset.sql, scrips_tables.sql: initial schema and data.
README for additional insights
• Although sections aren’t filled out here, the headings hint at:
– Host virtual configuration (Apache/nginx + .htaccess)
– Local DB connection via App/Config/Database.php
– PHP dependencies (managed by Composer)
a. Main components
1. Client Browser (UI)
2. Web Server (Apache or nginx + .htaccess)
3. PHP Runtime / Front Controller (public/index.php)
4. Router (App/Core/Router.php)
5. Controllers (App/Modules/*/*Controller.php)
6. Services & Repositories (AuthService, AuthRepository, GenericCrud)
7. Models (App/Models/*.php)
8. Database (MySQL/PostgreSQL as per dataset.sql)
9. Static Assets (CSS/JS under public/assets, public/styles, public/scripts)
b. Relationships & interactions
• Browser → HTTP Request → Web Server → index.php
• index.php invokes Router → dispatches to appropriate Controller
• Controller uses Services (AuthService, Dashboard logic)
• Services call Repositories or GenericCrud → Models → Database
• Database returns data → Models → Repositories → Services → Controller
• Controller loads a View template (resources/views/…) → HTML response → Browser
• Static assets (CSS/JS) served directly by Web Server on client requests
c. Architectural patterns & design principles
• MVC (Model-View-Controller)
• Front-Controller pattern (single entry point + Router)
• Layered architecture (Presentation, Application, Data)
• Separation of concerns (Controllers vs. Services/Repositories vs. Models)
• Module-based organization (each feature in its own folder under App/Modules)
d. Key technologies & frameworks
• PHP 7+ (Composer for autoloading)
• MySQL (or compatible) via App/Config/Database.php
• Vanilla JS, Bootstrap CSS (public/scripts + public/styles/bootstrap)
• .htaccess for URL rewriting