Skip to content

ahmed-ali-codes/meditrack-clinic-crm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ₯ MediTrack Clinic CRM

A lightweight, portable General Clinic CRM built with PHP and flat-file JSON storage β€” no database required.

PHP License Storage Status

MediTrack is a self-hosted clinic appointment management system designed for general healthcare practices. Built for speed, portability, and simplicity β€” no MySQL, no setup complexity, just drop it on any PHP server and go.

πŸ’‘ Looking for the Dental version? Check out SmileCare Dental CRM β€” same philosophy, built specifically for dental clinics.


✨ Features

  • πŸ“… Patient Booking Form β€” Public-facing form capturing name, phone, email, date, time, department, patient type, and reason for visit
  • πŸ₯ Department Selection β€” General Physician, Pediatrics, Cardiology, Dermatology, Orthopedics, ENT, and more
  • πŸ†• New vs Returning Patient β€” Patient type tracking with visual badges in the admin panel
  • πŸ” Secure Admin Panel β€” bcrypt-hashed password login with PHP session authentication
  • πŸ“Š Dashboard β€” 4 stat cards (Today, Pending, Completed This Month, Total) in a clean 2Γ—2 grid
  • πŸ“ˆ Department Breakdown β€” CSS-only horizontal bar chart showing appointment volume per department
  • πŸ“‹ Appointments Manager β€” Full list with pagination, date/status/department filters, and detail view
  • ⚑ Status Workflow β€” Inline updates: Pending β†’ Confirmed β†’ Completed / Cancelled
  • πŸ—‚οΈ Flat-File Storage β€” All data stored in JSON. Zero SQL setup needed
  • πŸ”’ Directory Protection β€” Auto-generated .htaccess blocks direct access to data files
  • πŸ–₯️ Sidebar Layout β€” Left sidebar admin navigation with charcoal dark theme
  • πŸ“© Automated Notifications β€” Native PHP mail for confirmations, admin alerts, and 24h cron reminders
  • πŸ›‘οΈ Security Built-In β€” CSRF token protection and brute-force rate limiting
  • πŸ“€ Export Capabilities β€” Export appointments to CSV or .ics (iCal format)
  • βš™οΈ Central Configuration β€” Easy configuration via config.php for timezone, clinic name, etc.

πŸ“Έ Screenshots

Booking Form Screenshot

Admin Dashboard Screenshot


🎨 Design System

Token Value
Primary Deep Teal #0D6E6E
Accent Soft Emerald #2ECC71
Background Warm Gray #F4F6F5
Sidebar Dark Charcoal #1A2B2B
Success #27AE60
Warning #F39C12
Danger #E74C3C
Font Plus Jakarta Sans (Google Fonts)
Border Radius 12px (cards, buttons, rows)

πŸ› οΈ Tech Stack

Layer Technology
Language PHP (Server-Side Rendering)
Frontend HTML5, Vanilla CSS, Google Fonts (Plus Jakarta Sans)
Storage Flat-File JSON (appointments.json, meta.json)
Auth PHP Native Sessions + bcrypt
Server Apache / Any PHP 7.4+ host

πŸš€ Getting Started

Requirements

  • PHP 7.4 or higher
  • Apache or Nginx with PHP support
  • No database required

Installation

  1. Clone the repository
git clone https://github.com/YOUR_USERNAME/meditrack-clinic-crm.git
cd meditrack-clinic-crm
  1. Place in your server root
# XAMPP / WAMP β†’ drop into htdocs/
# Live server  β†’ upload via FTP/SCP to public_html/
  1. Set up Configuration

Copy the example configuration file and update it with your own credentials:

cp includes/config.example.php includes/config.php
  1. Ensure the data/ directory is writable
chmod 755 data/

The app auto-initializes appointments.json, meta.json, and .htaccess on first run.

  1. Visit the app
http://localhost/meditrack-clinic-crm/          # Patient Booking Form
http://localhost/meditrack-clinic-crm/admin/    # Admin Login

πŸ”‘ Admin Login

Field Value
Username Defined by you in config.php
Password Defined by you in config.php

