Code Monkey home page Code Monkey logo

chat's Introduction

Chat


Mobile Chat App created using React Native.
Provides users with a customizable chat interface and options to share images and location.

Features

  • Sign in with Anonymous Username
  • Send/Receive Messages in Real-Time
  • Select Chat Room Background Color
  • Image and Location Sharing
  • View Cached Chats While Offline

Technologies Used:

  • Developed and tested using Expo
  • Chat interface and functionalities created using React Native Gifted Chat
  • Storage sources: Google Firestore Database (images) and user's device local storage
  • Users authenticated anonymously using Google Firebase authentication
  • Designed according to client specifications

How to Set Up Your Own Chat App--

Setting Up the Development Environment

  1. Ensure you have a suitable version of Node installed.
  • Check Expo's Documentation and run npm --version in your terminal to ensure your version of Node is compatible.
  1. Install Expo on your machine with npm install -g expo-cli
  2. You'll also need a place to run the project. Either download the Expo Go app on your physical device or follow the instructions below on how to Set Up An Emulator.
  3. Sign up for an Expo account here.
  4. Finally, log into Expo on your terminal with expo login. You can check the currently logged in account witih expo whoami.

Setting Up An Emulator

I used Android Studio's Virtual Device emulator. Check out the official documentation for Android Studio.
Here's how I set one up:

  1. Download and install Android Studio.
  2. Select Custom installation type and be sure to Select "Android Virtual Device".
  3. Configure Android Studio from the Welcome Screen by first selecting "More Actions" and "SDK Manager" from the dropdown menu.
  4. Check which Android SDK Platform is installed by default and select the Google Play System Image that corresponds with the platform.
  • Note: If you're using an older machine, like my 2017 Macbook Air, you'll need to select an older version of these items that corresponds with API Level 33 and only encountered minor issues.
  1. Back on the Welcome Screen, select "More Options" again and select "Virtual Device Manager" from the dropdown menu.
  2. Create a Virtual Device and be sure to select one with the Google Play Icon.
  3. Once your virtual device is created, Open Virtual Device Manager again, and click on the Play butto. Your emulator will "Start Up".

Setting Up Storage

If you want your App to save any message data from the chat, you'll need a storage solution. I used Google Firebase, instructions for implementing below.

  1. Head to Google Firebase and click on Get Started. If this is your first time using Google Firebase, complete your registration before moving to Step 2.
  2. Click on 'Add a Project' or 'Create a Project'. Once it loads, click Continue and give your project a name.
  3. From the Build menu on the left hand side of your screen, click on Firestore Database, and then click on Create Database in the main screen.
  4. Create your Database in Production Mode, Select the Multi-region network that's closest to you, and click Next.
  5. Click on the Rules tab and change allow read, write: if false; to allow read, write: if true; and click on the Publish button.
  6. Once you create your Expo project (next section), you'll come back to Firebase to register your app and connect it to your Web App with the Firebase SDK.
    Once you're back to your App in Firebase:
  • Open your Project Settings from the Settings Icon on the top left of your screen and scroll down to Your Apps.
  • You'll want to register your App as a Web App so click on the </> icon.
  • Name your App, then follow the instructions to include your firebaseConfig information in your code file.

Creating an Expo Project

  1. npx create-expo-app your-app-title --template
    If this is your first Expo App, you'll likely receive a few permission prompts, so type y and press Enter as needed.
  2. I used a Blank template and installed necessary dependencies along the way, but feel free to use Navigation (Typescript) instead, if you're using Typescript instead of JS.
  3. Run expo start and navigate to the app you're running it on to be sure it's ready to go.

Dependencies Necessary

In your project directory you'll need to install the following:

  • "expo-image-picker"
  • "expo-location"
  • "expo-media-library"
  • "firebase"
  • "react"
  • "react-native"
  • "react-native-gifted-chat"
  • "react-native-navigation"
  • "react-native-maps"
  • "react-native-screens"
  • "@react-native-async-storage/async-storage"

Here's my Chat App in action

chat's People

Contributors

jaceyh avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.