How thewebustaad/medicalproject works
Project type and purpose
• This is a full-stack Laravel (PHP) web application implementing an appointment management system.
• Key use cases: user authentication (customers, doctors, admins), role-based access, appointment booking and management.
File structure
• Top-level folders:
• app/ — contains MVC backend (Http/Controllers, Models, Middleware, Providers).
• routes/ — web and console routing definitions.
• resources/ — Blade view templates, front-end JS/CSS scaffolding.
• public/ — publicly served assets: index.php, static CSS/JS, two sets of assets (public/assets for customer site, public/admin for admin panel).
• database/ — migrations, seeders, factories.
• config/, bootstrap/, storage/, tests/, etc.
• MVC pattern:
• Models under app/Models (User, Doctor, Appointment, AppointmentModel).
• Controllers under app/Http/Controllers (segmented by role: Doctors/admin, Doctors/main, general).
• Views under resources/views (layouts, pages for admin panel vs public site).
• Middleware enforces authentication/role checks.
• Composer manages PHP dependencies; Vite or Laravel Mix handles front-end builds (vite.config.js).
• Database migrations define schema for users, roles, doctors, appointments.
Extract additional insights from the README
• Roles: customer, admin, doctor.
• Appointment booking flow: user books → controller logic → persisting to DB → notifications (mail.php).
• No external microservices; typical monolith with front-end assets and back-end.
a. Main components:
1. Client browsers/mobile apps
2. Web Server (Nginx/Apache)
3. Laravel Application
– Routing Layer (routes/web.php)
– Middleware (Auth, AdminAuthenticate, Redirects)
– Controllers (AppointmentController, DoctorController, etc.)
– Service Providers (AppServiceProvider)
– Models & ORM (Eloquent)
4. Database (MySQL)
5. File Storage (local disk for uploads)
6. External Mail Service (SMTP, Mailgun, etc.)
b. Relationships & data flows:
• Client → Web Server → index.php → bootstrap/app.php → route resolve
• Route → Middleware → Controller → Model → Database
• Controller → returns Blade view + data
• Blade → front-end assets → rendered in browser
• Appointment booking triggers mail via Mail facade → external SMTP
c. Architectural patterns:
• MVC (Models, Views, Controllers)
• Service Provider pattern for bootstrapping
• Eloquent ORM for data access
• Role-based middleware for authorization
d. Key technologies/frameworks:
• Laravel 9.x (PHP 8.x)
• MySQL (or equivalent)
• Blade templating
• Composer (dependency management)
• Vite (front-end asset bundling)
• Bootstrap, jQuery, and custom JS/CSS in public/assets & public/admin