A modern real-time chat room built with PHP + SQLite + AJAX
Designed with a glassmorphism UI and dark/light theme support.
- 🔐 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)
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.
- PHP (PDO)
- SQLite
- JavaScript (Fetch API)
- HTML5 / CSS3
- Google Fonts (Inter)
Follow these steps to run the project on your host:
- Clone or download the repository
git clone https://github.com/mmahdiTor/chatRoom.git-
Upload the files to your host
Upload all project files to your hosting panel
(cPanel / DirectAdmin / etc) -
Run the project
Open your domain in the browser
The database will be created automatically on first run -
Login
Default users are defined insidelogin.php
User accounts are defined manually inside the login.php file.
To add or edit users:
- Open
login.php - Locate the
$usersarray - Add a username and password as needed
Example:
$users = [
"mahdi" => "1234",
"Ali" => "5678"
];| Light Mode | Dark Mode |
|---|---|
|
|
|
Developed by MahdiTor
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!


