Skip to content
Yash Sahu edited this page Oct 28, 2020 · 2 revisions

Welcome to the aurora wiki!

Info about components -

  • DashBoard : It has two sections -
    • Project List
    • Notification panel on the left
  • NavBar: It comprises of two components namely signed in links and signed out links
    • Depending upon the user login state, links are chosen
  • Dashboard, Create article and article detail pages have viewing restrictions, i.e. non-authorised users are diverted to the login page.

How backend is implemented?


Redux part

  • There are different reducers for auth, firebase, firestore and project.
  • They are joined via { combine } from 'redux' and this combined reducer is called root reducer which is supplied to components when is it connected to redux store.
  • The reducer for firebase and firestore are supplied by firebase only and we don't need to write it, it is present in react-firebase and react-firestore and is imported into the project in index.js file and supplied to store created there, thus are already linked in root reducer
  • The reducer is pre-linked with a middleware so that we can do asynchronous tasks in between dispatching an action and before it reaches reducer. This is where we do all backend tasks related to firebase and firestore.
  • In the above-mentioned points, applyMiddleware and reduxFirestore are called 'store enhancers'

What all things happen in index.js file?

  • A redux store is created
  • Firebase is initialised with its configuration and firestore is linked with firebase so that user profile is also shown in firebase property of the store.
  • App is enclosed with redux firebase provider(due to new syntax...earlier it wasn't required) which is further enclosed with Provider which allows the store to get linked with the complete web application.

How cloud functions work?

  • For that, we need to initialise firebase in the terminal which creates a folder named functions in the root directory of the projects.
  • Inside that folder, we need to edit the index.js file for required functionality
  • We export different functions which run when triggers by some event.
  • In this project, namely three functions are defined which have their respective events for getting fired
    • event.createProject
    • event.newUser
    • event.updateProject
  • createNotification adds the notification object received from the three export functions and adds the object in firestore in notification collection from where our notification panel extracts the notifications to show