⚠️ No default password is provided for security reasons.

  1. Copy includes/config.example.php to includes/config.php
  2. Generate a secure password hash via terminal:
    php -r "echo password_hash('your_secure_password', PASSWORD_BCRYPT);"
  3. Paste the generated hash into includes/config.php as ADMIN_PASSWORD_HASH
  4. Set your ADMIN_USERNAME in the same file.

πŸ“ Project Structure

meditrack-clinic-crm/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ style.css              # Full stylesheet β€” teal theme, sidebar layout, badges
β”‚   └── images/                # Screenshots for documentation
β”œβ”€β”€ data/
β”‚   β”œβ”€β”€ .htaccess              # Auto-generated β€” blocks direct web access
β”‚   β”œβ”€β”€ appointments.json      # All appointment records
β”‚   └── meta.json              # Auto-increment ID tracker
β”œβ”€β”€ includes/
β”‚   β”œβ”€β”€ auth.php               # Session + require_login() middleware
β”‚   β”œβ”€β”€ config.example.php     # Template for clinic settings & credentials
β”‚   β”œβ”€β”€ csrf.php               # CSRF token generation and validation
β”‚   β”œβ”€β”€ mailer.php             # Email sending functions for confirmations & alerts
β”‚   β”œβ”€β”€ rate_limit.php         # Basic rate limiting for forms
β”‚   └── storage.php            # CRUD functions (JSON-based)
β”œβ”€β”€ admin/
β”‚   β”œβ”€β”€ login.php              # Split-screen admin login page
β”‚   β”œβ”€β”€ logout.php             # Session destroy
β”‚   β”œβ”€β”€ dashboard.php          # Stats grid + department chart + recent appointments
β”‚   β”œβ”€β”€ appointments.php       # Full list, filters (date/status/dept), detail view, actions
β”‚   β”œβ”€β”€ patients.php           # Patient management view
β”‚   β”œβ”€β”€ settings.php           # Admin settings view
β”‚   β”œβ”€β”€ export_csv.php         # Export data to CSV
β”‚   └── export_ical.php        # Export data to iCal
β”œβ”€β”€ book.php                   # POST handler for booking form
β”œβ”€β”€ cron_reminders.php         # Script to run via cron for 24h email reminders
└── index.php                  # Public patient booking landing page

πŸ—ƒοΈ Appointment Data Schema

Each record in appointments.json contains:

{
  "id": 1,
  "name": "Sara Ahmed",
  "phone": "+971501234567",
  "email": "sara@example.com",
  "date": "2025-07-15",
  "time": "10:30",
  "department": "Cardiology",
  "patient_type": "new",
  "reason": "Follow-up Visit",
  "status": "Pending",
  "created_at": "2025-06-10 14:22:00"
}

Records without department or patient_type (from older imports) load safely β€” all functions handle missing fields gracefully.


πŸ”’ Security

  • All user input sanitized with htmlspecialchars() before rendering
  • Admin password stored as bcrypt hash β€” never plain text
  • data/ directory protected from direct HTTP access via auto-generated .htaccess
  • Admin routes protected by session middleware (require_login())

πŸ—ΊοΈ Roadmap

  • Email confirmation to patient on booking
  • Admin email alert on new submission
  • CSRF token protection on all forms
  • Appointment reminder via cron job + email
  • iCal / .ics export for Google Calendar / Outlook
  • config.php for clinic name, email, timezone, and available slots
  • Time slot conflict detection per department
  • Internal admin notes per appointment
  • Multi-clinic / multi-branch support
  • Doctor-specific scheduling (assign appointments to a specific doctor)

🀝 Contributing

Contributions are welcome! Fork the repo, open issues, or submit pull requests.

  1. Fork the project
  2. Create your feature branch (git checkout -b feature/email-notifications)
  3. Commit your changes (git commit -m 'Add PHPMailer confirmation emails')
  4. Push to the branch (git push origin feature/email-notifications)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License.


πŸ‘¨β€πŸ’» Author

Ahmed Ali


πŸ”— Related Projects

Project Description
SmileCare Dental CRM Same stack, purpose-built for dental clinics

Built with ❀️ for general clinics and healthcare practices that need a clean, reliable, zero-dependency booking system.

About

A lightweight, portable General Clinic CRM built with PHP and flat-file JSON storage. Features patient booking, department selection, sidebar admin dashboard, and zero database setup required.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors