Build Ruby on Rails P2P WebRTC Zoom Clone Video Chat in Browser Using HTML5 & Javascript Full Project For Beginners

 

 

Rails Video Chat App

WebRTC on Rails

https://webrtc-on-rails.herokuapp.com

TODO

  •  WebRTC Support across different browsers
  •  Test coverage for WebRTC JS stuff
  •  Front End UI
  •  React on Rails is integrated – need to make UI components for some items. maybe some of the forms?
  •  Figure Out TurboLinks stuff
  •  Create system tests
  •  Create API + API tests
  •  Error handling for non-existent pages (web + api level)
  •  Handle web rtc connection when one peer closes browser
  •  Warn users on iOS mobile devices that this app won’t work. React-native app coming soon (also, app doesn’t work the greatest in firefox. oof)

As a user, I can…

  •  create a room on the fly
  •  Enter into an existing room
  •  Mute my microphone
  •  Turn my video off

As a guest, I can…

  •  Create temporary rooms that expire in 24 hours (rake task)
  •  “register now to claim this room”

As a member, I can…

  •  Claim a room name
  •  Password protect my room – some kind of authorization
  •  Choose a brand color for room

API

Authentication Using Devise Token Auth

Users

Registration

POST Endpoint:

https://webrtc-on-rails.herokuapp.com/api/v1/auth

Request Body:

{
  "email": "kramer@rails.com",
  "password": "foobar",
  "password_confirmation": "foobar"
}

200 – Response Body:

{
    "status": "success",
    "data": {
        "id": 1,
        "email": "kramer@rails.com",
        "provider": "email",
        "uid": "kramer@rails.com",
        "created_at": "2017-10-06T05:22:49.774Z",
        "updated_at": "2017-10-06T05:22:49.998Z"
    }
}

200 – Response Headers: (these must be passed along every authenticated request)

access-token → fdBnuoN8VtlOLLW-cKB58Q
token-type   → Bearer
client       → ucLUd-EIkM-ETYLWFSIL4w
expiry       → 1508475926
uid          → kramer@rails.com

422 – Response Body:

{
    "status": "error",
    "data": {
        "id": null,
        "email": "kramer@rails.com",
        "created_at": null,
        "updated_at": null,
        "provider": "email",
        "uid": "kramer@rails.com"
    },
    "errors": {
        "email": [
            "has already been taken"
        ],
        "full_messages": [
            "Email has already been taken"
        ]
    }
}

Signing In

POST Endpoint:

https://webrtc-on-rails.herokuapp.com/api/v1/auth/sign_in

Request Body:

{
  "email": "kramer@rails.com",
  "password": "foobar"
}

200 – Response Body:

{
    "data": {
        "id": 1,
        "email": "kramer@rails.com",
        "provider": "email",
        "uid": "kramer@rails.com"
    }
}

200 – Response Headers: (these must be passed along every authenticated request)

access-token → fdBnuoN8VtlOLLW-cKB58Q
token-type   → Bearer
client       → ucLUd-EIkM-ETYLWFSIL4w
expiry       → 1508475926
uid          → kramer@rails.com

401 – Response Body:

{
    "errors": [
        "Invalid login credentials. Please try again."
    ]
}

Leave a Reply