homoeopathy/
│
├── 📄 .htaccess                          # Apache configuration & URL rewriting
├── 📄 .env.example                       # Environment variables template
├── 📄 .gitignore                         # Git ignore rules
├── 📄 README.md                          # Project documentation
├── 📄 CHANGELOG.md                       # Version history
├── 📄 LICENSE                            # License file
├── 📄 composer.json                      # PHP dependencies
├── 📄 package.json                       # NPM dependencies
├── 📄 robots.txt                         # SEO directives
├── 📄 sitemap.xml                        # Dynamic sitemap generator
├── 📄 index.php                          # Landing page / login redirect
├── 📄 login.php                          # Login form & authentication
├── 📄 logout.php                         # Logout handler
├── 📄 install.php                        # One-time installation script (DELETE after use)
├── 📄 error.php                          # Custom error page
│
├── 📁 admin/                             # ADMIN SECTION (singular)
│   ├── 📄 dashboard.php                  # Admin main dashboard
│   ├── 📄 profile.php                    # Admin profile settings
│   ├── 📄 logout-all.php                 # Logout from all devices
│   │
│   ├── 📁 doctors/                       # Manage DOCTORS (plural - collection)
│   │   ├── 📄 index.php                  # List all doctors
│   │   ├── 📄 add.php                    # Add new doctor
│   │   ├── 📄 edit.php                   # Edit doctor details
│   │   ├── 📄 view.php                   # View doctor profile
│   │   ├── 📄 delete.php                 # Delete doctor account
│   │   ├── 📄 toggle-status.php          # Activate/deactivate doctor
│   │   └── 📄 export.php                 # Export doctors list to CSV
│   │
│   ├── 📁 subscriptions/                 # Manage SUBSCRIPTIONS (plural)
│   │   ├── 📄 index.php                  # List all subscriptions
│   │   ├── 📄 add.php                    # Add new subscription
│   │   ├── 📄 edit.php                   # Edit subscription
│   │   ├── 📄 renew.php                  # Renew subscription
│   │   ├── 📄 cancel.php                 # Cancel subscription
│   │   ├── 📄 plans.php                  # Manage subscription plans
│   │   └── 📄 reports.php                # Subscription reports
│   │
│   ├── 📁 rubrics/                       # Manage RUBRICS (plural)
│   │   ├── 📄 index.php                  # List all rubrics (tree view)
│   │   ├── 📄 add.php                    # Add new rubric
│   │   ├── 📄 edit.php                   # Edit rubric
│   │   ├── 📄 delete.php                 # Delete rubric
│   │   ├── 📄 bulk-import.php            # Bulk import rubrics from CSV
│   │   ├── 📄 export.php                 # Export rubrics
│   │   ├── 📄 reorder.php                # Reorder rubric hierarchy
│   │   └── 📄 search.php                 # AJAX rubric search
│   │
│   ├── 📁 remedies/                      # Manage REMEDIES (plural)
│   │   ├── 📄 index.php                  # List all remedies
│   │   ├── 📄 add.php                    # Add new remedy
│   │   ├── 📄 edit.php                   # Edit remedy details
│   │   ├── 📄 view.php                   # View remedy Materia Medica
│   │   ├── 📄 delete.php                 # Delete remedy
│   │   ├── 📄 bulk-import.php            # Bulk import remedies
│   │   ├── 📄 export.php                 # Export remedies list
│   │   └── 📄 assign-grade.php           # Assign grade to remedy in rubric
│   │
│   ├── 📁 settings/                      # System settings (plural)
│   │   ├── 📄 index.php                  # General settings
│   │   ├── 📄 ai-settings.php            # AI API configuration
│   │   ├── 📄 backup.php                 # Database backup
│   │   ├── 📄 restore.php                # Restore backup
│   │   └── 📄 system-info.php            # System information
│   │
│   └── 📁 reports/                       # Admin reports (plural)
│       ├── 📄 index.php                  # Reports dashboard
│       ├── 📄 doctors.php                # Doctor activity report
│       ├── 📄 subscriptions.php          # Subscription report
│       ├── 📄 revenue.php                # Revenue report
│       └── 📄 export.php                 # Export reports
│
├── 📁 doctor/                            # DOCTOR SECTION (singular - doctor's workspace)
│   ├── 📄 dashboard.php                  # Doctor main dashboard
│   ├── 📄 profile.php                    # Doctor profile settings
│   │
│   ├── 📁 cases/                         # CASE MANAGEMENT (plural)
│   │   ├── 📄 index.php                  # Cases dashboard overview
│   │   ├── 📄 list.php                   # List all cases
│   │   ├── 📄 new.php                    # Create new case with repertorization
│   │   ├── 📄 view.php                   # View case details
│   │   ├── 📄 edit.php                   # Edit case information
│   │   ├── 📄 save.php                   # Save case (POST handler)
│   │   ├── 📄 delete.php                 # Delete case
│   │   ├── 📄 prescribe.php              # Add prescription
│   │   ├── 📄 follow-up.php              # Add follow-up
│   │   ├── 📄 repertorize.php            # AJAX repertorization endpoint
│   │   ├── 📄 print.php                  # Print case report
│   │   ├── 📄 export.php                 # Export case to PDF
│   │   ├── 📄 search.php                 # Search cases
│   │   └── 📄 import.php                 # Import cases from CSV
│   │
│   ├── 📁 repertory/                     # REPERTORY BROWSER (singular)
│   │   ├── 📄 index.php                  # Browse repertory tree
│   │   ├── 📄 search.php                 # Search rubrics
│   │   ├── 📄 rubric.php                 # View single rubric with remedies
│   │   └── 📄 compare.php                # Compare two rubrics
│   │
│   ├── 📁 materia-medica/                # MATERIA MEDICA (singular)
│   │   ├── 📄 index.php                  # Browse remedies A-Z
│   │   ├── 📄 view.php                   # View remedy details
│   │   ├── 📄 search.php                 # Search remedies
│   │   ├── 📄 compare.php                # Compare remedies
│   │   └── 📄 bookmark.php               # Save favorite remedies
│   │
│   ├── 📁 ai/                            # AI FEATURES (abbreviation)
│   │   ├── 📄 analyze.php                # AI case analysis
│   │   ├── 📄 suggest-remedy.php         # AI remedy suggestions
│   │   ├── 📄 extract-rubrics.php        # AI extracts rubrics from text
│   │   ├── 📄 history.php                # AI analysis history
│   │   └── 📄 settings.php               # AI personal settings
│   │
│   ├── 📁 reports/                       # DOCTOR REPORTS (plural)
│   │   ├── 📄 index.php                  # Reports dashboard
│   │   ├── 📄 cases.php                  # Case statistics
│   │   ├── 📄 remedies.php               # Most prescribed remedies
│   │   ├── 📄 monthly.php                # Monthly case trend
│   │   └── 📄 export.php                 # Export reports
│   │
│   ├── 📁 reminders/                     # REMINDERS (plural)
│   │   ├── 📄 index.php                  # Upcoming follow-ups
│   │   ├── 📄 add.php                    # Add reminder
│   │   ├── 📄 edit.php                   # Edit reminder
│   │   └── 📄 send.php                   # Send reminder SMS/Email
│   │
│   └── 📁 api/                           # DOCTOR API ENDPOINTS
│       ├── 📄 save-case.php              # Save case via API
│       ├── 📄 get-cases.php              # Get cases for mobile app
│       └── 📄 sync.php                   # Sync with mobile app
│
├── 📁 api/                               # PUBLIC API ENDPOINTS
│   ├── 📄 login.php                      # API login
│   ├── 📄 register.php                   # API register
│   ├── 📄 add-rubric.php                 # AJAX: add rubric to session
│   ├── 📄 remove-rubric.php              # AJAX: remove rubric from session
│   ├── 📄 search-rubrics.php             # AJAX: search rubrics
│   ├── 📄 repertorize.php                # AJAX: repertorization
│   ├── 📄 get-remedy-details.php         # AJAX: get remedy info
│   ├── 📄 save-case.php                  # AJAX: save case
│   ├── 📄 upload-file.php                # AJAX: file upload
│   └── 📄 get-stats.php                  # AJAX: dashboard stats
│
├── 📁 config/                            # Configuration files
│   ├── 📄 database.php                   # Database connection (PDO)
│   ├── 📄 constants.php                  # System constants (grade weights, plans)
│   ├── 📄 auth.php                       # Authentication functions
│   ├── 📄 config.php                     # Master configuration
│   └── 📄 .htaccess                      # Protect config directory
│
├── 📁 includes/                          # Shared core functions
│   ├── 📄 functions.php                  # General utility functions
│   ├── 📄 rubric-tree.php                # Recursive rubric tree functions
│   ├── 📄 repertory-engine.php           # Repertorization scoring algorithms
│   ├── 📄 ai-integration.php             # Gemini/DeepSeek API integration
│   ├── 📄 validation.php                 # Form validation functions
│   ├── 📄 sanitize.php                   # Input sanitization
│   ├── 📄 pagination.php                 # Pagination helper
│   └── 📄 vendor.php                     # Vendor asset loader
│
├── 📁 assets/                            # STATIC ASSETS
│   ├── 📁 css/
│   │   ├── 📄 style.css                  # Main stylesheet
│   │   ├── 📄 admin.css                  # Admin-specific styles
│   │   ├── 📄 doctor.css                 # Doctor-specific styles
│   │   ├── 📄 responsive.css             # Mobile responsive
│   │   └── 📄 print.css                  # Print styles
│   │
│   ├── 📁 js/
│   │   ├── 📄 main.js                    # Core JavaScript
│   │   ├── 📄 rubric-tree.js             # Rubric tree interactions
│   │   ├── 📄 repertorization.js         # Repertorization engine
│   │   ├── 📄 ai-helper.js               # AI integration
│   │   ├── 📄 cases.js                   # Case management
│   │   ├── 📄 admin.js                   # Admin functions
│   │   ├── 📄 charts.js                  # Chart.js for reports
│   │   └── 📄 validation.js              # Form validation
│   │
│   ├── 📁 images/
│   │   ├── 📄 logo.png                   # Main logo
│   │   ├── 📄 logo-dark.png              # Dark theme logo
│   │   ├── 📄 logo-small.png             # Small logo for mobile
│   │   ├── 📄 favicon.ico                # Favicon
│   │   ├── 📄 favicon.svg                # SVG favicon
│   │   ├── 📄 apple-touch-icon.png       # iOS icon
│   │   └── 📄 og-image.png               # Social media preview
│   │
│   ├── 📁 vendor/                        # Third-party libraries
│   │   ├── 📁 bootstrap/                 # Bootstrap 5
│   │   │   ├── 📁 css/
│   │   │   └── 📁 js/
│   │   ├── 📁 jquery/                    # jQuery 3.6
│   │   ├── 📁 datatables/                # DataTables
│   │   ├── 📁 chartjs/                   # Chart.js
│   │   ├── 📁 summernote/                # WYSIWYG editor
│   │   └── 📁 fontawesome/               # Font Awesome 6
│   │
│   └── 📁 uploads/                       # User uploads
│       ├── 📁 cases/                     # Case attachments
│       ├── 📁 profiles/                  # Profile pictures
│       └── 📁 temp/                      # Temporary files
│
├── 📁 scripts/                           # CLI SCRIPTS
│   ├── 📄 check-subscriptions.php        # Cron: check expired subs
│   ├── 📄 send-reminders.php             # Cron: send follow-up reminders
│   ├── 📄 backup-database.php            # Backup script
│   ├── 📄 restore-database.php           # Restore script
│   ├── 📄 seed-sample-data.php           # Seed test data
│   ├── 📄 import-kent-complete.php       # Import Kent's Repertory
│   ├── 📄 migrate-database.php           # Run migrations
│   ├── 📄 optimize-database.php          # Optimize tables
│   ├── 📄 generate-sitemap.php           # Generate sitemap
│   └── 📄 cleanup-temp.php               # Clean temporary files
│
├── 📁 logs/                              # SYSTEM LOGS
│   ├── 📄 errors.log                     # PHP errors
│   ├── 📄 access.log                     # Access logs
│   ├── 📄 ai.log                         # AI API calls
│   └── 📄 cron.log                       # Cron job logs
│
├── 📁 backups/                           # DATABASE BACKUPS
│   └── 📄 (auto-generated .sql files)
│
├── 📁 tmp/                               # TEMPORARY FILES
│   ├── 📁 cache/                         # Query cache
│   ├── 📁 sessions/                      # PHP sessions
│   ├── 📁 uploads/                       # Temp uploads
│   └── 📁 login_attempts/                # Login attempt tracking
│
└── 📁 database/                          # DATABASE SCHEMA
    ├── 📄 schema.sql                     # Complete database schema
    ├── 📄 migrations/                    # Migration files
    └── 📄 seeds/                         # Seed data