MCPcopy Create free account
hub / github.com/Timonwa/react-chat

github.com/Timonwa/react-chat @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
16 symbols 54 edges 23 files ⚖ MIT 0 documented · 0% updated 38d ago★ 139

Browse by type

Functions 16 Types & classes 0
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Create a Multi-Room Chat App Using React and Firebase

A real-time chat app built with React and Firebase, featuring Google sign-in, public and private rooms with shareable join codes, and a room-based Firestore data model. This is the companion code for the tutorial — follow along to learn Firebase Authentication, Firestore real-time messaging, and how to structure chat data around rooms.

The finished React Chat app: a Rooms panel with public/private tabs on the left, the General room with live messages and avatars in the middle, and a Create & Join panel on the right

✅ This is the completed app

This branch holds the finished code, with Firebase Authentication, Firestore, and real-time messaging fully wired up. To build it yourself from scratch, start on the setup branch and follow the step-by-step tutorial:

👉 Create a Multi-Room Chat App Using React and Firebase

🔗 Live demo: react-chat-timonwa.vercel.app

⭐ If this helped, please star the repo — it helps others find it.

Prefer the original 2023 version? Read the republished tutorial on my blog — originally published on freeCodeCamp — and check out the freecodecamp-original branch for its code.

Table of Contents

Features

  • Google authentication with Firebase Auth
  • Public and private rooms with shareable join codes
  • Room search and tabs for filtering public vs private rooms
  • Real-time messaging with message timestamps and avatars (with fallbacks)
  • Responsive layout — side panels collapse into drawers on small screens
  • Room-based Firestore schema for cleaner, scalable data access
  • Monthly cleanup automation to keep demo data fresh

Tech Stack

Prerequisites

  • Node.js 18+ (or newer)
  • A Firebase project with Authentication (Google provider) and Cloud Firestore enabled

Getting Started

  1. Clone the repository:

bash git clone https://github.com/Timonwa/react-chat.git cd react-chat

  1. Install dependencies:

bash npm install

  1. Create your environment file:

bash cp .env.example .env

Fill in your Firebase web app config. You'll find these values in the Firebase console under Project settings → General → Your apps.

Variable Required Description
REACT_APP_API_KEY Yes Firebase web API key
REACT_APP_AUTH_DOMAIN Yes Firebase auth domain (your_project_id.firebaseapp.com)
REACT_APP_PROJECT_ID Yes Firebase project ID
REACT_APP_STORAGE_BUCKET Yes Firebase storage bucket
REACT_APP_MESSAGING_SENDER_ID Yes Firebase Cloud Messaging sender ID
REACT_APP_APP_ID Yes Firebase app ID
REACT_APP_MEASUREMENT_ID No Google Analytics measurement ID (optional)
  1. Start the development server:

bash npm start

The app runs at http://localhost:3000. Or try the live demo.

Scripts & Data Cleanup

The scripts/ folder holds an optional maintenance script that runs on a schedule to keep the hosted demo tidy. It isn't part of the tutorial and isn't needed to run the app — nothing in the app itself deletes data.

If you host your own copy and want the same auto-tidying (or you're just curious why demo rooms and old messages disappear over time), see scripts/README.md for what it does and how to run it.

Branch Guide

Branch What it's for
main The completed app — the finished code for the current tutorial.
setup Starter code to follow along with; the UI is built but Firebase isn't wired up yet.
freecodecamp-original The original 2023 freeCodeCamp version of the project.

Author

Built by Timonwa Akintokun.

License

This project is licensed under the MIT License – see the LICENSE file for details.

Additional Resources

Core symbols most depended-on inside this repo

browse all functions →

Shape

Function 16

Languages

TypeScript100%

Modules by API surface

src/components/SendMessage.js2 symbols
src/components/NavBar.js2 symbols
setup/src/components/NavBar.js2 symbols
final/src/components/SendMessage.js2 symbols
final/src/components/NavBar.js2 symbols
src/components/Welcome.js1 symbols
setup/src/components/Welcome.js1 symbols
setup/src/components/SendMessage.js1 symbols
setup/src/components/Message.js1 symbols
setup/src/components/ChatBox.js1 symbols
final/src/components/Welcome.js1 symbols

For agents

$ claude mcp add react-chat \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page