Skip to content

AnyChat, a real-time chat application developed using React.js, Node.js, Socket.IO, and Firebase. Implemented Firebase Realtime Database for seamless data synchronization and integrated Firebase Authentication for secure user access.

License

Notifications You must be signed in to change notification settings

ImHappyKumar/any-chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnyChat

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.


🚀 Features

  • 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.

✅ Prerequisites

Ensure the following are installed:


🔧 Installation

  1. Clone this repository:

    git clone https://github.com/ImHappyKumar/any-chat.git
    cd any-chat
  2. Install dependencies:

    cd client
    npm install
    cd ../server
    npm install

⚙️ Configuration

🔒 1. Setup Environment Variables

  • Rename .env.example to .env in both client/ and server/ folders.
  • Replace placeholder values with your actual environment values.

📁 2. Configure Firebase – Client Side

  • Replace the contents of client/src/firebase.js.example with your Firebase config.
  • Rename firebase.js.example to firebase.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;

🔐 3. Configure Firebase – Server Side

  • Rename serviceAccountKey.json.example to serviceAccountKey.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;

🚀 4. Set up Firebase Hosting (Optional):

  • Rename .firebaserc.example to .firebaserc.
  • Replace the default project ID with your own Firebase project ID:
    {
      "projects": {
        "default": "your-project-id"
      }
    }
    

▶️ Usage

  1. Start the backend server:

    cd server
    npm start
  2. Start the frontend app:

    cd client
    npm start
  3. Open in Browser:


🤝 Contributing

Feel free to fork the repo, create a new branch, and submit a pull request. Issues and suggestions are welcome!

About

AnyChat, a real-time chat application developed using React.js, Node.js, Socket.IO, and Firebase. Implemented Firebase Realtime Database for seamless data synchronization and integrated Firebase Authentication for secure user access.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published