Git Product home page Git Product logo

roc-ios's Introduction

RChat - A Realm Platform Demo

Authors: Max Alexander, [email protected] & David Spector, [email protected]

Overview

RChat is a general purpose chat client that can be used either as a stand-alone chat system (i.e., an app unto itself) or as an embedded chat view that can be quickly and easily added to any exiting application to provide an off-line first chat capability.

Data Model

RChat Data Model

Prerequisites

  • Xcode 8.33 or higher
  • Realm Object Server 2.0.11 or higher
  • Cocoapods
  • Nodejs v8.6 or higher
  • Node Package Manager (npm)

The RChat iOS app uses Cocoapods to set up the project's 3rd party dependencies. Installation can be directly (from instructions at the Cocapods site) or alternatively through a package management system like Homebrew.

Realm Platform

This application demonstrates features of the Realm Platform and needs to have a working instance of the Realm Object Server version 2.x to make data available between instances of the RChat app. The Realm Object Server can be installed via npm as a node application for macOS or Linux. Please see the installation instructions.

This repo also has a minimal server suitable for testing whose only requirement for pre-existing software is nodejs and npm. Installation/setup/operation of this server is convered in the installation section below.

Realm Studio

Another useful tool is Realm Studio which is available for macOS, Linux and Windows and allows developers to inspect and manage Realms and the Realm Object Server. Realm Studio is recommended for all developers and can be downloaded from the Realm web site.

3rd Party Modules

The RChat iOS app makes use of a number of 3rd party modules:

Chatto and ChattoAdditions

RealmSwift

SideMenu

SDWebImage

Eureka

Cartography

TURecipientBar

NVActivityIndicatorView

BRYXBanner

RealmLoginKit

Installation

Clone this repository git clone https://github.com/realm/roc-ios to a convenient location your machine.

Preparing the ROS Server

This application comes with a demo server against which you can run the RChat client. The ROS platform requires NodeJS version 8.5 or higher and the npm node package manager installed in order to be able to run. If these are already installed, continue with the instructions below, if you need further info on nodejs or NPM installaton, please see their repsective web sites for installation instructions.

  1. Open a new terminal window
  2. Change directory to the download location where you downloaded the RChat repository
  3. Change directory to the RChatMinimalServer directory
  4. Install the required node server modules by running npm install
  5. Run the node server with the command node . in the same same director

Initial User Setup

Since this is client focued demo, there is not a back-end server that sets up the RChat Realm or its permissions. In order to ensure the Realm permissions are correctly set the first user that logs in using the RChat service needs to be a Realm Server Administrator user.

To accomplish this, launch Realm Studio and create one user that will be "user #1" for RChat and grant that user Server Administrator permission. This is done by creating a new user or editing an existing user and then setting the administrator permission in the User Panel as shown here:

Preparing the iOS Client

  1. Change directory to the RChart-iOS directory
  2. Run pod update
  3. Open the workspace open RChat.xcworkspace with Xcode

Setting the Server Address

By default the iOS client points to the local machine as its ROS server. if you have set up a ROS server on a different machine, you will need to edit the server IP address in the file RChatConstants.swift (which is in the RChat/Data directory) and replace the IP address for the Realm Server address with you server IP.

  1. Run the app by selecting a simulator from Xcode's menu, and the press Build & Run; the simulator will start and you can log in to the chat server using the username and password you created above using Realm Studio.

Running RChat


RChat Data Model - Realm Studio View


RChat Screen Shot

Contributing

See CONTRIBUTING.md for more details!

This project adheres to the Contributor Covenant Code of Conduct. By participating, you are expected to uphold this code. Please report unacceptable behavior to [email protected].

License

Distributed under the Apache 2.0 license. See LICENSE for more information.

analytics

roc-ios's People

Contributors

mbalex99 avatar dhmspector avatar astigsen avatar timoliver 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.