How ashrahx/salutix works
Main Components
• Client/Browser Layer: Represents the users accessing the system (different roles such as admin, doctor, cashier, and possibly guest users).
• Frontend Assets: Reside in directories like public (static assets) and resources (CSS, JavaScript, and Blade view templates). Also note the integration of Vite (via vite.config.js and npm scripts) for asset bundling.
• Laravel Application Core:
• Controllers: Located in app/Http/Controllers (with sub-folders like Admin and Auth). These manage the incoming HTTP requests (routing from routes/web.php, routes/auth.php) and enforce business logic.
• Middleware: Found in app/Http/Middleware, handling role-based access (e.g., Admin, Cashier, Doctor) and security.
• Models: In app/Models (e.g. User, Patient, Shift) which interact with the database through the Eloquent ORM.
• Requests: Custom request validation logic in app/Http/Requests.
• Views: Stored in resources/views (including layouts, admin-specific views, components, and error pages) that define the UI.
• Providers and Configuration: In app/Providers and config/ directory, which set up the global settings, service providers, and dependency injection.
• Database Layer: Managed via migrations in the database/migrations (creating tables like users, patients, shifts, etc.) and seeded by database/seeders.
• Development and Build Tools: Artisan commands (artisan file), Composer dependencies (composer.json), NodeJS dependencies (package.json), and build configurations (Vite, Tailwind, PostCSS).
Relationships and Interactions
• Requests from the client pass to the Laravel backend through defined routes (in routes/web.php, routes/auth.php).
• Middleware intercepts requests to apply authentication and role-based permissions.
• Controllers process the requests, interacting with Models to perform CRUD operations on the database.
• Responses are rendered through Blade view templates (resources/views) and served back to the client.
• Frontend build process uses Vite and NodeJS tooling to compile assets, which are then referenced by the view layer.
Important Architectural Patterns and Design Principles
• MVC Pattern: Clear division among Models, Views, and Controllers to manage application logic.
• Layered Architecture: Separation between presentation (Blade views, assets), business logic (controllers, middleware, requests), persistence (models and databases), and configuration.
• Role-Based Access Control: Multiple middleware components and role-specific controllers (Admin, Doctor, Cashier) indicate separation of concerns based on user roles.
• Dependency Injection & Service Providers: The app structure leverages Laravel’s service container (e.g., app/Providers) for bootstrapping various services.
Relevant Technologies, Frameworks, and Libraries
• Laravel (Backend framework)
• PHP (Server-side language; version requirements are given)
• MySQL (Database)
• Composer (Dependency management for PHP)
• NodeJS, Vite, Tailwind, PostCSS (Frontend tooling and asset compilation)
• Eloquent ORM (Data modeling)