This is a simple chat app built with React and Firebase. It uses Firebase's Firestore database to store messages and users. It also uses Firebase's authentication to allow users to sign in with their Google accounts and anonymously.
- Sign in with Google
- Sign in anonymously
- Send messages
- See who is online
- Send a emoji
- Send a location
- Clone the repository
git clone
- Install dependencies
yarn install
- Create a Firebase project
- Go to Firebase and create a new project
- Go to the project settings and copy the config object
- Copy credentials from the Firebase SDK snippet into .env file and look at file vite-env.d.ts for more information
- Go to the Authentication section and enable Google sign-in method and Anonymous sign-in method
- Go to the Firestore section and create a new database
- Go to the Rules tab and change the rules to the following:
rules_version = '2';
service cloud.firestore {
match /databases/{database}/documents {
match /{document=**} {
allow read: if true;
allow read, write, update, delete: if request.auth.uid != null;
}
}
}
- Run the app
yarn dev
- Install firebase-tools
npm install -g firebase-tools
- Login to Firebase
firebase login
- Initialize Firebase
firebase init
-
Select Hosting and use the default options
-
Build the app
yarn build
- Deploy the app
firebase deploy
GNU General Public License v3.0
Image by katemangostar on Freepik
Image by Freepik