How 24shubham12/senior_care works
Project type and purpose
• This is a monolithic, full-stack PHP web application built on the CodeIgniter MVC framework, named “senior_care.”
• It provides two role-based front ends—“admin” and “users”—for managing patient records, prescriptions, uploads, dashboards, etc.
Main architectural components
a. Client Layer (Web Browser)
• User and Admin browsers requesting HTML, CSS, JS, images, PDFs.
b. Web Server Layer (Apache / .htaccess)
• Serves static assets directly.
• Forwards PHP requests to the CodeIgniter front controller (index.php).
c. Application Layer (CodeIgniter MVC)
i. Front Controller (index.php + system/core/CodeIgniter.php)
• Bootstraps the framework, loads config, routes.
ii. Router & Controller Classes
• application/controllers/Users.php
• application/controllers/Admin.php
iii. Model Layer
• application/models/PatientDb.php, AdminDb.php
• Interacts with MySQL via system/database/* drivers.
iv. View Layer
• application/views/users/ and application/views/admin/
• Contains HTML templates + asset subdirectories (css, js, images, scss).
v. Configuration & Services
• application/config/database.php (MySQL)
• application/config/memcached.php (Cache)
• application/config/email/mailer, routes, constants, hooks, etc.
vi. Third-party & Libraries
• SCSS toolchain (bootstrap, custom scss in views)
• JS libraries (jQuery, Chartist, AOS, plugins)
• Composer dependencies (composer.json)
d. Data Layer
• MySQL database (senior_care.sql)
• Memcached for caching session/data
• File storage on server for uploads (application/views/users/asset/uploaded_files).
Component interactions & data flow
1. Browser → HTTP request for page or asset
2. Web Server (Apache)
• If static asset → serve file directly
• If PHP route → forward to index.php
3. CodeIgniter Front Controller
→ Load config, router chooses Controller
4. Controller
→ Calls Model to query/update DB or cache
→ Processes business logic
→ Passes data to View
5. View renders HTML + includes CSS/JS links
6. Browser receives response
Architectural patterns & principles
• MVC separation: Controllers, Models, Views
• Single front controller (index.php)
• Layered separation: presentation, business, data
• Asset pipeline: SCSS → CSS compiled offline, served as static
• Caching layer abstracted via memcached driver