/firebase-auth-example

A React application to authenticate via Google, Facebook and Twitter.

Primary LanguageJavaScriptMIT LicenseMIT

Firebase authentication example

This application illustrates how to authenticate using various service providers, such as Google, Facebook or Twitter.

The application is available at the following address:
https://authexample-b84c8.firebaseapp.com/

Application structure

All the machinery related to Redux + Saga is under src/redux and its operation is quite simple:

  1. execute an action: dispatch(myAction) (src/redux/actions.js)
  2. which is optionally captured by a "saga" (src/redux/sagas.js)
  3. which in turn calls a "provider" (src/redux/provider.js)
  4. whose response is processed by a "reducer" (src/redux/reducer.js)

And finally each component is updated according to the "state tree".

src
  /components/     --> Common components
  /redux/          --> Redux + Saga
  /translations/   --> Translations
  /views
    /snippets/     --> Header, Footer, etc...
    /**            --> Views (Layouts)
  /Router.js       --> Router (main application)
  config-sample.js --> Template config file (copy to config.js)

Most relevant libraries

  1. @material-ui: A list of visual components.
  2. firebase: A Firebase API.
  3. @react-firebase/auth: An authentication library.
  4. react-firebaseui: A federated authentication library.
  5. axios: An HTTP client.
  6. react-intl: Internationalization library.
  7. react-router-dom: Router (Single Page Application).
  8. styled-components: A library to apply CSS styles to the components.
  9. react-redux: React-Redux
  10. redux-saga: Redux-Saga

The application was translated to English and Spanish (see /src/translations). You can easily change the default language from the config.js file:

export const language = "en";

Screenshots