Skip to content

A simple web enabled chat app for exploring WebSockets

Notifications You must be signed in to change notification settings

walkingalchemy/Janx-Backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Janx

A simple web enabled chat app

Janx is a demo using WebSockets to allow real time simultaneous messaging between users. This is the repository for the Ruby on Rails backend that serves the HTTP and WS APIs. The frontend client repository resides at: Janx-Frontend

Demo

Janx Thumbnail

Installing / Getting started

This project uses Rails 5.1.4 and its WebSockets library ActionCable. It also uses the Postgres database. Go check them out if you don't have them locally installed.

Fork and/or clone the repository down then from within the top level directory run:

rails db:create
rails db:migrate

to get the server database spun up locally. Then

rails s

to get it serving to your local host.

The frontend client is set by default to point to a backend running on localhost:3000 which is the Rails server default if nothing else is running.

If you need to run the Rails server on another port you can instead use

  rails s -p <your port>

and then change the API_ROOT and API_WS_ROOT to reflect that in /src/constants of the frontend client.

You can also optionally use ngrok to create a URL to your local host and allow multiple clients to test functionality. Follow the simple ngrok setup to configure Unfortunately ngrok does not support WebSockets fully so each computer accessing the URL will have to have the frontend client installed locally.

In either case, from there you should install the Janx-Frontend repository to see the full application from your browser.

Api V1 Reference

api_v1_chat_sessions GET    /api/v1/chat_sessions(.:format)     api/v1/chat_sessions#index
                     POST   /api/v1/chat_sessions(.:format)     api/v1/chat_sessions#create
 api_v1_chat_session GET    /api/v1/chat_sessions/:id(.:format) api/v1/chat_sessions#show
                     DELETE /api/v1/chat_sessions/:id(.:format) api/v1/chat_sessions#destroy
        api_v1_users GET    /api/v1/users(.:format)             api/v1/users#index
                     POST   /api/v1/users(.:format)             api/v1/users#create
  api_v1_transcripts POST   /api/v1/transcripts(.:format)       api/v1/transcripts#create

Licensing

MIT Copyright 2018 Sebastian Royer and Kelly Sample

Thanks to:

Icon pack by Icons8

About

A simple web enabled chat app for exploring WebSockets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.2%
  • HTML 0.8%