Welcome to Reel Relations!, an exciting application designed to unravel the intriguing connections between two actors and the movies they starred in. For both seasoned film enthusiasts or a coders who want to explore algorithms, this PERN Stack App offers a user-friendly gateway to explore the degrees of separation between your favorite actors.
Providing an immersive experience where you can dive into the captivating world of cinema. Through Reel Relations, you'll discover the fascinating web of relationships that intertwine actors through their shared appearances in movies.
Our app employs a cutting-edge graph-based algorithm to power its exploration capabilities. The ingenious buildGraph function carefully constructs a graph representation by analyzing movies and identifying the actors who have collaborated on-screen through our PostgreSQL database. Each actor is represented as a node within the graph, while their movie collaborations form the intricate connections or edges.
To unveil the degrees of separation between two actors, Reel Relations harnesses the power of the breadth-first search (BFS) algorithm. This intelligent algorithm traverses the graph methodically, tracing paths from one actor to another through their mutual movie appearances. The result is a thrilling revelation of the shortest path that connects the two actors, illuminating the degrees of separation they share.
For optimal performance, completed search results are cached in PostgreSQL for seven days. Repeated searches between the same actors, in either order, can be returned without repeating the TMDB credit verification and graph traversal. The cache persists across app restarts and Railway deployments.
All will find Reel Relations incredibly intuitive. Simply enter the names of the two actors you're curious about, and watch as the app unveils the hidden ties that are binding them through their cinematic collaborations. Prepare to be amazed as you unravel unexpected relationships and gain a deeper understanding of how everyone knows someone in the film industry.
Reel Relations is inviting you to embark on an enchanting journey, where actors, movies, and degrees of separation converge. Get ready to Unveil the Secrets that Lie within the Reels and Discover a Whole New Perspective on the World of Cinema!
Check Out Our Live Render at https://reelrelations.up.railway.app/ Lights! Camera! Action!
Before you begin, ensure you have the following installed:
- Node.js
- npm
- PostgreSQL
-
Clone the repository and navigate to the project directory.
-
Install Dependencies: Run
npm install. -
Environment Setup: Create a
.envfile in the root directory and add the following environment variables:API_KEY=YOUR_TMDB_API_KEY JWT_SECRET=YOUR_JWT_SECRET DATABASE_URL=YOUR_DATABASE_URL GITHUB_CLIENT_ID=YOUR_GITHUB_CLIENT_ID GITHUB_CLIENT_SECRET=YOUR_GITHUB_CLIENT_SECRET GOOGLE_CLIENT_ID=YOUR_GOOGLE_CLIENT_ID GOOGLE_CLIENT_SECRET=YOUR_GOOGLE_CLIENT_SECRET GOOGLE_REDIRECT_URI=http://localhost:3000/api/auth/oauth/google -
Database Setup: Create and connect your PostgreSQL database
reel_relations_db.- The DATABASE_URL should be in the format:
postgres://username:password@localhost:5432/reel_relations_db
- The DATABASE_URL should be in the format:
-
Development Build: Run
npm run build:devto build the application.
- You will need to run Postico (Mac) to load src/Components/assets/csv files into your database.
- Remember to select 'Match Column by Name' to import the csv files to each table.
- Start the Application:
- Run
npm run start:devto start the server. - Open
http://localhost:3000/in your browser.
For production Google sign-in, add the deployed callback URL to the Google
OAuth client's authorized redirect URIs and set GOOGLE_REDIRECT_URI to the
exact same URL. For example:
https://your-domain.example/api/auth/oauth/google.
- Responsive Design: Crafted using Tailwind CSS, our app offers a mobile-friendly and visually appealing interface.
- Technology Stack: Built with the PERN stack (PostgreSQL, Express.js, React, Node.js), ensuring scalability and robustness.
- Graph-based algorithm to analyze movie collaborations.
- Breadth-first search (BFS) algorithm to determine degrees of separation.
- LRU caching system for optimized search performance.
- User-friendly interface for exploring actor connections.
- OAuth 2.0 authentication for secure login.
- Interactive movie & actor cards with detailed information.
- Movie trailer previews.
- Keep track of all your Favorite Actors and Movies under your Favorites in your Account.
- PostgreSQL Search Cache:
- Cached results are available immediately for repeated searches
- Cache works bidirectionally (A→B gives the reverse of B→A)
- Results expire seven days after they are calculated
- Algorithm-versioned keys safely invalidate results after search changes
- Cache failures fall back to the normal search process

