A clone of the Netflix website using React.
This application uses React, React router, Styled-Components to build the Netflix Frontend Web application.
- Clone the Repository to your local machine: Run this in the terminalin the location you would like to save the repository locally:
git clone https://github.com/cynepton/netflix-clone.gitOr fork the repository and work on your own version.
- Install Dependencies: Enter the repository folder and install the dependencies. You need to have Node and NPM installed to run this step.
cd netflix-clone
npm installThis will install the dependencies based on the information in the package.json file.
- Environment Variables
Create a
.envfile in the folder
touch .envCopy the contents of the public env file, and paste in the .env file.
- Run the Application
npm startAll the components take in ...restProps which are the props for the component and spread it to the HTML tags within them. Please see the component structure to accurately understand where the props are placed.
Most components also take {children}. Tags like the input tag do not take children since it doesn't need a closing tag and there is nothing to be nested within it's tags.
See KarlHadwen's Youtube Video on Compound Components and Github Repo.
It's a Compound Component responsible for rendering the sections of the body of the webpage that contain the marketing boards. Currently, It renders each of the Jumbotron marketing items in the Jumbo Data JSON file. It also has the following sub-components:
Jumbotron.Containerdefined in the JumbotronIndex.jsfile. Renders the Overall container for all the Jumbotron components that gets passed to the Jumbotron container JSX element that is in the jumbotron container file.Jumbotron.Panedefined in the JumbotronIndex.jsfile. The Jumbotron Pane renders it's contents which could be either text or an image. The Pane is half the width of the Jumbotron Div container within which it is placed.Jumbotron.Titledefined in the JumbotronIndex.jsfile. This renders the Jumbotron Title H1 header within the Jumbotron Pane.Jumbotron.SubTitledefined in the JumbotronIndex.jsfile. This renders the Jumbotron SubTitle H2 header within the Jumbotron Pane.Jumbotron.Imagedefined in the JumbotronIndex.jsfile. This renders the Jumbotron Image within the Jumbotron Pane.
The CSS styles for the Jumbotron are located in the Jumbotron.js file. The Styled-Components library is used for the styling.
It's a Compound Component responsible for rendering the footer of the webpage. It also has the following sub-components:
Footer.Containerdefined in the FooterIndex.jsfile. Renders the Overall container for all the Footer components.Footer.Columndefined in the FooterIndex.jsfile. Renders each similar set of links within the footer. Refer to the Footer Container file to see how it is used.Footer.Rowdefined in the FooterIndex.jsfile. This contains all the columns to be renderedFooter.Titledefined in the FooterIndex.jsfile. This renders the larger footer text.Footer.Linkdefined in the FooterIndex.jsfile. This renders each footer text that should have a link.Footer.Textdefined in the FooterIndex.jsfile. This renders static footer text.Footer.Breakdefined in the FooterIndex.jsfile. This renders a break to create spacing within the footer.
The CSS styles for the Footer are located in the Footer.js file. The Styled-Components library is used for the styling.
It's a Compound Component responsible for rendering the accordion feature within the webpage. In this case, the accordion feature contains the FAQs, but it can also be reused elsewhere. It also has the following sub-components:
Accordiondefined in the AccordionIndex.jsfile. Renders the Overall container for all the Footer components.Accordion.Framedefined in the AccordionIndex.jsfile. Currently unused.Accordion.Innerdefined in the AccordionIndex.jsfile. Renders the inner div element within the full container. It may not always be necessary. In this case it is used to set the width of the actual accordion to be less than the full container width.Accordion.Titledefined in the AccordionIndex.jsfile. Renders the title of the Accordion component.Accordion.Itemdefined in the AccordionIndex.jsfile. Contains each accordion item. The item contains the header and the body.Accordion.Headerdefined in the AccordionIndex.jsfile. Renders the accordion header. When the accordion is closed, only the header shows.Accordion.Bodydefined in the AccordionIndex.jsfile. Renders the contents of the accordion. When the header is clicked, it toggles the body to either open or close.
The CSS styles for the Accordion are located in the Accordion.js file. The Styled-Components library is used for the styling.
It's a Compound Component responsible for rendering an input bar that allows the user to type in their email to subcribe to the service. It also has the following sub-components:
OptFormdefined in the OptFormIndex.jsfile. Renders the container for the optForm.OptForm.Inputdefined in the OptFormIndex.jsfile.OptForm.Buttondefined in the OptFormIndex.jsfile.OptForm.Textdefined in the OptFormIndex.jsfile.OptFor.Breakdefined in the OptFormIndex.jsfile. Renders a line break to seperate items within the flexbox.
The CSS styles for the Accordion are located in the OptForm.js file. The Styled-Components library is used for the styling.
The react router endpoints are defined in the Routes file. Any new routes should be added there to make it easier to monitor all the routes from a single location.
This is the base route and renders the home page defined in the Home Page File