Code Monkey home page Code Monkey logo

rails-realtime-chatapp's Introduction

RAILS REALTIME CHATAPP

Introduction

A real-time chatapp **ruby on rails 6** application that streams chatroom messages through action cable. Implements jquery, tailwindcss, webpacker, postgresql database, redis database and heroku.

Checkout live app Live App

Prerequisite

  1. Ruby 2.5.0 and up
  2. Postgresql database for ActiveRecord
  3. Redis server for ActionCable
  4. Node.js 10.0 and up

Getting Started

  • Clone the repo from github

      $ git clone https://github.com/ziraqyoung/rails-realtime-chatapp.git
    
      $ cd rails-realtime-chatapp
    
      $ bundle install
    
      $ yarn install
    
  • Setup database credentials as shown in the ActiveRecord section this next command or create the database manually

      $ rails db:create
    
  • Run the migrations

      $ rails db:migrate
    
  • After setting configurations below

     $ rails server
    
  • Viewing in the browser

     http://localhost:3000
    

Configurations

ActionCable

For development: Set redis url in config/cable.yml. The default redis configuration will work

For production: set environment variable in a .env file or if using heroku get ENV variable for the docs

# config/cable.yml
production:
  adapter: redis
  # url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
  url: <%= ENV["REDISTOGO_URL"] %>
  channel_prefix: rails_chat_tutorial_production

ActiveRecord

Setup for default database credentials (development)

Use environment variables for production

# config/database.yml
default: &default
  adapter: postgresql
  encoding: unicode
  username: YOUR_DATABASE_CONNECTION_USERNAME
  password: YOUR_DATABASE_CONNECTION_PASSWORD
  # For details on connection pooling, see Rails configuration guide
  # https://guides.rubyonrails.org/configuring.html#database-pooling
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

And voila! Checkout my app version Live App

rails-realtime-chatapp's People

Contributors

dependabot[bot] avatar ziraqyoung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rails-realtime-chatapp's Issues

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.