├── .expo-shared └── assets.json ├── .gitattributes ├── .gitignore ├── App.js ├── Components ├── CustomListItem.jsx └── HomePage.jsx ├── README.md ├── app.json ├── assets ├── adaptive-icon.png ├── favicon.png ├── icon.png └── splash.png ├── babel.config.js ├── firebase.js ├── package-lock.json ├── package.json └── screens ├── AddChatScreen.js ├── ChatScreen.js ├── LoginScreen.js └── RegisterScreen.js /.expo-shared/assets.json: -------------------------------------------------------------------------------- 1 | { 2 | "12bb71342c6255bbf50437ec8f4441c083f47cdb74bd89160c15e4f43e52a1cb": true, 3 | "40b842e832070c58deac6aa9e08fa459302ee3f9da492c7e77d93d2fbf4a56fd": true 4 | } 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .expo/ 3 | npm-debug.* 4 | *.jks 5 | *.p8 6 | *.p12 7 | *.key 8 | *.mobileprovision 9 | *.orig.* 10 | web-build/ 11 | 12 | # macOS 13 | .DS_Store 14 | -------------------------------------------------------------------------------- /App.js: -------------------------------------------------------------------------------- 1 | import "react-native-gesture-handler"; 2 | import React from "react"; 3 | import { NavigationContainer } from "@react-navigation/native"; 4 | import { createStackNavigator } from "@react-navigation/stack"; 5 | import LoginScreen from "./screens/LoginScreen"; 6 | import RegisterScreen from "./screens/RegisterScreen"; 7 | import HomePage from "./Components/HomePage"; 8 | import AddChatScreen from "./screens/AddChatScreen"; 9 | import ChatScreen from "./screens/ChatScreen"; 10 | 11 | const Stack = createStackNavigator(); 12 | const globalScreenOptions = { 13 | headerStyle: { backgroundColor: "#2C6BED" }, 14 | headerTitleStyle: { color: "white" }, 15 | headerTintColor: "white", 16 | }; 17 | 18 | export default function App() { 19 | return ( 20 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ); 33 | } 34 | -------------------------------------------------------------------------------- /Components/CustomListItem.jsx: -------------------------------------------------------------------------------- 1 | import React, { useState, useEffect } from "react"; 2 | import { StyleSheet, View, TouchableOpacity } from "react-native"; 3 | import { ListItem, Avatar } from "react-native-elements"; 4 | import { db, auth } from "../firebase"; 5 | 6 | const CustomListItem = ({ id, chatName, enterChat }) => { 7 | const [chatMessages, setChatMessages] = useState([]); 8 | useEffect(() => { 9 | const unsubscribe = db 10 | .collection("chats") 11 | .doc(id) 12 | .collection("messages") 13 | .orderBy("timestamp", "desc") 14 | .onSnapshot((snapshot) => 15 | setChatMessages(snapshot.docs.map((doc) => doc.data())) 16 | ); 17 | 18 | return unsubscribe; 19 | }, []); 20 | 21 | return ( 22 | 23 | enterChat(id, chatName)}> 24 | 32 | 33 | 34 | 35 | {chatName} 36 | 37 | 38 | {chatMessages[0]?.displayName}: {chatMessages[0]?.message} 39 | 40 | 41 | 42 | 43 | ); 44 | }; 45 | 46 | export default CustomListItem; 47 | 48 | const styles = StyleSheet.create({}); 49 | -------------------------------------------------------------------------------- /Components/HomePage.jsx: -------------------------------------------------------------------------------- 1 | import React, { useLayoutEffect, useState, useEffect } from "react"; 2 | import { 3 | StyleSheet, 4 | View, 5 | SafeAreaView, 6 | ScrollView, 7 | TouchableOpacity, 8 | } from "react-native"; 9 | import { Avatar, Tooltip, Text } from "react-native-elements"; 10 | import { auth, db } from "../firebase"; 11 | import { AntDesign, SimpleLineIcons, Feather } from "@expo/vector-icons"; 12 | import CustomListItem from "./CustomListItem"; 13 | 14 | const HomePage = ({ navigation }) => { 15 | const [chats, setChats] = useState([]); 16 | 17 | useEffect(() => { 18 | const unsubscribe = db.collection("chats").onSnapshot((snapshot) => 19 | setChats( 20 | snapshot.docs.map((doc) => ({ 21 | id: doc.id, 22 | chat: doc.data(), 23 | })) 24 | ) 25 | ); 26 | return unsubscribe; 27 | }, []); 28 | 29 | const singOutUser = () => { 30 | auth 31 | .signOut() 32 | .then(() => { 33 | navigation.replace("Login"); 34 | }) 35 | .catch((error) => alert(error)); 36 | }; 37 | 38 | useLayoutEffect(() => { 39 | navigation.setOptions({ 40 | title: "Chats", 41 | headerStyle: { backgroundColor: "#2C6BED" }, 42 | headerTitleStyle: { color: "white" }, 43 | 44 | headerLeft: () => ( 45 | 46 | 47 | 48 | 49 | 50 | ), 51 | headerRight: () => ( 52 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | navigation.navigate("AddChat")} 71 | > 72 | {/* Creat Your Own ChatRoom}> */} 73 | 74 | {/* */} 75 | 76 | 77 | ), 78 | }); 79 | }, []); 80 | const enterChat = (id, chatName) => { 81 | navigation.navigate("Chat", { 82 | id, 83 | chatName, 84 | }); 85 | }; 86 | 87 | return ( 88 | 89 | 90 | {chats.map(({ chat: { chatName }, id }) => ( 91 | 97 | ))} 98 | 99 | 100 | ); 101 | }; 102 | 103 | export default HomePage; 104 | 105 | const styles = StyleSheet.create({}); 106 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SIGNAL-Clone-with-React_Native 2 | Realtime Android and IOS and also Web chat application with firebase authentication 3 | 4 | Technology thats are used For This clone-->💯💯 5 | 6 | 0. Expo 7 | 1. React Native 8 | 2. Google Firebase Authontication 9 | 3. Material icons 10 | 4. React Hooks 11 | 5. Redux 12 | or React Context Api 13 | 6. Firebase Database 14 | 7. Firebase Hoasting 15 | 8. Node js 16 | 17 | In this clone, you have to first login or create an account with your email id and, Then you can also make your own group and also can share the link or the website link with your friend to start a conversation by sending message... 18 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "expo": { 3 | "name": "signal-clone-original", 4 | "slug": "signal-clone-original", 5 | "version": "1.0.0", 6 | "orientation": "portrait", 7 | "icon": "./assets/icon.png", 8 | "splash": { 9 | "image": "./assets/splash.png", 10 | "resizeMode": "contain", 11 | "backgroundColor": "#ffffff" 12 | }, 13 | "updates": { 14 | "fallbackToCacheTimeout": 0 15 | }, 16 | "assetBundlePatterns": [ 17 | "**/*" 18 | ], 19 | "ios": { 20 | "supportsTablet": true 21 | }, 22 | "android": { 23 | "adaptiveIcon": { 24 | "foregroundImage": "./assets/adaptive-icon.png", 25 | "backgroundColor": "#FFFFFF" 26 | } 27 | }, 28 | "web": { 29 | "favicon": "./assets/favicon.png" 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /assets/adaptive-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniwaydev/ChatApp-with-React_Native/3793b142c7a5bdfe41ab17d49c04df3ab6fbb182/assets/adaptive-icon.png -------------------------------------------------------------------------------- /assets/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniwaydev/ChatApp-with-React_Native/3793b142c7a5bdfe41ab17d49c04df3ab6fbb182/assets/favicon.png -------------------------------------------------------------------------------- /assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniwaydev/ChatApp-with-React_Native/3793b142c7a5bdfe41ab17d49c04df3ab6fbb182/assets/icon.png -------------------------------------------------------------------------------- /assets/splash.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uniwaydev/ChatApp-with-React_Native/3793b142c7a5bdfe41ab17d49c04df3ab6fbb182/assets/splash.png -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = function(api) { 2 | api.cache(true); 3 | return { 4 | presets: ['babel-preset-expo'], 5 | }; 6 | }; 7 | -------------------------------------------------------------------------------- /firebase.js: -------------------------------------------------------------------------------- 1 | import firebase from "firebase"; 2 | 3 | const firebaseConfig = { 4 | apiKey: "AIzaSyA_VYvGTjbUQvgNtG-BzWnEqGxz0OLUT1Y", 5 | authDomain: "signal-clone-b0181.firebaseapp.com", 6 | projectId: "signal-clone-b0181", 7 | storageBucket: "signal-clone-b0181.appspot.com", 8 | messagingSenderId: "771530258", 9 | appId: "1:771530258:web:8c16ac236aab5a375dc2cb", 10 | measurementId: "G-YMDSNGT3ZT", 11 | }; 12 | 13 | const firebaseApp = firebase.initializeApp(firebaseConfig); 14 | const db = firebaseApp.firestore(); 15 | const auth = firebase.auth(); 16 | export { db, auth }; 17 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "node_modules/expo/AppEntry.js", 3 | "scripts": { 4 | "start": "expo start", 5 | "android": "expo start --android", 6 | "ios": "expo start --ios", 7 | "web": "expo start --web", 8 | "eject": "expo eject" 9 | }, 10 | "dependencies": { 11 | "@react-native-community/masked-view": "0.1.10", 12 | "@react-native-firebase/app": "^12.1.0", 13 | "@react-navigation/native": "^5.9.4", 14 | "@react-navigation/stack": "^5.14.5", 15 | "expo": "~41.0.1", 16 | "expo-status-bar": "~1.0.4", 17 | "firebase": "8.2.3", 18 | "react": "16.13.1", 19 | "react-dom": "16.13.1", 20 | "react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz", 21 | "react-native-elements": "^3.4.2", 22 | "react-native-gesture-handler": "~1.10.2", 23 | "react-native-reanimated": "~2.1.0", 24 | "react-native-safe-area-context": "3.2.0", 25 | "react-native-screens": "~3.0.0", 26 | "react-native-vector-icons": "^8.1.0", 27 | "react-native-web": "^0.17.1" 28 | }, 29 | "devDependencies": { 30 | "@babel/core": "^7.9.0" 31 | }, 32 | "private": true 33 | } 34 | -------------------------------------------------------------------------------- /screens/AddChatScreen.js: -------------------------------------------------------------------------------- 1 | import React, { useLayoutEffect, useState } from "react"; 2 | import { StyleSheet, Text, View } from "react-native"; 3 | import { Button, Input } from "react-native-elements"; 4 | import Icon from "react-native-vector-icons/FontAwesome"; 5 | import { db } from "../firebase"; 6 | 7 | const AddChatScreen = ({ navigation }) => { 8 | const [input, setInput] = useState(""); 9 | 10 | const createChat = async () => { 11 | db.collection("chats") 12 | .add({ 13 | chatName: input, 14 | }) 15 | .then(() => { 16 | navigation.goBack(); 17 | }) 18 | .catch((error) => alert(error)); 19 | }; 20 | 21 | useLayoutEffect(() => { 22 | navigation.setOptions({ 23 | title: "Add a New Chat", 24 | headerBackTitle: "Chats", // just appied for an ios device 25 | }); 26 | }, [navigation]); 27 | 28 | return ( 29 | 30 | setInput(text)} 35 | leftIcon={ 36 | 37 | } 38 | /> 39 |