ReactJS Application with a NodeJS virtual server using Star Wars API at https://swapi.dev/ to render an aggregation of results based on people, planets, and starships.
Example Endpoint for Reference: https://swapi.dev/api/people?search=skywalker&page=1
ENDPOINTS | QUERY | METHOD | DESCRIPTION |
---|---|---|---|
/people |
page |
GET | DEFAULT: Get a list of people (subdivided by 10 entries per page number query*) |
/people |
search |
GET | Get a list of people filtered by query string matching name of person (not case sensitive) |
/planets |
page |
GET | DEFAULT: Get a list of planets (subdivided by 10 entries per page number query*) |
/planets |
search |
GET | Get a list of planets filtered by query string matching name of planet (not case sensitive) |
/starships |
page |
GET | DEFAULT: Get a list of starships (subdivided by 10 entries per page number query*) |
/starships |
search |
GET | Get a list of starships filtered by query string matching either name or model of the starship (not case sensitive) |
* Page # by default endpoint query is 1
. Excluding the query altogether will still result in returned queries in the same manner as ?page=1
.
Two terminals must be opened simultaneously for the application to work properly.
NOTE: The following instructions are for PowerShell and Git Bash users. More to follow.
A) On the First Terminal (NodeJS Back End)
- Type
cd server
and press enter to open the back end server folder - Type
yarn install
and press enter to install server dependencies for NodeJS - Type
yarn start
and press enter to start the virtual server - Once you are finished, press both
Ctrl
+C
to terminate the NodeJS server.
B) On the Second Terminal (ReactJS Front End)
- Type
cd client
and press enter to open the front end client folder - Type
yarn install
and press enter to install client dependencies for ReactJS - Type
yarn start
and press enter to start the React App Client - Once you are finished, press both
Ctrl
+C
to terminate the ReactJS local host.
To look for people in the Star Wars Universe, select people
. Likewise for planets and starships, select planets
and starships
respectively.
Results are aggregated in tens, so you have to press the next page to load the next set of items in that category.
If you would like to return to the previous page, just click on the Previous Page button.
Alternatively, you can use the search box which will only return up to the first ten results based on the name of the entry (starships entries include both name and/or model identification; example: The Ship "Executor" has a model name called "Executor-class star dreadnought", so if you search "star", any queries involving the name or model name will be included) you enter and click on the submit button (alternatively, pressing the "Enter" key on your keyboard also works).
Feel free to fork and borrow this repository for your own use, and any changes you want to suggest, feel free to make a pull request with your suggested changes and your comments to indicate what needs to be changed and/or improve.
Please note I will IGNORE and DISREGARD
any requested changes that does not include a comment, feedback, note, or any indication of what, where, or why you are requesting the change!
I can also be reached at my email address: [email protected] or my LinkedIn: https://www.linkedin.com/in/brandoncha/