Skip to content

I brought this project to life by adding on what I learned in reactjs for teamwork. Moreover, while I was doing the project, I both reinforced my knowledge and explained it to my team. Details are in the README fileπŸ§žβ€β™€οΈ

Notifications You must be signed in to change notification settings

bzceval/reactjs-movie-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

34 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Movie App

Description

Project aims to create a Movie App.

Problem Statement

  • We are adding a new project to our portfolios. So you and your colleagues have started to work on the project.

Project Skeleton

006 - Movie App (folder)
|
|----readme.md         # Given to the students (Definition of the project)
SOLUTION
β”œβ”€β”€ public
β”‚     └── index.html
β”œβ”€β”€ src
β”‚    β”œβ”€β”€ auth
β”‚    β”‚     └── firebase.js
β”‚    β”œβ”€β”€ components
β”‚    β”‚     β”œβ”€β”€ MovieCard.js
β”‚    β”‚     └── Navbar.js
β”‚    β”œβ”€β”€ context
β”‚    β”‚     └── AuthContext.js
β”‚    β”œβ”€β”€ pages
β”‚    β”‚     β”œβ”€β”€ Login.js
β”‚    β”‚     β”œβ”€β”€ Register.js
β”‚    β”‚     β”œβ”€β”€ Main.js
β”‚    β”‚     └── MovieDetail.js
β”‚    β”œβ”€β”€ router
β”‚    β”‚     └── Router.js
β”‚    β”œβ”€β”€ App.js
β”‚    β”œβ”€β”€ App.css
β”‚    β”œβ”€β”€ index.js
β”‚    └── index.css
β”œβ”€β”€ package.json
β”œβ”€β”€ .env
└── yarn.lock

Project 006 Snapshot

Expected Outcome

movie

Objective

Build a Movie App using ReactJS.

At the end of the project, following topics are to be covered;

  • HTML

  • CSS

  • JS

  • ReactJS

At the end of the project, students will be able to;

  • improve coding skills within HTML & CSS & JS & ReactJS.

  • use git commands (push, pull, commit, add etc.) and Github as Version Control System.

Steps to Solution

  • Before start you can watch these tutorials:

  • Step 1 : Create React App using npx create-react-app movie-app

  • Step 2 : Signup https://firebase.google.com/ and create new app in firebase. Firebase is a backed application development software that enables developers to develop iOS, Android and Web apps. It provides developers with a variety of tools and services to help them develop quality apps, grow their user base, and earn profit. It is built on Google’s infrastructure. Firebase offers a number of services, including: analytics,authentication, cloud messaging, realtime database, performance and test lab. Firebase is categorized as a NoSQL database program, which stores data in JSON-like documents.

Project 005 Snapshot

  • Step 3 : Use https://firebase.google.com/docs/auth/web/start and create Authentication operations.
    • Add the Firebase Authentication JS codes in your firebase.js file and initialize Firebase Authentication:
import { initializeApp } from 'firebase/app';
import { getAuth } from 'firebase/auth';

// TODO: Replace the following with your app's Firebase project configuration at project settings part
// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
  // ...
};

// Initialize Firebase
const app = initializeApp(firebaseConfig);

// Initialize Firebase Authentication and get a reference to the service
const auth = getAuth(app);
  • Use this method to Sign up new users :
import { getAuth, createUserWithEmailAndPassword } from 'firebase/auth';

createUserWithEmailAndPassword(auth, email, password)
  .then((userCredential) => {
    // Signed in
    const user = userCredential.user;
  })
  .catch((error) => {
    console.log(error);
  });
import { getAuth, signInWithEmailAndPassword } from 'firebase/auth';

signInWithEmailAndPassword(auth, email, password)
  .then((userCredential) => {
    // Signed in
    const user = userCredential.user;
  })
  .catch((error) => {
    console.log(error);
  });
  • Use this method to Set an authentication state observer and get user data :
import { getAuth, onAuthStateChanged } from 'firebase/auth';

onAuthStateChanged(auth, (user) => {
  if (user) {
    // User is signed in, see docs for a list of available properties
    // https://firebase.google.com/docs/reference/js/firebase.User
  } else {
    // User is signed out
  }
});
import { GoogleAuthProvider } from 'firebase/auth';

const provider = new GoogleAuthProvider();

signInWithPopup(auth, provider)
  .then((result) => {
    // The signed-in user info.
    const user = result.user;
  })
  .catch((error) => {
    // Handle Errors here.
    console.log(error);
  });
  • Use this method to Sign Out :
import { getAuth, signOut } from 'firebase/auth';

signOut(auth)
  .then(() => {
    // Sign-out successful.
  })
  .catch((error) => {
    // An error happened.
  });
  • Step 4 : Signup https://www.themoviedb.org/documentation/api and get API key. In order to get data use https://api.themoviedb.org/3/discover/movie?api_key=${API_KEY}, to search movies use https://api.themoviedb.org/3/search/movie?api_key=${API_KEY}&query= and to get movie details use https://api.themoviedb.org/3/movie/${id}?api_key=${API_KEY}. Use https://image.tmdb.org/t/p/w1280${poster_path} for image src.

  • Step 5: You can use css frameworks like Bootstrap, Semantic UI, Material UI.

  • Step 6: Add project gif to your project and README.md file.

Notes

  • You can add additional functionalities to your app.

☺ Happy Coding ✍

About

I brought this project to life by adding on what I learned in reactjs for teamwork. Moreover, while I was doing the project, I both reinforced my knowledge and explained it to my team. Details are in the README fileπŸ§žβ€β™€οΈ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published