Developed by Happy Kumar
AnyChat is a real-time chat application built using React.js, Node.js, Socket.IO, and Firebase. It uses Firebase Realtime Database for seamless data synchronization and Firebase Authentication for secure user access.
- Real-Time Chat – Engage in real-time conversations via Socket.IO.
- Firebase Integration – Real-time data sync using Firebase Realtime Database.
- Authentication – Secure user login with Firebase Auth.
- Responsive UI – User-friendly chat interface.
Ensure the following are installed:
-
Clone this repository:
git clone https://github.com/ImHappyKumar/any-chat.git cd any-chat
-
Install dependencies:
cd client npm install cd ../server npm install
- Rename
.env.example
to.env
in bothclient/
andserver/
folders. - Replace placeholder values with your actual environment values.
- Replace the contents of
client/src/firebase.js.example
with your Firebase config. - Rename
firebase.js.example
tofirebase.js
.
// client/src/firebase.js
import { initializeApp } from "firebase/app";
import { getAuth } from "firebase/auth";
const firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
databaseURL: "YOUR_DATABASE_URL",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
const app = initializeApp(firebaseConfig);
export const auth = getAuth(app);
export default app;
- Rename
serviceAccountKey.json.example
toserviceAccountKey.json
and add your Firebase Admin credentials. - In
server/firebaseConfig.js
, make sure it looks like this:
// server/firebaseConfig.js
const admin = require("firebase-admin");
const serviceAccount = require("./serviceAccountKey.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://your-project-id.firebaseio.com"
});
module.exports = admin;
- Rename
.firebaserc.example
to.firebaserc
. - Replace the
default
project ID with your own Firebase project ID:{ "projects": { "default": "your-project-id" } }
-
Start the backend server:
cd server npm start
-
Start the frontend app:
cd client npm start
-
Open in Browser:
- Visit http://localhost:3000
Feel free to fork the repo, create a new branch, and submit a pull request. Issues and suggestions are welcome!