SPA(no full-page refresh when navigating between those routes) with 4 pages (routes):
- Landing page
- Show detail page: a details page for the TV show "Powerpuff Girls" & "The Mandalorian"
- Episode detail page: an episode detail page with information about specific episodes.
- 404 page: in case route doesn't exist
react: to render UI
redux: latest version with RTK(Redux toolkit) for state management
redux-saga: middleware to manage application side effects.
sass: for styling the components, using mixins etc. (module based)
material-ui: to avoid reinventing the wheel
prop-types: to validate data
ES6: extensively used.
Jest, Enzyme: for unit testing
husky: to add git hooks before a commit and push
To maintain clean, well-structured, extendable I used
- ES linter
- Prettier
- Sass linter
To avoid commiting undesirable code, I used husky for 2 git hooks:
- pre-commit: it checks & automatically fix js lint errors.
- pre-push: it checks & automatically fix js & style lint errors. In addition, it checks minimum test coverage threshold.
Show page and Episode page share common design.
Design is responsive with two breakpoints defined in sass mixins and grid handling through materia ui.
Show page should at least display the following information:
- Show title
- Show Description
- Show cover image
- Episode list: Every episode in the list should link to a details page for that specific episode
The episode detail page should contain at least:
- Episode title
- Episode Summary
- Episode cover image
-
Check in all your source code into Git repository.
-
Branching strategy used: feature based.
-
The end result has to be available in the master branch.
-
App should run from local web server (localhost).
-
Documentation on running the app
-
Code comments in english provided wherever required.
To get the frontend running locally:
- Clone this repo
- run
yarn
to install all req'd dependencies - use
yarn start
to run the project
Data retrieved from the TV Maze API (http://www.tvmaze.com/api).
API fails at times because of CORS issue to avoid this https://cors-anywhere.herokuapp.com/
has been used.
There are still sample response available in case API doesn't respond.
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
Note: this is a one-way operation. Once you eject
, you can’t go back!
If you aren’t satisfied with the build tool and configuration choices, you can eject
at any time. This command will remove the single build dependency from your project.
Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject
will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.
You don’t have to ever use eject
. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.