Skip to content

raritysoftware/OpenPsychologist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

OpenPsychologist

A modern, responsive psychology appointment management system built with pure PHP and SQLite3. This application enables psychologists to manage their appointment schedules while allowing patients to book appointments seamlessly.

Version PHP SQLite Bootstrap Docker

🌟 Features

For Administrators

  • Time Slot Management: Create, view, and manage available appointment slots
  • Appointment Oversight: Review, approve, or cancel appointment requests
  • User Management: Monitor registered users and their appointment history
  • Dashboard Analytics: Quick overview of pending requests and system statistics

For Users/Patients

  • Easy Registration: Simple account creation process
  • Appointment Booking: Browse available time slots and book appointments instantly
  • Appointment Tracking: View appointment status (pending, approved, cancelled)
  • Profile Management: Update personal information and account settings

Technical Features

  • Responsive Design: Modern Bootstrap 5 interface that works on all devices
  • Role-Based Access: Secure admin and user role separation
  • Session Management: Secure authentication and session handling
  • SQLite Database: Lightweight, file-based database with automatic setup
  • Docker Ready: Containerized development and deployment

πŸš€ Quick Start

Prerequisites

  • Docker and Docker Compose v2
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd OpenPsychologist
  2. Start the application

    ./start.sh

    Or manually:

    docker compose up --build
  3. Access the application

    • Open your browser and navigate to: http://localhost:8080
    • The application will be ready to use immediately

Default Admin Credentials

  • Email: admin@psychologist.com
  • Password: admin123

⚠️ Important: Change the default admin password after first login in a production environment.

πŸ› οΈ Technology Stack

  • Backend: Pure PHP 8.2+ (no frameworks)
  • Database: SQLite3 with automatic schema creation
  • Frontend: Bootstrap 5.3.0 with custom CSS
  • Containerization: Docker with PHP built-in server
  • Development: Hot-reload capable with volume mounting

πŸ“ Project Structure

OpenPsychologist/
β”œβ”€β”€ public/                 # Web root directory
β”‚   β”œβ”€β”€ index.php          # Application entry point
β”‚   β”œβ”€β”€ css/               # Custom stylesheets
β”‚   └── js/                # JavaScript files
β”œβ”€β”€ src/                   # Application source code
β”‚   β”œβ”€β”€ config/            # Configuration classes
β”‚   β”‚   β”œβ”€β”€ Database.php   # Database connection & schema
β”‚   β”‚   β”œβ”€β”€ Router.php     # URL routing system
β”‚   β”‚   └── Session.php    # Session management
β”‚   β”œβ”€β”€ controllers/       # Request handlers
β”‚   β”‚   β”œβ”€β”€ AuthController.php
β”‚   β”‚   β”œβ”€β”€ AdminController.php
β”‚   β”‚   β”œβ”€β”€ UserController.php
β”‚   β”‚   └── BookingController.php
β”‚   β”œβ”€β”€ models/            # Data models
β”‚   β”‚   └── User.php
β”‚   └── views/             # HTML templates
β”‚       β”œβ”€β”€ layout.php     # Main layout template
β”‚       β”œβ”€β”€ admin/         # Admin-specific views
β”‚       β”œβ”€β”€ auth/          # Authentication views
β”‚       └── user/          # User-specific views
β”œβ”€β”€ data/                  # SQLite database files
β”œβ”€β”€ docker-compose.yml     # Docker configuration
β”œβ”€β”€ Dockerfile            # Container definition
└── start.sh              # Quick start script

🎯 Usage Guide

For Administrators

  1. Login with admin credentials
  2. Manage Time Slots:
    • Navigate to Admin β†’ Time Slots
    • Create new available appointment slots
    • Set date, time, and optional descriptions
  3. Review Appointments:
    • Go to Admin β†’ Appointments
    • Approve or cancel pending requests
    • View appointment history
  4. Monitor Users:
    • Access Admin β†’ Users
    • View registered users and their activity

For Users/Patients

  1. Register a new account or Login
  2. Book Appointment:
    • Click "Book Appointment" from dashboard
    • Select from available time slots
    • Submit booking request
  3. Track Status:
    • View "My Appointments" for status updates
    • Check if appointments are pending, approved, or cancelled
  4. Manage Profile:
    • Update personal information
    • Change contact details

πŸ”§ Configuration

Environment Variables

You can customize the application using environment variables in docker-compose.yml:

environment:
  - PHP_ENV=development    # development|production
  - APP_PORT=8080         # Application port

Port Configuration

To run on a different port:

PORT=3000 docker compose up

Database Location

The SQLite database is stored in the data/ directory and is automatically created on first run.

🐳 Docker Commands

# Start the application
docker compose up

# Start in background
docker compose up -d

# Rebuild containers
docker compose up --build

# Stop the application
docker compose down

# View logs
docker compose logs -f

πŸ”’ Security Features

  • Password Hashing: Secure bcrypt password hashing
  • Session Security: Secure session management with regeneration
  • SQL Injection Protection: Prepared statements throughout
  • Role-Based Access: Admin and user role separation
  • Input Validation: Server-side validation for all forms

πŸ“± Responsive Design

The application is fully responsive and works seamlessly on:

  • Desktop (1200px+)
  • Tablet (768px - 1199px)
  • Mobile (< 768px)

All admin and user interfaces adapt to screen size for optimal user experience.

πŸš€ Deployment

Production Deployment

  1. Clone the repository on your server
  2. Update default credentials in src/config/Database.php
  3. Set environment to production:
    environment:
      - PHP_ENV=production
  4. Configure reverse proxy (Nginx/Apache) if needed
  5. Set up SSL certificate for HTTPS
  6. Run the application:
    docker compose up -d

Database Backup

# Create backup
cp data/psychologist.db backup/psychologist_$(date +%Y%m%d).db

# Restore backup
cp backup/psychologist_YYYYMMDD.db data/psychologist.db

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch: git checkout -b feature/AmazingFeature
  3. Commit your changes: git commit -m 'Add some AmazingFeature'
  4. Push to the branch: git push origin feature/AmazingFeature
  5. Open a Pull Request

πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ› Troubleshooting

Common Issues

Port already in use

# Check what's using the port
lsof -i :8080
# Use different port
PORT=3000 docker compose up

Database permission errors

# Fix permissions
chmod 755 data/
chmod 666 data/psychologist.db

Container build issues

# Clean rebuild
docker compose down
docker system prune
docker compose up --build

πŸ“ž Support

For support, please open an issue on GitHub or contact the development team.

πŸŽ‰ Acknowledgments

  • Bootstrap team for the excellent CSS framework
  • PHP community for maintaining great documentation
  • Docker for containerization simplicity

Made with ❀️ for healthcare professionals and their patients.