GithubHelp home page GithubHelp logo

video-archives's People

Contributors

simcheolhwan avatar

Watchers

 avatar  avatar  avatar

video-archives's Issues

Watch Firebase database

  • watch with on event
    • Realtime update when another browser add boards or videos

Example

actions:

export function watchGuestAddedEvent(dispatch) {
  const database = firebase.database()

  database.ref('/guests').on('child_added', snap => {
    dispatch({ type: 'GUESTADDED', payload: snap.val() })
  });
}

reducer:

case ActionTypes.GuestAdded: {
  const newState = Object.assign({}, state)
  newState.guests = newState.guests || []
  newState.guests = newState.guests.slice()
  newState.guests.push(action.guest)
  return newState
}

App:

function mapDispatchToProps(dispatch) {
  watchGuestAddedEvent(dispatch)
  return bindActionCreators({ getInvite, addToInvite }, dispatch)
}

https://www.codementor.io/vijayst/using-firebase-with-redux-for-building-a-react-app-du1086puw

Sort

  • Video: datetime, when video is added (For my need)
    • Check it is safe when video is editted
  • Board and List: ABC order, when they are added or editted
    • Future: Does it need to change order in the Array?

WebSocket Issue

Too slow to get response from Firebase database when WebSocket request is not finished.

  • Should prevent to request something before then.

Improve UX

  • When enter a board that has no lists, focus <input> to add a list

    componentDidUpdate() {
      if (!board.lists.length) {
        this.addListInput.focus()
      }
    }

Improve fetch data from server

  • Set last updated timestamp or id, and compare it at first
  • If there are changes between server and local, show proper message. Not just 'fetching...'

Refactoring

  • Use functional component if it doesn't require class component
  • These is no reason that ALL component map props from boards, videos
  • Use ownProps

Update README

  • Let users know that only YouTube URLs are available now
  • Fix wrong sentences
    • create a new board to start
    • if you change your browser or empty your browser storage
    • you will not be able to
    • This app is being built
    • Source codes are available at

Optimistic updates

Refactoring

  • Split actions/index.js
  • Group and export types as objects in actions/types.js
    • Example:
    const actionTypes = {
      GetInviteRequested: 'GET_INVITE_REQUESTED',
      GetInviteRejected: 'GET_INVITE_REJECTED',
      GetInviteFulfilled: 'GET_INVITE_FULFILLED'
    }
    export default actionTypes
    

Optimistic updates

  • REQUESTED: Prevent Add/Update/Delete until get result
    • What if network is so slow?
  • FULFILLED: spinner - optimistic update
  • REJECTED: undo
    • need to test network fails with Firebase

Structure issue

To improve performance

  • Flatten data structures
    • List to have Board.key

Improve UI

  • Change date format
  • userSelect: 'none'
  • 16:9 Thumbnails
  • Show count of videos on Sidebar

Use Firebase database

Auth

  • Sign up, Sign in, Sign out with Firebase Auth
    • Fetch storage whenever user sign in/out
    • Prevent to use signup/signin/signout as a board slug
  • Redirect signing pages with Auth condition
  • Redirect signing pages with app config
  • Toggle AppHeader with Auth condition
  • Toggle AppHeader with app config
  • Set Firebase security rules

Boards and Videos

  • Use Firebase database
  • Use local storage also

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.