A simple real-time chatting application built with React (frontend) and Node.js (backend).
This project has been extended to use MySQL (via PHP scripts) for storing chat rooms and messages.
Users can:
- Join existing chat rooms.
- Create new chat rooms.
- View all past messages in a room upon joining.
- Exchange messages in real time.
🔹 Create and join chat rooms.
🔹 Persistent message storage using MySQL.
🔹 API calls to PHP endpoints for message retrieval and saving.
🔹 Node.js backend and React frontend for seamless chat experience.
git clone https://github.com/your-username/Demo-Chatting-App.git
cd Demo-Chatting-App -
XAMPP (for Apache + MySQL)
-
Node.js (for backend + frontend servers)
-
Start XAMPP and launch Apache + MySQL.
-
Open phpMyAdmin and create a database named:
chat_db3.You can stop Apache and MySQL after successfully creating the database.
- Inside xampp/htdocs, create a folder named:
chat-app
- Move the following files from the cloned project folder into it:
-
index.php
-
save_message.php
-
fetch_messages.php
Path should look like:
xampp/htdocs/chat-app/
├── index.php
├── save_message.php
└── fetch_messages.phpFrom the project root (Demo-Chatting-App), run:
Backend (Node.js server):
cd server
npm installFrontend (React client):
cd ../client
npm install-
Start Apache and MySQL servers in XAMPP.
-
Open the project in VS Code (or your editor of choice).
Start the backend server:
cd server
node index.jsStart the frontend (React) server:
cd client
npm start- The app will automatically open in your browser. 🎉
Demo-Chatting-App/
│
├── client/ # React frontend
├── server/ # Node.js backend
├── chat-app/ # PHP scripts (to be placed inside xampp/htdocs/)
│ ├── index.php
│ ├── save_message.php
│ └── fetch_messages.php
└── README.mdMake sure XAMPP servers are running before using the app.
All messages and chat rooms are stored in MySQL (chat_db).
PHP scripts act as API endpoints for storing and fetching chat data.
The base project (React + Node.js chat application) was originally built by my college teammate. I contributed by extending the project to integrate MySQL database support through PHP APIs (index.php, save_message.php, fetch_messages.php).
This project is open-source. You’re free to use, modify, and distribute it.