Skip to content

mmahdiTor/chatRoom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💬 PHP Chat Room

A modern real-time chat room built with PHP + SQLite + AJAX
Designed with a glassmorphism UI and dark/light theme support.


✨ Features

  • 🔐 Session-based login system
  • 💬 Real-time chat using AJAX (no page refresh)
  • 😀 Emoji support
  • 🌓 Dark / Light mode toggle
  • ⏱ Message timestamps
  • 📱 Fully responsive (mobile & desktop)
  • 💾 SQLite database (auto-created on first run)

🧠 Performance & Hosting

This chat room is designed to be lightweight and optimized.

  • 🚀 Runs smoothly even on low-end hosting (as low as 512MB RAM)
  • 💾 Uses SQLite, no heavy database server required
  • 🧹 Automatically keeps only the last 100 messages
  • 🗑 Older messages are deleted automatically to reduce disk usage
  • ⚡ Optimized AJAX polling for fast and efficient message updates

Perfect for small VPS, shared hosting, or minimal server environments.


🛠 Technologies Used

  • PHP (PDO)
  • SQLite
  • JavaScript (Fetch API)
  • HTML5 / CSS3
  • Google Fonts (Inter)

🚀 Installation

Follow these steps to run the project on your host:

  1. Clone or download the repository
git clone https://github.com/mmahdiTor/chatRoom.git
  1. Upload the files to your host
    Upload all project files to your hosting panel
    (cPanel / DirectAdmin / etc)

  2. Run the project
    Open your domain in the browser
    The database will be created automatically on first run

  3. Login
    Default users are defined inside login.php


👤 User Configuration

User accounts are defined manually inside the login.php file.

To add or edit users:

  1. Open login.php
  2. Locate the $users array
  3. Add a username and password as needed

Example:

$users = [
    "mahdi" => "1234",
    "Ali" => "5678"
];

📸 Screenshots

Chat Room

Light Mode Dark Mode
Chat Light Mode Chat Dark Mode

Login Page

Login Page

👤 Author

Developed by MahdiTor


📄 License

This project is licensed under the MIT License
Feel free to use, modify, and distribute it.


⭐ If you like this project, don’t forget to give it a star on GitHub!

Releases

No releases published

Packages

No packages published

Languages