24/01/2019, 15:23

Integrating Slack with Rails 5 [Module 1- Intro]

Intro We all know what is Slack, so any introduction is redundant. This will be a series of step by step guides to integrate Slack with a RoR app from very start of rails new to releasing it on Slack Store. Because it'll be a long series, I'm targetting this post to just be an intro to give a ...

Intro

We all know what is Slack, so any introduction is redundant. This will be a series of step by step guides to integrate Slack with a RoR app from very start of rails new to releasing it on Slack Store. Because it'll be a long series, I'm targetting this post to just be an intro to give a basic idea about what we're going to implement.

  • Module#1 Introduction
  • Module#2 Slack Web Hooks (sending data from your project to Slack)
  • Module#3 API creation, Slash commands (sending data from Slack to your project)
  • Module#4 Slack custom forms (sending data from Slack to your project interactive way)
  • Module#5 Creating Slack Bot (posting message to Slack as a bot user)
  • Module#6 Handling installation of your custom app to user's Slack Channel
  • Module#7 Releasing yout app in Slack Store

The project blueprint

We will create a very basic ToDo using rails 5 for the backend demonstration. The barebone app will just contain two models, User and Task. A user will have many tasks, and a task will have many users.

This is the ERD, and that's all. We will handle the Sign In feature using Slack Ruby Client gem.

So, here are the commands used to create the project skeleton

rails new ToDoSlack
cd ToDoSlack

rails g model Task title 
rails g model User name slack_name

Now, after the models are created, please add the Slack Ruby Client gem to the Gemfile, and run bundle. That's it for today. We are all setup for beginning our step by step journey

Module#2 Slack Web Hooks

On this module we will be implementing the sign_in with Slack feature. Also, we will be sending messages from our app to Slack, for example `Sending message to slack when a new task is created / updated / deleted. For this, we will be using the Slack Incoming Web Hooks function. Sending data from our project to Slack

Module#3 API creation, Slash commands

Here we will create a simple API for Slack to send data to our App. We will implement the infamous Slash Command feature.

Module#4 Slack custom dialogs

We will create a Custom designed Slack app which is fully interactive with the (Slack Custom Dialog UI)[https://api.slack.com/dialogs]. We will need some extra API endpoints from Module#3. DialogSending data from Slack to our ProjectCustom UI

Module#5 Bots rule the world

This module will be focused on creation of a SlackBot, which will talk to our project and the users in the channel. It will be added extra scopes than the Slash command and Slack custom form. The bot will be fully interactive and take necessarry decision upon user's response More bots example here

Module#6 Handling installation of your custom app to user's Slack Channel

For your custom project to be installed in Slack, we have to make the app installable. For that we will have two different options,

  1. Create a landing page and make app install for there,
  2. Make the app installable directly from the Slack Store.

Steps are discussed broadly here.

Module#7 Releasing yout app in Slack Store

To release our app to the Slack App marketplace, we have to meet a bunch of criteria to slacks requirement. We will be using NGROK to make our local server be HTTPS and many other things. Here is the Slack App Store.

Conclution

This was a very short introduction to what we will be implementing in our next steps. Through this series we will be learning all the necessarry elements for making a fully interactive Slack app to get/send message from/to our project, Create an installer and finally release our app in store. So, See you next time.

Bài liên quan

Integrating Slack with Rails 5 [Module 1- Intro]

Intro We all know what is Slack, so any introduction is redundant. This will be a series of step by step guides to integrate Slack with a RoR app from very start of rails new to releasing it on Slack Store. Because it'll be a long series, I'm targetting this post to just be an intro to give a ...

Hoàng Hải Đăng viết 4 tuần trước

Action Cable with Rails 5.1 (P1)

Hầu hết mọi người đều nghe nói đến Action Cable trên rails, bài viết này mình xin giới thiệu ngắn gọn về ví dụ Action Cable từ console đến webpage mà không cần load lại trang. Cùng bắt đầu nào. rails new action-cable [...] cd action-cable rails generate controller page index [...] Config ...

Trần Trung Dũng viết 00:11 ngày 13/01/2019

Integrating Google Calendar Api with Rails 5

This tutorial will be for connecting rails applications with google calendar api. First we will need to setup a project to be able for google signup/signin. Lets create a demo application rails new task_scheduler -d=mysql We will be using the devise and omniauth-google-oauth2 gems for this ...

Vũ Văn Thanh viết 09:30 ngày 07/09/2018

Build a RESTful JSON API with Rails 5

Rails được biết đến bởi khả năng xây dựng Web app, sẽ là lợi thế nếu bạn đã từng xây dựng Web app truyền thống bởi Rails trước đó. Nếu không thì tôi khuyên bạn nên vào link này để cho quen với framework Rails trước khi xem bài này: http://guides.rubyonrails.org/getting_started.html Ở phiên bản ...

Hoàng Hải Đăng viết 16:15 ngày 12/08/2018

Action Cable ‘Hello World’ with Rails 5.1

Hầu hết mọi người đều đã thấy ví dụ về ứng dụng chat sử dụng Action Cable. Tôi nhận ra rằng nó quá lớn để giới thiệu Action Cable một cách nhanh chóng. Tôi đã tạo ra một ví dụ ngắn gọn, dễ hiểu khi chúng ta gửi đoạn HTML "Hello World" từ console đến webpage mà không cần load lại. Truyền một đoạn ...

Tạ Quốc Bảo viết 16:10 ngày 12/08/2018
0