Objective:
To work with React and practice working with Component based architecture. We will continue to connect to
our Teams API as a data source for our app. For an exemplar on how to retrieve Teams API data (using fetch
and the “componentDidMount” lifecycle method), refer to the Week 5 example here:
https://github.com/sictweb/web422/blob/master/Code%20Examples/week5/myapp/src/Employees/Employees.js
Specification:
For this application, we will be working entirely in React. Our application will feature 4 routes: Overview,
Projects, Teams & Employees. Each route will be responsible for rendering information from our Teams API
(often in a
format) – we will not be updating the data at this time using forms. When complete, the
main structure of the app and the “Overview” view will look like the following:
Please Note, once the app is working as expected, please feel free to add any extra design, Images or CSS to
your solution. Be creative – this is your app.
Getting Started:
To get started, create a new React app using the command “create-react-app” – if “create-react-app” is not
available on your system, you can use the command “npm install -g create-react-app”.
Once you have created your new React app – open the folder in Visual Studio Code and run the command
“npm start” to get the React development server running. This should open your default web browser and
show you http://localhost:3000:
At this point, you may go ahead and delete the files:
• App.test.js
• App.css
Next, use the code at the following links to replace your App.js & index.css files (this will give you a solid
starting point and a design to work from):
• https://scs.senecac.on.ca/~patrick.crawford/shared/winter-2019/web422/A4/App.js
• https://scs.senecac.on.ca/~patrick.crawford/shared/winter-2019/web422/A4/index.css
Once this is complete, you need to update your “public/index.html” file to include the following &
•
When you have made the above updates, your app should look like the following:
Dependencies:
This project will make use of several additional dependencies available from npm including:
• moment: https://www.npmjs.com/package/moment
• react-router-dom: https://www.npmjs.com/package/react-router-dom
At this point, it makes sense to "npm install --save …" each of the above modules, since you will need them in
your application
Creating Your Components:
As we know from class, the main building block for all React applications, is the "Component". The following
sections of the specification will outline each component that must be built to get your application working
properly.
NOTE: All Components created for this application must exist in their own file (ie: ComponentName.js).
The First Step is to create the following components based on the existing code within your App.js. We will
shrink down the "App" component to use all of the new components
NavBar
The NavBar is the simplest component. It simply renders the