Skip to content

defaultroot-ai/cabinete

Repository files navigation

Medical Booking System

Version WordPress PHP License

Complete WordPress plugin for medical appointment booking with CNP authentication, multi-phone support, and comprehensive patient management.

✨ Features

πŸ” Authentication & Security

  • βœ… CNP-based authentication (Romanian Personal ID)
  • βœ… Multi-authentication methods: Login with CNP, Email, or Phone
  • βœ… Multi-phone support: Users can add multiple phone numbers
  • βœ… 2FA Ready: TOTP (Google Authenticator) implementation ready
  • βœ… Rate limiting: Protection against brute force attacks
  • βœ… CNP masking: Privacy-compliant display (*********1234)
  • βœ… GDPR compliant: Secure data handling

πŸ“… Booking System

  • βœ… Appointment booking: Intuitive React-based booking flow
  • βœ… Doctor management: Complete doctor profiles with specialties
  • βœ… Service management: Configurable medical services with duration and pricing
  • βœ… Schedule management: Doctor working hours and breaks
  • βœ… Calendar integration: Visual appointment calendar
  • βœ… Conflict detection: Automatic double-booking prevention

πŸ‘₯ Role-Based Access

  • βœ… Patient: Book appointments, view own appointments
  • βœ… Receptionist: Manage all appointments, create patients
  • βœ… Medical Assistant: View appointments, manage patients
  • βœ… Doctor: View own appointments, manage schedule
  • βœ… Manager: Full access with analytics and reports

🌍 Internationalization

  • βœ… Romanian translations: Complete ro_RO translation
  • βœ… Translation ready: .pot file for additional languages
  • βœ… RTL support ready: Structure prepared for RTL languages

πŸ”Œ REST API

  • βœ… Authentication endpoints: Register, login, 2FA
  • βœ… Booking endpoints: Services, doctors, slots, appointments
  • βœ… Phone management: Add, remove, set primary phone
  • βœ… User management: Profile, settings, preferences

πŸš€ Quick Start

Installation

  1. Upload Plugin

    # Upload to your WordPress installation
    /wp-content/plugins/medical-booking-system/
  2. Activate Plugin

    • Go to WordPress Admin β†’ Plugins
    • Find "Medical Booking System"
    • Click Activate
  3. Initial Setup

    • Database tables are created automatically
    • User roles are configured automatically
    • Default services are added
  4. Configure Settings

    • Go to Medical Booking β†’ Settings
    • Configure basic settings
    • Add doctors and services

Basic Usage

For Booking Form:

[mbs_booking]

For Login/Register:

[mbs_auth]

For Patient Dashboard:

[mbs_patient_dashboard]

πŸ“š Documentation

Comprehensive documentation is available in the docs/ folder:

Document Description
TODO.md Development roadmap and task tracking
AUTHENTICATION.md Complete authentication system guide
SETTINGS.md Settings system and configuration guide
QUICK-START.md 5-minute quick start guide
2FA-IMPLEMENTATION.md Two-factor authentication guide
PROJECT-PLAN.md Detailed project architecture

Quick Links

πŸ› οΈ Technical Stack

  • Backend: PHP 7.4+, WordPress 5.0+
  • Frontend: React 18, Tailwind CSS
  • Database: MySQL 5.6+ / MariaDB 10.0+
  • Libraries:
    • PHPGangsta/GoogleAuthenticator (2FA)
    • Babel Standalone (JSX transformation)

πŸ“¦ System Requirements

  • WordPress: 5.0 or higher
  • PHP: 7.4 or higher
  • MySQL: 5.6 or higher / MariaDB 10.0+
  • PHP Extensions: mysqli, json, mbstring
  • Apache Modules: mod_rewrite (for permalinks)

πŸ—„οΈ Database Schema

The plugin creates 10 custom tables:

Table Purpose
wp_mbs_services Medical services
wp_mbs_doctors Doctor profiles
wp_mbs_doctor_services Doctor-service associations
wp_mbs_doctor_schedules Working hours
wp_mbs_doctor_breaks Breaks and holidays
wp_mbs_patients Patient records
wp_mbs_appointments Appointments
wp_mbs_appointment_history Audit trail
wp_mbs_notifications Email/SMS queue
wp_mbs_settings Plugin settings
wp_mbs_user_phones Multi-phone support

Plus user metadata for CNP and 2FA.

πŸ”Œ REST API Endpoints

Authentication

POST   /wp-json/mbs/v1/auth/register
POST   /wp-json/mbs/v1/auth/login
GET    /wp-json/mbs/v1/auth/me
GET    /wp-json/mbs/v1/auth/phones
POST   /wp-json/mbs/v1/auth/phones
DELETE /wp-json/mbs/v1/auth/phones/{id}
PUT    /wp-json/mbs/v1/auth/phones/{id}/primary

Booking

GET    /wp-json/mbs/v1/services
GET    /wp-json/mbs/v1/doctors?serviceId={id}
GET    /wp-json/mbs/v1/slots?doctorId={id}&date={date}&duration={min}
POST   /wp-json/mbs/v1/appointments
GET    /wp-json/mbs/v1/appointments

See AUTHENTICATION.md for detailed API documentation.

🎨 Shortcodes

Shortcode Description Example
[mbs_booking] Appointment booking form [mbs_booking]
[mbs_auth] Login/Register form [mbs_auth]
[mbs_patient_dashboard] Patient's appointments [mbs_patient_dashboard]

πŸ”’ Security Features

  • βœ… Nonce verification: All AJAX/REST requests protected
  • βœ… SQL injection protection: Prepared statements only
  • βœ… XSS prevention: All output escaped
  • βœ… CSRF protection: WordPress nonce system
  • βœ… Rate limiting: 20 requests/minute per user/IP
  • βœ… CNP validation: Romanian CNP algorithm verification
  • βœ… Password hashing: WordPress native bcrypt
  • βœ… Capability checks: Role-based access control

πŸ“Š Current Status

Version: 1.1.0
Status: βœ… PRODUCTION READY for authentication system
Next Features: Booking flow finalization, admin UI, email notifications

What's Working

  • βœ… Complete authentication system
  • βœ… Multi-authentication (CNP/Email/Phone)
  • βœ… Database structure
  • βœ… REST API foundation
  • βœ… React booking UI (basic)
  • βœ… Admin menu structure
  • βœ… User roles and capabilities

In Development

  • πŸ”¨ Doctor schedule management
  • πŸ”¨ Admin UI for doctors/services
  • πŸ”¨ Email notifications
  • πŸ”¨ Patient dashboard
  • πŸ”¨ 2FA implementation
  • πŸ”¨ Reporting and analytics

See docs/TODO.md for detailed roadmap.

🀝 Contributing

This is a private/commercial plugin. For issues and feature requests, contact the development team.

πŸ“„ License

This plugin is licensed under the GNU General Public License v2 or later.

Copyright (C) 2025 Medical Booking System

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

πŸ‘¨β€πŸ’» Development Team

For support and customization requests, contact your development team.

πŸ“ Changelog

See CHANGELOG.md for version history.


Made with ❀️ for Romanian medical practices

Last updated: October 20, 2025

About

Clinica Dev

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published