Components

The final entity we are going to look at is the components. For this section, instead of pointing to the code in the text editor, I will refer to the hosted documentation. The hosted documentation has additional information that we are going to see in a moment. You can read more about these components, under the Components section, here: https://smart-exchange.herokuapp.com/docs/. Here is the list of key components on the client site:

  • Home: This is the home component, which loads by default. This route loads the list of threads that are created by various users and sorts them by time, as well as pinned threads. Also, do take a look at the DOM Tree tab: https://smart-exchange.herokuapp.com/docs/components/HomeComponent.html#dom-tree. These will give you more insight into this component.
  • AboutThis component displays a static page that talks about the application.
  • RegisterThis component has the logic and mark up needed to register a new user. 
  • Login: This component has the logic and mark up needed to login a registered user.
  • Account: This component has the logic and mark up needed to display user's profile. We are not providing an option as of now to edit the profile.
  • AdminThis component has the logic and mark up to view a list of users in database. This component can be accessed only by an admin. By default, when a user registers using the application, they will be assigned a user role. If we want to change this, we need to log into the database manually and then update user to admin
  • Create threadThis component has the logic and mark up to create a new thread. Only logged in users have access to this component. 
  • Edit thread: This component has the logic and mark up to edit a created thread. Only the owner of the thread or an admin can access this component.
  • View threadThis component has the logic and mark up to view a thread as well as the replies on that thread. In the same component, we have set up the form to reply to this thread. Only logged in users can reply.

These are some of the key components on the client site. This wraps up our walk-through of the client side code. In the next section, we will run the application and observe the output.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.82.217