Patients
-Manage patient records
-No records found
-diff --git a/.agent/artifacts/how_to_control_agent_behavior.md b/.agent/artifacts/how_to_control_agent_behavior.md deleted file mode 100644 index 8b58065..0000000 --- a/.agent/artifacts/how_to_control_agent_behavior.md +++ /dev/null @@ -1,70 +0,0 @@ -# How to Control Agent Behavior - -## Stopping Auto-Verification After Implementation - -If you want the agent to **stop verifying/testing** after implementing code in future chats, you can: - -### Option 1: Add to User Rules (Recommended) - -Go to your **User Settings** and add a custom rule: - -``` -After implementing code changes, do not automatically verify or test unless explicitly asked. -``` - -This will apply to all future conversations. - -### Option 2: Use Explicit Instructions - -In each chat, you can say: - -- ✅ "Implement X **without testing**" -- ✅ "Just create the code, **don't verify**" -- ✅ "Skip verification, I'll test it myself" -- ✅ "**No auto-run** after implementation" - -### Option 3: Workflow Annotation - -Add `// turbo` or `// turbo-all` annotations to workflows you want auto-executed. - -For workflows you **don't** want auto-executed, simply don't add the annotation. - ---- - -## Current Behavior - -By default, the agent is **proactive** and will: -- ✅ Implement your request -- ✅ Run commands if safe -- ✅ Verify the implementation works -- ✅ Test and report results - -This is helpful for catching errors early, but you can disable it with the methods above. - ---- - -## Example User Rule - -Add this to your **User Settings → Custom Rules**: - -``` -Implementation Preference: -- After creating or modifying code, wait for my explicit instruction before testing -- Do not auto-run commands unless I specifically ask -- Provide a summary of changes and ask if I want to test -``` - ---- - -## Quick Reference - -| What You Want | How to Achieve It | -|---------------|-------------------| -| No auto-testing | Add user rule: "Don't auto-test" | -| Sometimes test | Use explicit instructions per request | -| Always test specific workflows | Add `// turbo-all` to workflow | -| Never test specific workflows | Don't add turbo annotations | - ---- - -**Note:** The agent will still be helpful and provide guidance, but won't automatically run verification commands unless you ask. diff --git a/.agent/artifacts/v2_migration_complete.md b/.agent/artifacts/v2_migration_complete.md deleted file mode 100644 index f9234c3..0000000 --- a/.agent/artifacts/v2_migration_complete.md +++ /dev/null @@ -1,216 +0,0 @@ -# ✅ V2 Custom Tailwind Migration - COMPLETE - -## Migration Summary - -**Status:** ✅ **ALL PHASES COMPLETED** - -**Date:** 2025-12-30 - ---- - -## What Was Done - -### Phase 1: Base CSS System ✅ -**File:** `public/css/v2/styles.css` - -Created a comprehensive 900+ line custom CSS design system featuring: -- CSS variables for theming (light/dark mode) -- Premium glassmorphism effects -- Modern gradient buttons -- Custom form inputs with focus states -- Beautiful table styling -- Modal/dialog animations -- Badge components -- Alert components -- Loading spinners -- Navigation menus -- Utility classes - -### Phase 2: Main Layout ✅ -**File:** `app/Views/layout/main_layout.php` - -Completely redesigned with: -- ✨ Glassmorphism navbar with backdrop blur -- 🎨 Gradient sidebar (dark theme) -- 🌙 Working theme toggle (light/dark) -- 💫 Smooth sidebar animations -- 👤 Premium user dropdown with transitions -- 🔤 Inter font integration -- ⚡ Removed all DaisyUI dependencies - -### Phase 3: Login Page ✅ -**File:** `app/Views/auth/login.php` - -Redesigned with: -- 🌈 Animated gradient background -- 💎 Glassmorphism login card -- 🎭 Floating logo animation -- 📝 Modern form inputs -- 🚪 Smooth register modal with transitions -- ✅ Custom alerts - -### Phase 4: Feature Pages ✅ - -#### Dashboard ✅ -**File:** `app/Views/dashboard/dashboard_index.php` - -- 📊 Gradient stat cards with hover effects -- 🎯 Modern activity feed -- ⚡ Quick action buttons -- 🎨 Glassmorphism welcome card - -#### Patients Index ✅ -**File:** `app/Views/patients/patients_index.php` - -- 📈 Animated stat cards -- 🔍 Clean search bar -- 📋 Modern table design -- 🗑️ Custom delete confirmation modal -- 💫 Smooth loading states - -#### Patient Form ✅ -**File:** `app/Views/patients/dialog_form.php` - -- 📝 Premium modal design -- ✨ Smooth enter/exit animations -- 🎯 Clean form layout -- ⚠️ Error state styling - ---- - -## Files Modified - -| File | Status | Changes | -|------|--------|---------| -| `public/css/v2/styles.css` | ✅ Created | Complete design system | -| `app/Views/layout/main_layout.php` | ✅ Migrated | Removed DaisyUI, custom components | -| `app/Views/auth/login.php` | ✅ Migrated | Premium glassmorphism design | -| `app/Views/dashboard/dashboard_index.php` | ✅ Migrated | Modern stat cards | -| `app/Views/patients/patients_index.php` | ✅ Migrated | Custom table & modals | -| `app/Views/patients/dialog_form.php` | ✅ Migrated | Animated form modal | - -**Total Files:** 6 - ---- - -## DaisyUI Classes Replaced - -All DaisyUI classes have been replaced with custom CSS: - -| Old (DaisyUI) | New (Custom) | -|---------------|--------------| -| `btn btn-primary` | `btn btn-primary` (custom) | -| `card` | `card` (glassmorphism) | -| `input input-bordered` | `input` (custom) | -| `modal modal-open` | `modal-overlay` + Alpine | -| `alert alert-error` | `alert alert-error` (custom) | -| `badge badge-primary` | `badge badge-primary` (custom) | -| `table table-zebra` | `table` (custom) | -| `loading loading-spinner` | `spinner` (CSS animation) | -| `dropdown` | Custom with Alpine.js | -| `menu` | `menu` (custom nav) | - ---- - -## Design Features - -### Color Palette -- **Primary:** Indigo (#6366f1) → Violet (#8b5cf6) gradient -- **Success:** Emerald (#10b981) -- **Warning:** Amber (#f59e0b) -- **Error:** Red (#ef4444) -- **Info:** Sky (#0ea5e9) - -### Typography -- **Font:** Inter (Google Fonts) -- **Headings:** Bold, tracking-tight -- **Body:** Normal, leading-relaxed - -### Effects -- ✨ Glassmorphism with backdrop-filter -- 🎨 Gradient buttons and cards -- 💫 Smooth micro-animations -- 🌙 Proper dark mode support -- 📱 Fully responsive - ---- - -## How to Test - -1. **Navigate to login page:** - ``` - http://localhost/clqms-be/v2/login - ``` - - Check animated gradient background - - Test login form - - Try register modal - -2. **After login, check dashboard:** - ``` - http://localhost/clqms-be/v2/ - ``` - - Verify stat cards - - Test sidebar toggle - - Try theme toggle (light/dark) - -3. **Test patients page:** - ``` - http://localhost/clqms-be/v2/patients - ``` - - Check table styling - - Test "New Patient" modal - - Try search functionality - ---- - -## Browser Compatibility - -✅ Chrome/Edge (Chromium) -✅ Firefox -✅ Safari (with -webkit- prefixes) -⚠️ IE11 (not supported - uses modern CSS) - ---- - -## Performance Notes - -- **CSS File Size:** ~30KB (unminified) -- **No external dependencies** except: - - TailwindCSS 4 CDN (for utilities) - - Alpine.js (for interactivity) - - FontAwesome (for icons) - - Inter font (Google Fonts) - ---- - -## Next Steps (Optional Enhancements) - -1. **Add more pages:** - - Lab Requests page - - Settings page - - Reports page - -2. **Optimize:** - - Minify CSS for production - - Add CSS purging - - Lazy load fonts - -3. **Enhance:** - - Add toast notifications - - Implement skeleton loaders - - Add page transitions - ---- - -## Migration Complete! 🎉 - -All V2 views have been successfully migrated from DaisyUI to a custom Tailwind CSS design system with: - -- ✅ Premium aesthetics -- ✅ Glassmorphism effects -- ✅ Smooth animations -- ✅ Dark mode support -- ✅ Full responsiveness -- ✅ No DaisyUI dependencies - -**Bismillah, the migration is complete and ready for testing!** diff --git a/.agent/artifacts/v2_tailwind_migration_plan.md b/.agent/artifacts/v2_tailwind_migration_plan.md deleted file mode 100644 index 7a9e0d9..0000000 --- a/.agent/artifacts/v2_tailwind_migration_plan.md +++ /dev/null @@ -1,304 +0,0 @@ -# V2 Custom Tailwind Migration Plan - -## Overview -Migrate all V2 views from DaisyUI to custom TailwindCSS with a premium, modern aesthetic. - -## Design System Goals -- **Premium glassmorphism effects** -- **Smooth micro-animations** -- **Beautiful gradients and shadows** -- **Modern color palette** (not generic) -- **Consistent spacing and typography** - ---- - -## Files to Migrate - -### 1. Layout & Core (Priority: HIGH) -| File | Description | Complexity | -|------|-------------|------------| -| `layout/main_layout.php` | Main layout with sidebar, navbar, footer | High | - -### 2. Auth Views (Priority: HIGH) -| File | Description | Complexity | -|------|-------------|------------| -| `auth/login.php` | Login + Register modal | Medium | - -### 3. Feature Views (Priority: MEDIUM) -| File | Description | Complexity | -|------|-------------|------------| -| `dashboard/dashboard_index.php` | Dashboard with stats cards | Medium | -| `patients/patients_index.php` | Patient list with table, search, pagination | High | -| `patients/dialog_form.php` | Patient form modal | Medium | - ---- - -## Design System Specifications - -### Color Palette -```css -/* Primary Colors */ ---color-primary: #6366f1; /* Indigo */ ---color-primary-hover: #4f46e5; ---color-primary-light: #818cf8; - -/* Secondary Colors */ ---color-secondary: #8b5cf6; /* Violet */ - -/* Semantic Colors */ ---color-success: #10b981; /* Emerald */ ---color-warning: #f59e0b; /* Amber */ ---color-error: #ef4444; /* Red */ ---color-info: #0ea5e9; /* Sky */ - -/* Neutral Colors */ ---color-text: #1e293b; /* Slate 800 */ ---color-text-muted: #64748b; /* Slate 500 */ ---color-bg: #f8fafc; /* Slate 50 */ ---color-bg-dark: #0f172a; /* Slate 900 */ ---color-surface: #ffffff; ---color-surface-dark: #1e293b; ---color-border: #e2e8f0; /* Slate 200 */ -``` - -### Typography -- **Font**: Inter (via Google Fonts) -- **Headings**: font-bold, tracking-tight -- **Body**: font-normal, leading-relaxed - -### Component Styles - -#### 1. Buttons -```css -/* Primary Button */ -.btn-primary { - background: linear-gradient(135deg, #6366f1, #8b5cf6); - color: white; - padding: 0.75rem 1.5rem; - border-radius: 0.75rem; - font-weight: 600; - box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4); - transition: all 0.2s; -} -.btn-primary:hover { - transform: translateY(-2px); - box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5); -} - -/* Ghost Button */ -.btn-ghost { - background: transparent; - color: currentColor; - padding: 0.5rem 1rem; - border-radius: 0.5rem; -} -.btn-ghost:hover { - background: rgba(0, 0, 0, 0.05); -} -``` - -#### 2. Cards -```css -/* Glass Card */ -.card { - background: rgba(255, 255, 255, 0.8); - backdrop-filter: blur(12px); - border: 1px solid rgba(255, 255, 255, 0.2); - border-radius: 1rem; - box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08); -} - -/* Dark Mode */ -[data-theme="dark"] .card { - background: rgba(30, 41, 59, 0.8); - border: 1px solid rgba(255, 255, 255, 0.1); -} -``` - -#### 3. Inputs -```css -.input { - width: 100%; - padding: 0.75rem 1rem; - border: 1px solid #e2e8f0; - border-radius: 0.75rem; - background: #f8fafc; - transition: all 0.2s; -} -.input:focus { - outline: none; - border-color: #6366f1; - box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); - background: white; -} -``` - -#### 4. Sidebar -```css -.sidebar { - background: linear-gradient(180deg, #1e293b, #0f172a); - /* Or glassmorphism variant */ - background: rgba(15, 23, 42, 0.95); - backdrop-filter: blur(20px); -} - -.sidebar-link { - display: flex; - align-items: center; - gap: 0.75rem; - padding: 0.75rem 1rem; - border-radius: 0.75rem; - color: rgba(255, 255, 255, 0.7); - transition: all 0.2s; -} -.sidebar-link:hover { - background: rgba(255, 255, 255, 0.1); - color: white; -} -.sidebar-link.active { - background: linear-gradient(135deg, #6366f1, #8b5cf6); - color: white; - box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4); -} -``` - -#### 5. Modals/Dialogs -```css -.modal-overlay { - position: fixed; - inset: 0; - background: rgba(0, 0, 0, 0.5); - backdrop-filter: blur(4px); - z-index: 50; -} -.modal-content { - background: white; - border-radius: 1.5rem; - box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25); - max-width: 32rem; - animation: modalEnter 0.3s ease-out; -} -@keyframes modalEnter { - from { opacity: 0; transform: scale(0.95) translateY(10px); } - to { opacity: 1; transform: scale(1) translateY(0); } -} -``` - -#### 6. Tables -```css -.table { - width: 100%; - border-collapse: separate; - border-spacing: 0; -} -.table th { - padding: 1rem; - text-align: left; - font-weight: 600; - color: #64748b; - background: #f8fafc; - border-bottom: 1px solid #e2e8f0; -} -.table td { - padding: 1rem; - border-bottom: 1px solid #f1f5f9; -} -.table tr:hover { - background: #f8fafc; -} -``` - -#### 7. Badges -```css -.badge { - display: inline-flex; - align-items: center; - padding: 0.25rem 0.75rem; - border-radius: 9999px; - font-size: 0.75rem; - font-weight: 600; -} -.badge-primary { - background: rgba(99, 102, 241, 0.15); - color: #6366f1; -} -.badge-success { - background: rgba(16, 185, 129, 0.15); - color: #10b981; -} -``` - ---- - -## Migration Steps - -### Phase 1: Create Base CSS (styles.css) -1. Create `public/css/v2/styles.css` with all custom utilities -2. Define CSS variables for theming -3. Add animation keyframes -4. Add component base styles - -### Phase 2: Migrate Main Layout -1. Remove DaisyUI CDN link -2. Add custom styles.css link -3. Redesign sidebar with glassmorphism -4. Redesign navbar with clean white/dark theme -5. Update theme toggle functionality -6. Improve user dropdown - -### Phase 3: Migrate Auth Pages -1. Redesign login page with premium glass card -2. Update form inputs with custom styling -3. Improve register modal -4. Add subtle animations - -### Phase 4: Migrate Feature Pages -1. Redesign dashboard with gradient stat cards -2. Update patients table with modern styling -3. Improve modals and dialogs -4. Add micro-animations - -### Phase 5: Polish & Testing -1. Test all theme switching -2. Verify responsive design -3. Add loading states and transitions -4. Cross-browser testing - ---- - -## Estimated Timeline -- Phase 1: 15 minutes -- Phase 2: 30 minutes -- Phase 3: 20 minutes -- Phase 4: 40 minutes -- Phase 5: 15 minutes - -**Total: ~2 hours** - ---- - -## DaisyUI Classes to Replace - -| DaisyUI Class | Custom Tailwind Replacement | -|---------------|----------------------------| -| `btn btn-primary` | `btn-primary` (custom class) | -| `btn btn-ghost` | `btn-ghost` (custom class) | -| `card` | `card` (glassmorphism custom) | -| `card-body` | `p-6` | -| `input input-bordered` | `input` (custom class) | -| `select select-bordered` | `select` (custom class) | -| `modal modal-open` | `modal` + Alpine `x-show` | -| `alert alert-error` | `alert alert-error` (custom) | -| `badge badge-primary` | `badge badge-primary` (custom) | -| `table table-zebra` | `table` (custom styling) | -| `avatar` | `avatar` (custom) | -| `dropdown` | Custom dropdown with Alpine | -| `menu` | `nav-menu` (custom) | -| `join` | `flex group` | -| `divider` | `divider` (custom) | -| `loading loading-spinner` | `spinner` (custom SVG/CSS) | - ---- - -## Next Steps -Ready to proceed? I'll start with **Phase 1** - creating the base CSS file with all custom utilities and component styles. diff --git a/.agent/workflows/agent.md b/.agent/workflows/agent.md deleted file mode 100644 index 9807410..0000000 --- a/.agent/workflows/agent.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -description: Rules and guidelines for the AI agent working on this project ---- - -# Agent Guidelines - -## Backend Update Rules - -> **IMPORTANT**: On every backend update (controllers, models, routes, database changes), you MUST update `README.md` accordingly. - -### Documentation Updates Required For: -1. **New API endpoints** - Add to API documentation -2. **Database schema changes** - Update schema docs -3. **New features** - Document in appropriate section -4. **Configuration changes** - Update technical stack or setup instructions - -### V2 Frontend Updates - -For any changes to the `/v2` hidden frontend, update the dedicated documentation at: -- `app/Views/v2/README.md` - -This keeps V2 changes separate from the main README to avoid exposing the hidden UI to the team. - -## Workflow Preferences -- Use 2-space indentation for all code -- Follow existing code patterns and naming conventions -- Always test changes before committing diff --git a/.agent/workflows/php-alpinejs-pattern.md b/.agent/workflows/php-alpinejs-pattern.md deleted file mode 100644 index d9749d7..0000000 --- a/.agent/workflows/php-alpinejs-pattern.md +++ /dev/null @@ -1,753 +0,0 @@ ---- -description: PHP + Alpine.js SPA-like Application Pattern (CodeIgniter 4 + Custom Tailwind) ---- - -# PHP + Alpine.js Application Pattern - -This workflow describes how to build web applications using **PHP (CodeIgniter 4)** for backend with **Alpine.js + Custom Tailwind CSS** for frontend, creating an SPA-like experience with server-rendered views. - -## Philosophy - -**"No-nonsense"** - Keep it simple, avoid over-engineering. This pattern gives you: -- Fast development with PHP backend -- Reactive UI with Alpine.js (no heavy framework overhead) -- Beautiful UI with custom Tailwind CSS design system -- JWT-based authentication - ---- - -## Technology Stack - -| Layer | Technology | -|-------|------------| -| Backend | CodeIgniter 4 (PHP 8.1+) | -| Frontend | Alpine.js + Custom Tailwind CSS | -| Database | MySQL/MariaDB | -| Auth | JWT (stored in HTTP-only cookies) | -| Icons | FontAwesome 6+ | - ---- - -## Project Structure - -``` -project/ -├── app/ -│ ├── Config/ -│ │ └── Routes.php # All routes (pages + API) -│ ├── Controllers/ -│ │ ├── BaseController.php # Base controller -│ │ ├── PagesController.php # Page routes (returns views) -│ │ └── [Resource]Controller.php # API controllers -│ ├── Models/ -│ │ └── [Resource]Model.php # Database models -│ ├── Filters/ -│ │ └── JwtAuthFilter.php # JWT authentication filter -│ └── Views/ -│ ├── layout/ -│ │ └── main_layout.php # Base layout with sidebar -│ ├── [module]/ -│ │ ├── [module]_index.php # Main page with x-data -│ │ ├── dialog_[name].php # Modal dialogs (included) -│ │ └── drawer_[name].php # Drawer components -│ └── login.php -├── public/ -│ ├── index.php -│ └── assets/ -│ ├── css/output.css # Compiled TailwindCSS -│ └── js/app.js # Alpine.js setup -└── .env # Environment config -``` - ---- - -## 1. Backend Patterns - -### 1.1 Routes Structure (`app/Config/Routes.php`) - -Routes are split into: -1. **Public routes** - Login, logout, auth check -2. **Protected page routes** - Views (with `jwt-auth` filter) -3. **API routes** - RESTful JSON endpoints - -```php -get('/login', 'PagesController::login'); -$routes->post('/login', 'AuthController::login'); -$routes->get('/logout', 'AuthController::logout'); - -// Protected page routes (returns views) -$routes->group('', ['filter' => 'jwt-auth'], function ($routes) { - $routes->get('/', 'PagesController::dashboard'); - $routes->get('/patients', 'PagesController::patients'); - $routes->get('/requests', 'PagesController::requests'); - // Master data pages - $routes->get('/master/doctors', 'PagesController::masterDoctors'); -}); - -// API routes (returns JSON) -$routes->group('api', function ($routes) { - // Resource: patients - $routes->get('patients', 'PatientsController::index'); - $routes->get('patients/(:num)', 'PatientsController::show/$1'); - $routes->post('patients', 'PatientsController::create'); - $routes->patch('patients/(:num)', 'PatientsController::update/$1'); - - // Resource: [resourceName] - // Follow same pattern: index, show, create, update -}); -``` - -### 1.2 Pages Controller (`app/Controllers/PagesController.php`) - -This controller ONLY returns views. No business logic. - -```php - 'Dashboard', - 'activePage' => 'dashboard' - ]); - } - - public function patients() { - return view('patients/patients_index', [ - 'pageTitle' => 'Patients', - 'activePage' => 'patients' - ]); - } - - public function requests() { - return view('requests/requests_index', [ - 'pageTitle' => 'Lab Requests', - 'activePage' => 'requests' - ]); - } -} -``` - -### 1.3 API Controller Pattern (`app/Controllers/[Resource]Controller.php`) - -API controllers handle CRUD operations and return JSON. - -```php -model = new PatientsModel(); - $this->rules = [ - 'firstName' => 'required|min_length[2]', - 'lastName' => 'required|min_length[2]', - ]; - } - - /** - * GET /api/patients - * List all with optional search - */ - public function index() { - $keyword = $this->request->getGet('keyword'); - - try { - $rows = $this->model->search($keyword); - return $this->respond([ - 'status' => 'success', - 'message' => 'fetch success', - 'data' => $rows - ], 200); - } catch (\Exception $e) { - return $this->failServerError('Exception: ' . $e->getMessage()); - } - } - - /** - * GET /api/patients/:id - */ - public function show($id = null) { - try { - $row = $this->model->find($id); - if (empty($row)) { - return $this->respond(['status' => 'success', 'message' => 'not found'], 200); - } - return $this->respond(['status' => 'success', 'data' => $row], 200); - } catch (\Exception $e) { - return $this->failServerError('Error: ' . $e->getMessage()); - } - } - - /** - * POST /api/patients - */ - public function create() { - $input = $this->request->getJSON(true); - - if (!$this->validateData($input, $this->rules)) { - return $this->failValidationErrors($this->validator->getErrors()); - } - - $input = camel_to_snake_array($input); // Convert keys to snake_case - - try { - $id = $this->model->insert($input); - return $this->respondCreated([ - 'status' => 'success', - 'message' => 'Created successfully', - 'data' => ['id' => $id] - ]); - } catch (\Exception $e) { - return $this->failServerError('Error: ' . $e->getMessage()); - } - } - - /** - * PATCH /api/patients/:id - */ - public function update($id = null) { - $input = $this->request->getJSON(true); - $input = camel_to_snake_array($input); - - try { - $this->model->update($id, $input); - return $this->respond(['status' => 'success', 'message' => 'updated']); - } catch (\Exception $e) { - return $this->failServerError('Error: ' . $e->getMessage()); - } - } -} -``` - -### 1.4 Standard API Response Format - -Always return this structure: - -```json -{ - "status": "success|error", - "message": "Human readable message", - "data": {} // or [] for lists -} -``` - ---- - -## 2. Frontend Patterns - -### 2.1 Base Layout (`app/Views/layout/main_layout.php`) - -The layout provides: -- Sidebar navigation with Alpine.js state -- Top navbar with user info -- Content section for page-specific content -- Script section for page-specific JavaScript - -```php - - -
- - -Manage patient records
-No records found
-