Skip to content

Raigyo/react-hooks-twitch-clone

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Twitch clone using functionnal programming and hooks

January 2021

🔨 Clone of Twitch (some functionnalities) using React ant Twitch API. It uses functionnal programming including React/React Router Dom hooks. From udemy 'Cloner Twitch avec React'.

See demo on Heroku.

react-twitch-logo

capture

capture

capture

capture

Architecture

Src -- components
    |  |- Error
    |  |   |_ Error.js
    |  |- Games
    |  |   |_ Games.js
    |  |- GameStreams
    |  |   |_ GameStreams.js
    |  |- Headers
    |  |   |_ Headers.js
    |  |- Live
    |  |   |_ Live.js
    |  |- Results
    |  |   |_ Results.js
    |  |- Sidebar
    |  |   |_ Sidebar.js
    |  |- TopStreams
    |  |   |_ TopStreams.js
    |--apis.js
    |--App.css
    |--App.js
    |_-package.json

Online version

See demo on Heroku.

How to test locally

  • Clone local-version branch
  • npm install
  • npm start

Note:

  • You will need to provide your own credentials for the Twitch Api in ./api.js
  • You will need to whitelist your dev server IP / localhost in Twitch Dev Dashboard.

Twitch API

Twitch developers: you will need to create an account

TWO FACTOR AUTHENTICATION (2FA) must be enabled.

twitch dev

twitch dev

After connect to:

https://id.twitch.tv/oauth2/authorize?client_id={CLIENT_ID}&redirect_uri={REDIRECT}&response_type=token but replace {CLIENT_ID} by your application ID and {REDIRECT} by an url (one of the ones that you filled in your account), for instance : http://localhost:3000/.

Accept conditions.

Then Twitch will provide you an URL to test:

Then in api.js:

import axios from 'axios';

let api = axios.create({
    headers: {
        "Client-ID": "CLIENT_ID",
        "Authorization": "Bearer TOKEN_PROVIDED"
        }
})
export default api;

Note: don't use {} in the credentials

Dependencies / Stack

npm i react-router-dom

npm i react-twitch-embed-video

Useful links

About

React Twitch clone. (Demo on Heroku)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published