Coder Social home page Coder Social logo

chat-space's Introduction

README

DB 設計

groups テーブル

Column Type Options
name string null: false

Association

  • has_many :members
  • has_many :users, through: :members
  • has_many :messages

users テーブル

Column Type Options
name string null: false
mail text null: false

Association

  • has_many :members
  • has_many :groups, through: :members
  • has_many :messages

members テーブル

Column Type Options
user_id references foreign_key: true
group_id references foreign_key: true

Association

  • belongs_to :group
  • belongs_to :user

messages テーブル

Column Type Options
message text
image text
user_id references foreign_key: true
group_id references foreign_key: true

Association

  • belongs_to :user
  • belongs_to :group

docker-compose

mkdir docker-data/mysql
でデータベースのディレクトリを作成しておく
docker-compose up
でインスタンスを立ち上げ
docker-compose exec rails bundle exec rake db:setup でデータベースを作成
http://localhost:3001/
でブラウザからアクセスできるようになる

ローカル環境に mysql クライアントがあれば、
mysql -u root -h 127.0.0.1 -P3307 -p
で データベースにアクセスできる

chat-space's People

Contributors

mgmmy avatar dependabot[bot] avatar yasudatoshiyuki avatar

Watchers

James Cloos avatar

Forkers

yasudatoshiyuki

chat-space's Issues

graphqlのインターフェイスがほしい

どれかのデータモデルに対して、graphqlでデータを取得、操作できるようにしたい。
以下、5つのインターフェイスがあると良い。

  1. idによって1レコードを取得できるインターフェイス
  2. 何らかのフィールドに対してレコードを検索し、その結果(複数レコード)を取得できるインターフェイス
  3. idで指定したレコードを更新できるインターフェイス
  4. idで指定したレコードを削除できるインターフェイス
  5. 新規にレコードを作成できるインターフェイス

Rspecの追加

こんなrspecがあるといいんじゃないでしょうか?

  • 未ログインの時
    • 認証画面が表示される
    • Sign inのボタンが表示される
    • Sign inのボタンを押し下げしたとき、アカウント作成画面が表示される
  • アカウント作成画面
    • 名前、メールアドレス、パスワードのフィールドが表示される
    • 名前を入力せずにアカウント作成ボタンを押し下げすると、エラーメッセージが表示される
    • パスワードとパスワード確認フィールドの値が異なった場合、エラーメッセージが表示される
    • 全てのフィールドを入力して送信すると、トップページにリダイレクトされる(ユーザーの名前とアカウント編集画面へのリンクが表示される)
  • 認証画面
    • メールアドレスが空でLog inボタンが押されたとき、
      • ログイン画面が再表示され、エラーメッセージが表示される
    • メールアドレスとパスワードが存在しているユーザーと一致したとき、トップページにリダイレクトされる(ログインしました、と表示される)

よろしくおねがいします。

権限わけがほしい

ユーザーに管理者と通常ユーザの区分をつけてみる
管理者は全てのチャットグループを閲覧できる
通常ユーザーは自分が作ったチャットグループしか閲覧できない
上記仕様をpundit gem
https://github.com/varvet/pundit
を使って実装する

といった内容でどうでしょうか?

通知機能がほしい

グループ内でメッセージが書き込まれたら、グループのメンバーにメールが送信されるようにする

メールはSidekiq

を使って、httpリクエストとは非同期で実行されるようにする

といった内容でどうでしょうか?

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.