You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A REST API for a chat application built in Rails & a front end chat client built in React, using real-time chat communications with ActionCable/WebSockets
Features
RESTful JSON API
Front end client built in React
Real Time communications using ActionCable/WebSockets
Getting Started
System dependencies
Ruby ~> 2.3.3
Rails ~> 5.1.4
Redis ~> 3.0
Setup
git clone git@github.com:davidkurutz/flehr.git
cd flehr
bundle install
rake db:migrate
rails s
creates new message from :user_id in :conversation_id
:body
Example Response
POST /api/v1/users/1/conversations/126 {'body': "Whether you like it or not, learn to love it"}
{
"data": {
"id": 135,
"body": "Whether you like it or not, learn to love it",
"conversation_id": 126,
"sender_id": 1,
"created_at": "2017-10-08T19:27:40.604Z",
"updated_at": "2017-10-08T19:27:40.604Z"
}
}
--
Web UI Routes
Verb
Route
Action
GET
/
Loads Chat SPA if logged in, otherwise redirect to /login
GET
/login
login page
POST
/login
if username exists, user is logged in, otherwise, user is created and logged in, session and cookies created. No password required (yet).
GET
/logout
session and cookies are destroyed, redirect to /login
Testing
bundle exec rspec
About
A Chat API and Real Time Chat Client built with Rails & React