Code Monkey home page Code Monkey logo

ffs_api's Introduction

FFS API

FFSを活用する便利な機能のAPI提供ツール 主に、以下2つの機能があります。

  • Slackのスラッシュコマンド機能
  • Web機能

環境構築

Rails

セットアップ

$ git clone [email protected]:autumnlike/ffs_api.git
$ bundle install --path=/PATH/TO

DB

$ ./bin/rails db:create
$ ./bin/rails db:migrate
$ ./bin/rails db:seed

dotenv

$ cp dotenv.sample .env
$ vi .env # 適切な値に
# Service Domain
DOMAIN='https://yourdomain.com/'

# SLACK API TOKEN
SLACK_TOKEN='Slack > Install App > OAuth Access Token'

# Api Token
API_TOKEN='App Credentials > Verification Token'

# Google
GOOGLE_CLIENT_ID=''
GOOGLE_CLIENT_SECRET=''
GOOGLE_CLIENT_DOMAIN='Googleログイン制限するドメイン 例: @lancers.co.jp'

# Google Analytics
GA_TRACKER='Google Analytics Tracker'

Slack環境

Slack App に登録

Slack App にてアプリを追加してください。

Slack -> このアプリへの認証APIトークンを取得

App Credentials > Verification Token の値を .envAPI_TOKEN に設定

Slash Command の登録

Features > Slash Commands にて、コマンドを追加する

command Short Description Request URL
/ffs FFS説明の取得 https://:your_domain/v1/slack/user
/ffs_mine 自分のFFS結果を見る https://:your_domain/v1/slack/my
/ffs_info FFS 各因子の説明が見れます https://:your_domain/v1/slack/ffs
/ffs_type BE/CD 等 91type にマッチするひとを探す https://:your_domain/v1/slack/user_type
/ffs_same 自分と同じ個性の人一覧を見る https://:your_domain/v1/slack/same_user

※ コマンド名や説明は自由に設定可能です。

Ethosからのデータインポート

  1. 個人管理 > 検索・編集 > ユーザー全件を表示
  2. 「検索結果CSVダウンロード」 > UTF-8

でダウンロードできます。

DBにインポート

  1. ダウンロードしたファイルを RAILS_ROOT/tmp 配下に設置
  2. インポートコマンドを実行
$ cd RAILS_ROOT
$ ./bin/rake import_user_ffs:by_ethos

API

APIはすべて apiary にて管理しているので、こちらを参照・更新してください。

ffs_api's People

Contributors

autumnlike avatar

Stargazers

 avatar

Watchers

 avatar  avatar

ffs_api's Issues

二人の名前入れたら、相性を出す。

だいたい悪いので、注意点出すとか。

あとは、メンターを探す機能。
相性をいい人を探す。

BD/D/EB/AB などの特徴ごとの注意点と、補完方法、強みを生かした役割分担などのコンテンツが有ると良さそう。

Slack連携を考える

  • 人の検索
    • /ffs @username その人の個性が出る
      • @username 何故か.が消えてサーバに来るのでその考慮が必要か?
    • /ffs_same で自分と同じ個性の一覧が出る

Herokuへデータのインポート

  • ローカルファイルのDump
local$ mysqldump -u root -h 127.0.0.1 -P 13306 ffs_api_development
  • 設定値を取得
$ heroku config

※ PRODUCTION_DATABASE_URLを確認する
※ フォーマットは、 mysql://<USER名>:<PASSWORD>//<HOST名>/<DATABASE名>?reconnect=true なので、これをもとに接続

  • アクセス確認
$ mysql -u <USER名> -p -h <HOST名(前後をカットする)> <DATABASE名>
  • データインポート
$ mysql -u <USER名> -p -h <HOST名(前後をカットする)> <DATABASE名> < <ファイルパス>

セキュリティを強化する

Webからのアクセスが自由なので、セキュリティ面を考える必要がある。

  • Slackのトークン
  • 各メンバーのFFS結果

ETHOSからデータをインポートする手順

ETHOSからCSVファイルを取得する

  1. 個人管理 > 検索・編集 > ユーザー全件を表示
  2. 「検索結果CSVダウンロード」 > UTF-8

でダウンロードできます。

DBにインポート

  1. ダウンロードしたファイルを RAILS_ROOT/tmp 配下に設置
  2. インポートコマンドを実行
$ cd RAILS_ROOT
$ ./bin/rake import_user_ffs:by_ethos

特定の人だけストレス診断を見れるようにする

概要

ストレス値は全員が見れてしまうと誤解を生むリスクがあるので、
特定の人だけ見れるように設定する。

対応方法

本来は権限テーブルを作って、ユーザー毎に権限を定義できるのが理想だが、
まずは利用状況や権限のパターンがそんなに無いことから、特定のメアドのみ可能とする。

メアドは、DBにリストを作るので、許可メアドリストにある場合だけストレス閲覧可能とする。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.