A browser-based one-to-one chat application built with PHP, MySQL, and JavaScript. Users can register, sign in, browse other users, and exchange messages through PHP endpoints.
✨ Features
- Signup and login forms with session-based authentication.
- User directory and user-name search.
- One-to-one message send and conversation display.
- User avatars and active-status updates in the application flow.
chatapp.sqldefines theusersandmessagestables.
🏗️ Architecture
PHP pages render signup, login, user-list, and conversation views. JavaScript sends AJAX requests to PHP scripts under php/; these scripts use mysqli to read or write the MySQL database. There is no separate API server or WebSocket service in this repository.
🧰 Tech stack
| Area | Technology |
|---|---|
| Server | PHP |
| Database | MySQL / MariaDB with mysqli |
| Browser | HTML, CSS, JavaScript, AJAX |
| Local web server | Apache or another PHP-capable server |
🚀 Getting started
- Install PHP with the
mysqliextension and MySQL or MariaDB, plus a local PHP web server (for example, XAMPP). - Create a database named
chatappand importchatapp.sqlusing phpMyAdmin or the MySQL client. - Review
php/config.phpand configure the database host, username, password, and database name. The committed values assume a local MySQL setup. - Serve the repository from the web server's document root and open
index.phpin a browser. - Ensure the app's image-upload directory is present and writable by PHP when testing signup with an avatar.
📁 Project structure
├── index.php / login.php / users.php # Signup, login, user list
├── chat.php # Conversation page
├── php/config.php # Database connection
├── php/ # AJAX and database handlers
├── javascript/ # Browser interactions
└── chatapp.sql # Database schema
🗺️ Roadmap / Notes
- This is a small learning project; it has no dependency manifest, automated tests, or production deployment configuration.
- The database settings are hard-coded for a local environment and must be changed before deployment.
- The login implementation compares MD5 password hashes; MD5 is not suitable for password storage in a production application.
👤 Author
Brian Dol, Senior Full Stack Engineer · Portfolio · LinkedIn