Skip to content

Repository files navigation

FyM (Find Your Movie)

Project Status License Type Next.js React TypeScript TailwindCSS

Movies and TV shows explorer with search, filters, and complete details integrated with The Movie Database (TMDB) API.

πŸ“‹ Description

FyM is a modern web application to explore movies and TV shows catalog. Built with Next.js 16 and React 19, it uses the App Router for a Server Components-based architecture with hybrid rendering support.

Key Features

  • Content Exploration: Browse by categories (Trending, Popular, Top Rated, Upcoming, Now Playing)
  • Multi-domain Search: Search movies, shows, and people simultaneously
  • Complete Details: Extended info, credits, trailers, streaming providers
  • Advanced Filtering: Genre filtering and custom sorting
  • Collections: Movie collections viewing
  • Responsive Design: Optimized for mobile and desktop
  • Advanced UX: Loading skeletons, debounced search, auto-scroll in carousels

πŸš€ Tech Stack

Technology Version Purpose
Next.js 16.2.1 React Framework with App Router
React 19.2.4 UI Library
TypeScript 5.x Static Typing
Tailwind CSS 4.x Style Utilities
TMDB API v3 Data Source

πŸ“ Project Structure

fym/
β”œβ”€β”€ public/                    # Static assets
β”‚   β”œβ”€β”€ file.svg
β”‚   β”œβ”€β”€ globe.svg
β”‚   β”œβ”€β”€ next.svg
β”‚   β”œβ”€β”€ vercel.svg
β”‚   └── window.svg
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                  # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ layout.tsx        # Root layout
β”‚   β”‚   β”œβ”€β”€ page.tsx         # Home page
β”‚   β”‚   β”œβ”€β”€ globals.css       # Global styles
β”‚   β”‚   β”œβ”€β”€ favicon.ico
β”‚   β”‚   β”œβ”€β”€ movies/          # Movies catalog
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ MoviesClient.tsx
β”‚   β”‚   β”‚   └── loading.tsx
β”‚   β”‚   β”œβ”€β”€ series/          # TV Series catalog
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ SeriesClient.tsx
β”‚   β”‚   β”‚   └── loading.tsx
β”‚   β”‚   β”œβ”€β”€ search/          # Search page
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”œβ”€β”€ movie/[id]/      # Movie details
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   β”œβ”€β”€ series/[id]/     # Series details
β”‚   β”‚   β”‚   └── page.tsx
β”‚   β”‚   └── collection/[id]/  # Collection details
β”‚   β”‚       └── page.tsx
β”‚   β”œβ”€β”€ components/          # React Components
β”‚   β”‚   β”œβ”€β”€ HeroBanner.tsx
β”‚   β”‚   β”œβ”€β”€ HeroBannerWrapper.tsx
β”‚   β”‚   β”œβ”€β”€ MovieCard.tsx
β”‚   β”‚   β”œβ”€β”€ MovieFilters.tsx
β”‚   β”‚   β”œβ”€β”€ MovieGrid.tsx
β”‚   β”‚   β”œβ”€β”€ MovieRow.tsx
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx
β”‚   β”‚   └── SearchSkeleton.tsx
β”‚   β”œβ”€β”€ hooks/               # Custom React Hooks
β”‚   β”‚   β”œβ”€β”€ useSearch.ts
β”‚   β”‚   └── useDebounce.ts
οΏ½οΏ½οΏ½   β”œβ”€β”€ lib/                 # Utilities and business logic
β”‚   β”‚   └── api/
β”‚   β”‚       β”œβ”€β”€ client.ts   # API Client + TypeScript interfaces
β”‚   β”‚       β”œβ”€β”€ config.ts   # Configuration and endpoints
β”‚   β”‚       └── index.ts    # Exports
β”‚   └── types/               # TypeScript types
β”‚       └── movie.ts
β”œβ”€β”€ .env.local               # Environment variables
β”œβ”€β”€ eslint.config.mjs        # ESLint configuration
β”œβ”€β”€ next.config.ts          # Next.js configuration
β”œβ”€β”€ package.json
β”œβ”€β”€ postcss.config.mjs      # PostCSS configuration
β”œβ”€β”€ tailwind.config.ts     # Tailwind configuration
└── tsconfig.json         # TypeScript configuration

πŸ› οΈ Installation

Prerequisites

  • Node.js 18.x or higher
  • NPM, Yarn, PNPM or Bun

Steps

  1. Clone the repository
git clone <repository-url>
cd fym
  1. Install dependencies
npm install
# or
yarn install
# or
pnpm install
# or
bun install
  1. Configure environment variables

Create a .env.local file in the project root:

