To get started and run the app, you need to follow these simple steps:
- Fork and then clone this repo on your machine locally.
git clone https://github.com/nandkk05/superchat-web-app
cd superchat-web-app
npm install
for installing all dependencies andcd functions
then again runnpm install
+npm install bad-words --save
npm start
this will serve this chat app on local port 3000
- Go to Firebase and create new project.
- Select "Add Firebase to your web app" option, now copy the config keys and paste your keys.
apiKey: "Axxxxxxxxxxxxxxxxxxx", authDomain: "xxxxxx.firebaseapp.com", databaseURL: "https://xxxxxxxx.firebaseio.com", projectId: "xxxxxxxxx", storageBucket: "xxxxxxx.appspot.com", messagingSenderId: "xxxxxxxxxxx", appId: "1:xxxxxxxxx:web:xxxxxxx"
- Change the project name in .firebaserc file.
- Go to Firebase Console, select your project, choose "Authentication" from left menu, select "SIGN-IN METHOD" and enable "Google Sign in" option.
- Set rules for Cloud Firestore
service cloud.firestore { match /databases/{database}/documents { match /{documents=**} { allow read, write: if true; } match /messages/{docId} { allow read: if request.auth.uid != null; allow create: if canCreateMeassage(); } function canCreateMessage() { let isSignedIn = request.auth.uid != null; let isOwner = request.auth.uid == request.resource.data.uid; let isNotBanned = exists( /databases/$(database)/documents/banned/$(request.auth.uid) ) == false; return isSignedIn && isOwner && isNotBanned; } } }
- You're all set! Build your app
npm run build
and deploy it on firebase usingfirebase deploy
.
- Awesome! Contributions of all kinds are greatly appreciated.
- Feel free to use GitHub issues for questions, bug reports, and feature requests