Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ziraqyoung/rails-realtime-chatapp
A real time chat application Ruby on Rails 6 application
https://github.com/ziraqyoung/rails-realtime-chatapp
actioncable heroku postgresql rails6 redis tailwindcss webpacker
Last synced: 1 day ago
JSON representation
A real time chat application Ruby on Rails 6 application
- Host: GitHub
- URL: https://github.com/ziraqyoung/rails-realtime-chatapp
- Owner: ziraqyoung
- Created: 2019-10-18T22:28:46.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-01-19T15:23:20.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T14:15:17.713Z (10 days ago)
- Topics: actioncable, heroku, postgresql, rails6, redis, tailwindcss, webpacker
- Language: Ruby
- Homepage: https://rails-realtime-chatapp.herokuapp.com
- Size: 1.01 MB
- Stars: 13
- Watchers: 0
- Forks: 8
- Open Issues: 32
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://rails-realtime-chatapp.herokuapp.com/)_**
## 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](https://devcenter.heroku.com/articles/config-vars)
```yml
# 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
```yml
# 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](https://rails-realtime-chatapp.herokuapp.com/)_**