NEXT_PUBLIC_TMDB_API_KEY=your_tmdb_api_key
NEXT_PUBLIC_OMDB_API_KEY=your_omdb_api_key   # Optional

To get a TMDB API key, register at themoviedb.org.

  1. Run the development server
npm run dev
  1. Open in browser

Navigate to http://localhost:3000

Available Scripts

Script Description
npm run dev Starts the development server
npm run build Builds the application for production
npm run start Starts the production server
npm run lint Runs ESLint

🧩 Architecture

Server Components

Main pages use Server Components for direct server-side data fetching:

// src/app/page.tsx
async function getData() {
  const [trending, popular, topRated] = await Promise.all([
    apiClient.getTrending("movie"),
    apiClient.getMoviePopular(),
    apiClient.getMovieTopRated(),
  ]);
  return { trending, popular, topRated };
}

Client Components

Interactive components that require state or effects:

  • Navbar: Navigation with search
  • HeroBannerWrapper: Auto-scrolling carousel
  • MovieRow: Carousels with auto-scroll
  • MoviesClient/SeriesClient: Client-side state for filters and infinite scroll
  • SearchSkeleton: Loading states

Custom Hooks

  • useSearch: Hook for search with 500ms debounce and state management
  • useDebounce: Utility to prevent excessive requests during typing

Rendering Strategy

Page Strategy
Home SSR with cache (revalidate: 3600s)
Movies/Series Initial SSR + CSR for interaction
Search CSR (client-side search)
Details SSR with related data

πŸ“‘ API Integration

TMDB API v3

The project consumes The Movie Database API with the following implemented endpoints:

Movies

Method Endpoint Description
getTrending(mediaType) /trending/{mediaType}/week Trending content
getMoviePopular(page) /movie/popular Popular movies
getMovieTopRated(page) /movie/top_rated Top rated movies
getMovieUpcoming(page) /movie/upcoming Upcoming movies
getMovieNowPlaying(page) /movie/now_playing Now in theaters
getMovieDetails(id) /movie/{id} Full details
getMovieSimilar(id) /movie/{id}/similar Similar movies
getMovieCredits(id) /movie/{id}/credits Cast and crew
getMovieVideos(id) /movie/{id}/videos Trailers and clips
getMovieWatchProviders(id) /movie/{id}/watch/providers Where to watch
discoverMovies(genre, page, sortBy) /discover/movie Discover by genre

TV Shows

Method Endpoint Description
getTvPopular(page) /tv/popular Popular TV shows
getTvTopRated(page) /tv/top_rated Top rated TV shows
getTvOnTheAir(page) /tv/on_the_air Currently airing
getTvDetails(id) /tv/{id} Full details
getTvSeasonDetails(id, season) /tv/{id}/season/{season} Season details

Search

Method Endpoint Description
searchMulti(query, page) /search/multi Global search
searchMovies(query, page) /search/movie Search movies
searchTvShows(query, page) /search/tv Search TV shows

Image Configuration

// src/lib/api/config.ts
export const IMAGE_SIZES = {
  poster: { small: "w185", medium: "w342", large: "w500", original: "original" },
  backdrop: { small: "w300", medium: "w780", large: "w1280", ultra: "original" },
  profile: { small: "w45", medium: "w185", large: "h632", original: "original" },
} as const;

πŸ”§ Environment Variables

Variable Required Description
NEXT_PUBLIC_TMDB_API_KEY βœ… TMDB API Key
NEXT_PUBLIC_OMDB_API_KEY ❌ OMDB API Key (optional)

Note: API keys in .env.local are for development. For production, use secure environment variables on your hosting platform.

🎨 UI/UX

Design System

  • Framework: Tailwind CSS 4 with PostCSS
  • Theme: Dark with red accents
  • Typography: Geist (sans/mono) + Rubik Glitch (brand)
  • Effects: Backdrop blur, smooth transitions, hover states

Color Palette

Color Usage
#1A1A1B Main background
#FFFFFF Primary text
#9CA3AF Secondary text
#DC2626 (red-600) Accents, actions
#EF4444 (red-500) Hover states

UI Components

  • HeroBanner: Auto-scrolling carousel with background gradient
  • MovieRow: Horizontal carousel with auto-scroll
  • MovieGrid: Responsive card grid
  • MovieCard: Card with poster, title and rating
  • Navbar: Fixed navigation with search
  • SearchSkeleton: Loading state skeletons
  • MovieFilters: Genre and sorting filters

πŸ—οΈ Built With


πŸ“© Contact & Socials

Portfolio Instagram Gmail WhatsApp


πŸ“„ License

MIT License - Copyright (c) 2024

Permission is hereby granted, free of charge, to any person obtaining a copy of this software to deal in the Software without restriction.

About

Website with information about movies

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages