- This React project has multiple pages: Home, Browse (which uses Firebase authentication), sign in, and sign up.
- The sign in will connect to Firebase when a user tries to sign in, and when a user signs up, we will use Firebase auth to store the user in the Firebase auth database.
- I build this app using React and uses Styled Components for all the styling we implement.
- I use Fuse.js for live search.
- and Im test all our components using React Testing Library.
- And of course we will use React router for navigation!
https://netflix.tinspham.info/
- Initial project π
- Architecture π
- Project dependencies π
- Installing create react app π
- Project cleanup π
- Creating files/folders π
- Creating the Jumbotron component π
- Styled components GlobalStyles π
- Implementing Normalize.css π
- Installing ESLint, Prettier π
- Item component π
- Item component direction prop π
- Container derivative component π
- Footer component π
- Accordion component π
- useContext for Compound Components π
- Accordion component body π
- Opt-form component creation π
- Constants - routes π
- Pages: Home, Browse, SignIn, SignUp π
- Creating React Router Routes π
- Header component π
- Firebase connection π
- React Context for Firebase π
- SignIn Page π
- Firebase top level authentication π
- Firebase console authentication π
- Debugging error auth (if user is in the db or not) π
- SignUp Page π
- Registration page, routes debugging π
- Helpers: routes (React router auth) π
- Protect routes π
- Creating an auth listener (custom hook) π
- Helpers routes review π
- Browse page (categories films & series) component π
- Custom hook:browse page π
- Utils directory and setup π
- Browse container π
- Profiles container π
- Profiles component π
- Loading profile component π
- Spinner review π
- Header profile π
- Header profile: dropdown, chevron π
- Header search styling π
- Header play button style π
- Card list (categories, slides) - films & series logic π
- Entities logic start π
- Player component and Card component styling π
- Movie recommendations π
- Feature component (showing) π
- Passing props into our Feature (item obj) π
- More styling on the card style π
- Debugging the slides π
- Debugging play button and card π
- Player component π
- Review player video π
- Live search using Fuse.js π
- Review our project! π
- Deploy to firebase π
- Add custom domain π
- Add SLL to domain π
Next Steps:
- Testing setup
- Player test
- Footer test
- Accordion test
- Card test
- Feature test
- Form test
- Opt form test
- Player test
- Loading test
- Profile test
- Jumbotron test
- Header test
- Home page test
- Profiles test
- Adding test-ids to Profiles
- Selection filter test
- SignIn Test
- SignUp Test
- We are done! Review and sign off!
- React( custom hooks, context, portals)
- Firebase (Firestore/auth)
- styled-components
- fuse.js
- normalize.css
- Clone this project
git clone https://github.com/tinspham209/netflix-clone
- Install dependencies
npm install
- Start the server
npm start
- Clone this project
- Install dependencies
npm install
- Start packager
npm start
- accordion:
- card:
- feature:
- footer:
- form:
- header:
- jumbotron:
- loading:
- NotFound:
- opt-form:
- player:
- profiles:
- Spinner:
- Import:
//import every thing
import * as React from "react";
import * as ReactDOM from "react-dom";
//for default export
import InfoSection from "./InfoSection";
//for named export
import { InfoSec, InfoRow } from "./components";
- Create a styled-component file. Ex:
src/components/card/styles/card.js
- Import to
src/components/card/index.js
file
// InfoSection.jsx
import { InfoSec, InfoRow } from "./styles/card.js";
- Open file
src/global-styles.js
- Edit on function
GlobalStyles
- go to https://console.firebase.google.com/
- create new project
- Get the config of firebase project
- After that, copy to
src/lib/firebase.prod.js
- go to Firebase ~> click on
Authentication
and setup. - Enable Email/Password (Sign-in method)
- go to Firebase ~> click on
Cloud Firestore
and setup database in test mode (Everyone can edit database). - After that, open file
src/seed.js
- edit information that you want
- After that, go to
src/lib
- uncomment line 4 & line 20
// 4
import { seedDatabase } from "../seed";
// 20
seedDatabase(firebase);
- Reload the page, new data will import to Firestore
- After that, comment again line 4 & line 20.
//4 import { seedDatabase } from "../seed";
//20 seedDatabase(firebase);
- go to
public/images
- select type of films:
films
orseries
- import image to it
- Each films must have 2 images:
large.jpg
&small.jpg
- go to Firebase ~> click on
Project settings
- copy Project ID. Ex:
netflix-clone-8b12f
- open file
deploy-firebase
- update project ID in line 11
firebase use project_ID
- open cmd
- Login firebase
firebase login
- Initial firebase project:
firebase init
- Are you ready to proceed?
Y
- Choose
Hosting
- What do you want to use as your public directory?
build
- Configure as a single-page app
Y
- Deploy
npm run deploy