A simple web-based chat application built with PHP, MySQL, HTML, CSS, and AJAX.
This project was originally created as a small PHP/AJAX web development project and has been revisited and updated as part of a review and modernization of older personal projects.
- Simple web-based chat interface
- PHP backend
- MySQL/MariaDB database
- AJAX-based message handling
- Environment-based database configuration
- Lightweight project structure
- PHP 8.x
- MySQL or MariaDB
- A web server capable of running PHP
- PHP
mysqliextension
Database credentials are loaded from a .env file.
Create a .env file in the project root based on .env.example:
DB_HOST=db
DB_USER=your_username
DB_PASSWORD=your_password
DB_NAME=your_databaseDo not commit .env to version control.
Import the provided database schema into your MySQL/MariaDB database before running the application.
For example:
mysql -u your_username -p your_database < chat.sqlThen configure the database credentials in .env.
Configure your web server so that the project directory is served as the document root.
For example:
http://localhost/
The project can also be run through a local Docker-based development environment.
.
├── chat.php # Chat message handling
├── db.php # Database connection
├── index.php # Main application page
├── style.css # Application styling
├── chat.sql # Database schema
├── .env.example # Example environment configuration
└── LICENSE # Project license
This project is primarily a small PHP development and learning project. It is not intended to be a production-ready chat platform.
Before deploying it publicly, additional work should be done around authentication, authorization, input validation, output escaping, CSRF protection, rate limiting, database security, and general application hardening.
Originally developed as an early PHP/AJAX web development project and later revisited as part of a broader review and modernization of older personal projects.
This project is licensed under the GNU General Public License v3.0.
See the LICENSE file for the complete license text.