Coder Social home page Coder Social logo

kloudysky / strife Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 8.04 MB

Discord Clone - Ruby on Rails, PostgreSQL, React, Redux, Redis, ActionCable

Home Page: https://strifeapp.herokuapp.com/

Ruby 15.99% JavaScript 53.35% CSS 8.07% HTML 1.85% CoffeeScript 0.50% SCSS 20.24%
action-cable rails

strife's Introduction

About Strife

Strife is synonymous with Discord and also a clone of the existing application.

Strife App

Strife is an community driven environment to connect with people or groups via messaging.

Strife Tech Stack

Backend

  • Ruby on Rails
  • PostgreSQL
  • Redis
  • ActionCable

Frontend

  • JavaScript/React + Redux

Key Features

  • CRUD for Servers
  • Add users to servers
  • CRUD for Channels
  • Live messaging within Server Channels
  • Create live DM's and Group DM's

Live chat is the primary feature of Strife and utilizes ActionCable - Integrated WebSockets for Rails [Action Cable](https://www.npmjs.com/package/actioncable).
ChannelChannel
def subscribed
    @channel = Channel.find_by(id: params[:id])
    stream_for @channel
  end
this.CableApp.messages = this.CableApp.cable.subscriptions.create(
      {
        channel: "ChannelChannel",
        id: this.props.channel.id,
      },
      {
        received: (message) => {
          this.getResponseMessage(message);
        },
      }
    );
  }

Action Cable creates a subscription which listens for new messages associated with the appopriate channel.

def create
    @message = Message.new(message_params)
    @channel = Channel.find(message_params['channel_id'])
    if @message.save
      ChannelChannel.broadcast_to(
        @channel,
        { json: @message.to_json(include: :author) },
      )
      render json: @message.to_json(include: :author)
    else
      render json: @message.errors.full_messages, status: 422
    end
  end

When a new message is created it broadcasts the message to the appopriate channel and for users who are subscribed to the channel they will receive the message in real time.

  • Users can create, edit and add members to servers and channels.

strife's People

Stargazers

 avatar

Watchers

 avatar

Forkers

a17levine

strife's Issues

MVP Review- New account creation, login, and guest/demo login

Styling-

  • Placement and size of logout button
  • Faster fade-in for forms
  • Padding in input fields so there is a gap between typed characters and the left edge of the input field
  • Errors should be better formatted. Doesn't have to perfectly match Discord, but should not be bullet points on top of the form

Functionality-

  • Needs demo login
  • Logout button doesn't work
  • Errors should clear when switching between forms

Initial Documentation Review

MVPs-

  • Include expected timeline for each MVP.
  • Production README.md will come towards the end of the project.
  • The term live chat includes text messaging. This will utilize websockets which we haven't taught in this course. Expect this to take a fair amount of time and it should be a separate MVP. It is also the core functionality of your application so you may want to prioritize this relatively early on in your .
  • Voice, video chat, and screen sharing will all be bonus features and should come after direct messaging, which is also a bonus feature.

Schema-

  • Include associations for each table in the bullet points listed beneath each table: has_many, belongs_to, has_many through

Sample State-

  • I recommend to include any modals, drop downs, etc In your ui slice of state. React and redux give us a very easy when of rendering ui components.

Back-End Routes-

  • Everything looks good!

Front-End Routes-

  • We only need a new front-end route when rendering a new webpage. Once we're on the /servers page, each server and channel will be rendered as components on the /servers webpage. We do not need the /servers/:id front-end route or anything more complex than that.

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.