RishiBakshii / mern-chat-e2ee

Baatchit (MERN CHAT) end-to-end-encrypted realtime chat application with features like message reactions, typing-indicators, friend request, last seen, file/gif sharing, edit/delete messages, polling, group chats, user active status, push notifications, pwa, private key recovery, google-auth, otp-verification
https://baatchit.online
MIT License
79 stars 4 forks source link
aggregate-pipelines chat-app cloudinary debouncing docker-compose end-to-end-encryption firebase-push-notifications framer-motion google-auth mern-chat passport-js react-hook-form realtime redux-toolkit rtk-query socket-io tailwind typescript web-crypto-api zod

MERN CHAT E2EE 🗨️

Baatchit is a modern real-time chat application designed to facilitate seamless communication between users. With Baatchit, users can engage in conversations, share files, see when others are typing, and more, all in real-time.

Baatchit Baatchit

Features ✨

Technologies Used 🛠️

Frontend Technologies Used:

Backend Technologies Used:

Getting Started 🚀

To get started with Baatchit, follow these steps:

  1. Clone the repository: git clone https://github.com/RishiBakshii/Baatchit
  2. Navigate to the project directory: cd Baatchit

Setting Up Environment Variables 🌐

Before starting the application, ensure you set up the necessary environment variables. Both the frontend and backend have a .env.example file provided. Follow these steps:

  1. Copy the provided .env.example file: Use this file to create your own .env file in both the frontend and backend directories.

  2. Update .env with your credentials: Open the .env file in each directory (frontend and backend) and replace the placeholder values with your actual credentials and secrets. This includes API keys, database URLs, and any other sensitive information required by the application.

  3. Set up Firebase Admin credentials:

    • In the backend/src directory, create a file named firebase-admin-cred.json.
    • Place your Firebase service account credentials in this file. Ensure the path to this file matches the GOOGLE_APPLICATION_CREDENTIALS environment variable in your .env file. For example:
      GOOGLE_APPLICATION_CREDENTIALS=src/firebase-admin-cred.json
    • If you choose a different name or path for the credentials file, make sure the GOOGLE_APPLICATION_CREDENTIALS variable reflects this.
  4. Save and verify: Save the .env files once you have updated them with your details. Verify that all necessary variables are correctly set to ensure the application functions as intended.

  5. Important: Do not commit your .env files to version control systems like Git (ensure they are listed in your .gitignore files).

Installing Dependencies and Starting the Application 🛠️

Now that you have set up your environment variables, proceed with the following steps to install dependencies and start the frontend and backend servers:

  1. Frontend:

    • Open a terminal and navigate to the frontend directory: cd frontend
    • Install dependencies: npm install
    • Start the frontend development server: npm run dev
    • Visit http://localhost:5173 in your browser to access the frontend application.
  2. Backend:

    • Open another terminal (or split your terminal window if supported) and navigate to the backend directory: cd ../backend
    • Install dependencies: npm install
    • Start the backend server: npm run dev
    • Ensure the backend server is running correctly to support the frontend functionalities.

Tip: Using Split Terminals

To manage frontend and backend servers simultaneously:

Running the Application with Docker 🐳

You can also use Docker to containerize and run Baatchit. Follow these steps to set up and run the application using Docker:

  1. Build and Start Containers:

    • Ensure you have Docker and Docker Compose installed on your machine.
    • Open a terminal and navigate to the project directory: cd Baatchit
    • Build and start the containers: docker-compose up --build
  2. Access the Application:

    • The frontend will be available at http://localhost:5173
    • The backend will be available at http://localhost:8000
    • MongoDB will be available at mongodb://localhost:27017
  3. Stopping the Containers:

    • To stop the containers, press Ctrl+C in the terminal where docker-compose is running.
    • Alternatively, you can run: docker-compose down to stop and remove the containers.

Contributing 🤝

Contributions are welcome! If you'd like to contribute to Baatchit, please follow these steps:

  1. Fork the repository.
  2. Create a new branch: git checkout -b feature-name
  3. Make your changes and commit them: git commit -am 'Add new feature'
  4. Push to the branch: git push origin feature-name
  5. Submit a pull request.

Announcement 🟢

Contact 📧

For any inquiries or feedback, please contact me at rishibakshiofficial@gmail.com.