-
Notifications
You must be signed in to change notification settings - Fork 1
1. Welcome
In this project we have implemented apis to manage authentication and live chatting module using Action cable. Below are the APIs list (Module-wise)
- User Registration
- User Login
- Manage Access Token via Refresh Token
- Logout
- Conversations list
- Remove Conversations (Single and bulk)
- Send message (To specific conversation)
- Remove messages in bulk (From loggedin user's list only, receipients will see the messages)
- Delete Messages (From me ony and from all receipients as well)
- Messages List (From a specific Conversation)
- Mark Messages as seen/unseen (Bulk and single)
- Message delivery/seen/unseen tracking (Bulk and single)
We are managing Action Cable notifications by their codes. Here are the codes to handle the received notifications on client applications.
- 10: New Message
- 11: Remove Message
- 12: Seen Message
- 14: Delivered Message
When any activity happen with respect to a message or a new message over the server, client will be notify by these code in Action Cable broadcast on their subscribed channel.
We have documented all of these APIs using postman collections with their responses as well. Please download and import this in your postman to get direct endpoints access to the APIs with required body, headers etc.
Here is the postman collection link https://github.com/TecOrb-Developers/rails-chat-action-cable/blob/main/documentation/Chat-Module.postman_collection.json
Doorkeeper JWT adds JWT token support to the Doorkeeper OAuth library. Complete document for integration is here https://github.com/TecOrb-Developers/rails-doorkeeper-auth
- Node (v 16)
- Yarn (v 1.22.19)
- Ruby (v 3.0.1)
- Rails (v 6.1.4)
- MySQL (v 8.0.29)
- Git (v 2.32.1)
- Redis (v >= 4.2.0)
- Sidekiq (v 6.4.2)
- Action cable (v 6.1.4.1)
- Docker (Optional in case running without containers)
- Prepared with above dependencies
- Created a new Rails app
- Database configuration setup (using MySQL)
- Initialize a local repository using git
- .gitignore file created to add configuration.yml
- configuration.yml file created to initialize environment variables
- Create a new remote repository using GitHub
- Change README.md and documentation added
- Code Commited and Pushed to GitHub repository
User need to subscribe a chat channel to get notify through action cable. Action Cable url will be send by server where the application is hosted followed by the /cable path. Channel name is initiated by a prefix 'notify_' and user's id.
To subscribe a channel user need to send their access token in 'session_token' key at the time of subscription request. Once user will be authenticated successfully, server will allow to subscribe the requested channel for the client.