All eyes on AI: 2026 predictions The shifts that will shape your stack.

Read now
For developersBuilding Movies database app using React, NodeJS and Redis
Ajeet Raina
Ajeet Raina
END-OF-LIFE NOTICE
Redis is phasing out RedisGraphThis blog post explains the motivation behind this decision and the implications for existing Redis customers and community members.
End of support is scheduled for January 31, 2025.
Beginning with Redis Stack 7.2.x-y, Redis Stack will no longer include graph capabilities (RedisGraph).
IMDb(Internet Movie Database) is the world's most popular and authoritative source for information on movies, TV shows and celebrities. This application is an IMDB clone with basic account authentication and movie recommendation functionality. You will learn the power of RedisGraph and NodeJS to build a simple movie database.
Image

#Tech Stack

  • Frontend - React
  • Backend - Node.js, Redis, RedisGraph

#Step 1. Install the pre-requisites

  • Node - v13.14.0+
  • NPM - v7.6.0+

#Step 2. Run Redis Stack Docker container

Ensure that Docker container is up and running:

#Step 3. Run RedisInsight Docker container

Ensure that Docker container is up and runnig

#Step 4. Clone the repository

#Step 5. Setting up environment variables

Copy .env.sample to .env and add the following details:

#Step 6. Install the dependencies

#Step 7. Run the backend server

#Step 8. Run the client

#Step 9. Accessing the Movie app

Open http://IP:3000 to access the movie app
Image

#Step 10. Sign up for a new account

Image
Enter the details to create a new account:
Image

#Step 11. Sign-in to movie app

Image

#Step 12. Rate the movie

Image

#Step 13. View the list of rated movie

Image

#Step 14. View directed movie over RedisInsight

Image

#Step 15. Find movies where actor acted in.

Run the below query under RedisGraph to find the author acted in a movie
Image

#Step 16. Store a user in a database

Image

#Step 17. Find a user by username

Image

#How it works?

The app consumes the data provided by the Express API and presents it through some views to the end user, including:
  • Home page
  • Sign-up and Login pages
  • Movie detail page
  • Actor and Director detail page
  • User detail page

#Home page

Image
The home page shows the genres and a brief listing of movies associated with them.

#How the data is stored

#Add a new genre:

#Add a movie:

#Set genre to a movie:

#How the data is accessed

#Get genres:

#Get moves by genre:

#Code example: Get movies with genre

#Sign-up and Login pages

Image
Image
To be able to rate movies a user needs to be logged in: for that a basic JWT-based authentication system is implemented, where user details are stored in the RedisGraph for persistence.

#How the data is stored

#Store user in the database:

#How the data is accessed

#Find by user name:

#Code Example: Find user

#Movie detail page

Image
On this page a user can rate the film and view the Actors/directors who participated in the production of the film.

#How the data is stored

#Associate actor with a movie:

#Associate director with a movie:

#How the data is accessed

#Find movie by id with genre, actors and director:

#Code Example: Get movie detail

#Actor and Director detail page

Image

#How the data is accessed

#Find movies where actor acted in:

#Find movies directed by:

#Get movies directed by

#User detail page

Image

#Shows the profile info and movies which were rated by user

#How the data is stored

#Set rating for a movie:

#How the data is accessed

#Get movies and user ratings:

#Get rated movies for user

#Data types:

  • The data is stored in various keys and various relationships.
  • There are 5 types of data
  • User
  • Director
  • Actor
  • Genre
  • Movie

#Each type has its own properties

  • Actor: id, bio, born , bornIn, imdbId, name, poster, tmdbId, url
  • Genre: id, name
  • Director: id, born, bornIn, imdbId, name, tmdbId, url
  • User: id, username, password, api_key
  • Movie: id, url, languages, countries, budget, duration, imdbId, imdbRating, indbVotes, movieId, plot, poster, poster_image, released, revenue, runtime, tagline, tmdbId, year

#And there are 4 types of relationship:

  • User-RATED->Movie
  • Director-DIRECTED->Movie
  • Actor-ACTED_IN_MOVIE->Movie
  • Movie-IN_GENRE->Genre

#References