This Project allows you to practice the concepts and techniques learned over the past Sprint and apply them in a concrete project. This Sprint explored ReactJS, Function Components, component state, side effects and React Router. In your Project for this Sprint, you will demonstrate proficiency by creating an application that uses ReactJS to consume live data retrieved from the World Wide Web and style that data nicely on the page.
Read these instructions carefully. Understand exactly what is expected before starting this Sprint Project.
This is an individual assessment. All work must be your own. Your Project score is a measure of your ability to work independently using the material covered through this sprint. You need to demonstrate proficiency in the concepts and objectives introduced and practiced in preceding days.
You are not allowed to collaborate during the Sprint Project. However, you are encouraged to follow the twenty-minute rule and seek support from your instructor in your cohort help channel on Slack. Your work reflects your proficiency ReactJS Fundamentals and your command of the concepts and techniques in the Function Components and Class Components.
You have 2 days to complete this Project. Plan your time accordingly.
Commit your code regularly and meaningfully. This helps both you (in case you ever need to return to old code for any number of reasons and your project manager.
In this Project, create a web page that presents a styled list of Star Wars characters. Being able to render out data to a web page is a large part of what JavaScript developers do, this Project assesses your ability to achieve such a task.
Demonstrate your understanding of this Sprint's concepts by answering the following free-form questions. Edit this document to include your answers after each question. Make sure to leave a blank line above and below your answer so it is clear and easy to read by your project manager.
-
What is React JS and what problems does it try and solve? Support your answer with concepts introduced in class and from your personal research on the web.
-
What does it mean to think in react?
-
Describe state.
-
Describe props.
-
What are side effects, and how do you sync effects in a React component to state or prop changes?
Follow these steps to set up and work on your project:
- Create a forked copy of this project.
- Add Instructor as collaborator on Github.
- Clone your OWN version of Repo. (Not Gabi's by mistake!)
- Create a new Branch locally:
git checkout -b <firstName-lastName>
. - Change directories into
./starwars
(cd starwars
) and runyarn install
ornpm install
to retrieve all needed dependencies. - Once you have installed the node_modules, run
yarn start
ornpm start
to get your server up and running. - With the server up and running, open Chrome and head over to
localhost:3000
and view your beautiful app. Maybe it's not that pretty... yet, your goal is to ensure this project becomes a thing of beauty. Follow these steps for completing your project. - Implement the project on this Branch, committing progress & changes often.
- Push commits:
git push origin <firstName-lastName>
.
Follow these steps for completing your project:
- Submit a Pull-Request to merge Branch into master (student's Repo).
- Add your instructor as a Reviewer on the Pull-request.
- PM then will count the HW as done by merging the branch back into main.
The MVP of this project will be broken up between 2 stages. Follow each step and be sure to use your RESTful Api and Routing skills to make this application work perfect.
- Fetch a list of Star Wars characters from the Star Wars API (or SWAPI) and render them to the screen.
- Follow the documentation to learn how to fetch a list of "people". However, don't spend too long on this. Here is a link for you to follow if you've looked around the docs for about 15 minutes or so and haven't found where to go - Secret Link to Awesomeness 🤫.
- Set the data you fetch to state.
- Map over the list and render a component for each character on the page.
- Do the same thing for Star Wars films.
- You must have at least one element for each star wars character or film in the data set.
- The elements must be styled with either Reactstrap or MaterialUI - don't rely on browser default styles.
Add a Router to this application by using React Router.
- Install React Router Dom using this command
npm install react-router-dom
. - You'll start by wrapping your
root
component in theRouter
component. - Declare your routes with
Route
. - Declare your routes with
Route
. - Then make it so you can navigate to your routes using
Link
. - Create three
routes
in yourApp
component, one at'/'
for yourHome
component,and one at/films
for your Star War movies and/people
for Star War characters. - Then in your
App
component, create a nav bar that will useLink
to route to your different pages.
- Consistent naming. Examples: variables, functions, Components, and file/folder organization.
- Consistent spacing. Examples: line breaks, around arguments and before/after functions.
- Consistent quotation usage.
- Spell-check.
- Schedule time to review, refine and reassess your work.
It is better to submit a Project that meets MVP than one that attempts too much and fails.
-
Add new route which allows you to view more information about a film or/and a character
-
Build a pagination system that will allow you to load the next page of data.
console.log()
the data coming back from the server.- Notice that there are
next
andprevious
fields that give you a URL. - You can build a function that will get characters called
getCharacters
that you can use dynamically to get the next or previous set of characters. You would need to supply it with the proper fields, and you'll need to set up more state to do this.