Skip to content

shauryadata/cineverse

Repository files navigation

CineVerse — Premium Movie & TV Recommendation Platform

A Netflix-inspired movie and TV series recommendation platform built with Next.js 14, TypeScript, and Tailwind CSS. Features a cinematic sky-blue dark theme, content-based recommendation engine, commercial verdict analytics, and fluid motion-enhanced browsing experience powered by TMDB.

Next.js TypeScript Tailwind CSS Framer Motion License: MIT

Live demo →

Features

  • Cinematic Hero Banner — Auto-rotating featured content with crossfade transitions and Ken Burns zoom effect
  • Content Rails — Horizontal scrollable sections with scroll-triggered reveal animations
  • Search & Filters — Full-text search with genre, year, rating, language, and sort filters
  • Detail Pages — Rich movie/TV detail views with cast, trailers, keywords, metadata, and commercial verdict
  • Commercial Verdict — Budget vs revenue analysis classifying titles as Blockbuster, Super Hit, Hit, Average, Flop, or Disaster with ROI metrics and animated progress bars
  • Recommendation Engine — Content-based recommendations using genre similarity, quality scoring, and user preference weighting
  • Watchlist — Persistent watchlist stored in localStorage
  • Like/Dislike Feedback — Personalization signals that improve recommendations over time
  • Browse by Genre — Genre-organized content discovery with 10 featured genres
  • Fluid Motion — Framer Motion-powered page transitions, reveal animations, staggered content loading
  • Sky Blue Theme — Premium dark cinematic base with cool blue accents throughout
  • Responsive Design — Premium experience from mobile to desktop
  • Loading States — Skeleton loaders and smooth transitions throughout
  • Error Handling — Graceful error boundaries with helpful recovery actions

Quick Start

Prerequisites

Setup

# Clone and install
git clone https://github.com/shauryadata/cineverse.git
cd cineverse
npm install

# Configure environment
cp .env.example .env.local
# Edit .env.local and add your TMDB API key

# Run development server
npm run dev

Open http://localhost:3000 to view the app.

Scripts

Command Description
npm run dev Start development server
npm run build Create production build
npm run start Start production server
npm run lint Run ESLint

Environment Variables

Variable Required Description
TMDB_API_KEY Yes Your TMDB v3 API key
TMDB_READ_ACCESS_TOKEN No TMDB v4 read access token (optional)

Architecture

src/
├── app/                    # Next.js App Router pages
│   ├── page.tsx            # Homepage with hero + content rails
│   ├── search/             # Search with filters
│   ├── browse/             # Genre-based browsing
│   ├── watchlist/          # User watchlist
│   ├── movie/[id]/         # Movie detail page
│   ├── tv/[id]/            # TV show detail page
│   └── api/                # API routes
│       ├── search/         # Search & discover endpoint
│       ├── recommendations/ # Recommendation candidates
│       └── watchlist/      # Watchlist item resolver
├── components/
│   ├── home/               # HeroBanner, ContentRail, PersonalizedSection
│   ├── media/              # MediaCard, MediaGrid, MediaDetailView, VerdictCard
│   ├── search/             # SearchBar, FilterPanel
│   ├── layout/             # Navbar, Footer
│   └── ui/                 # Button, Skeleton, RatingBadge, GenreBadge, MotionDiv
├── lib/
│   ├── tmdb.ts             # TMDB API client (all data fetching)
│   ├── recommendations.ts  # Recommendation engine
│   ├── verdict.ts          # Commercial verdict classification logic
│   ├── types.ts            # TypeScript domain models
│   └── utils.ts            # Formatting & helper utilities
├── hooks/
│   ├── usePreferences.ts   # Reactive user preferences hook
│   └── useDebounce.ts      # Debounced value hook
└── store/
    └── preferences.ts      # localStorage-backed preference store

Key Design Decisions

  • Server/Client Split: Homepage content rails use React Server Components with Suspense boundaries for parallel streaming. Interactive features (watchlist, likes, search) are client components.
  • API Layer: All TMDB calls go through src/lib/tmdb.ts with consistent normalization. Internal API routes handle search aggregation and watchlist resolution.
  • No External State Library: User state is simple (lists of IDs + genre weights), so localStorage + a custom hook with event-based sync is sufficient.
  • Image Optimization: Next.js <Image> with TMDB CDN remote patterns for automatic optimization and lazy loading.
  • Motion Design: Framer Motion used for page transitions, scroll-triggered reveals, staggered animations, and interactive feedback — all subtle and performant.

Commercial Verdict System

Movie detail pages include an automated commercial performance classification based on budget and revenue data from TMDB.

Classification Logic

The verdict is computed from the revenue-to-budget ratio, accounting for the industry standard that marketing costs are typically ~50% of production budget (so breakeven is ~2x):

Verdict Revenue / Budget Description
Blockbuster >= 4.0x Massive commercial success
Super Hit >= 3.0x Strong box office performer
Hit >= 2.0x Profitable theatrical release
Average >= 1.5x Modest returns after marketing costs
Flop >= 0.75x Lost money at the box office
Disaster < 0.75x Significant financial loss

Displayed Metrics

  • Budget and revenue figures
  • Profit/loss amount
  • ROI percentage
  • Revenue-to-budget ratio with animated progress bar
  • Color-coded verdict badge (emerald → green → sky → yellow → orange → red)

Edge Cases

  • Gracefully hidden when budget or revenue data is unavailable (common for older films, indie releases, or TV shows)
  • TV shows do not display the verdict section (no budget/revenue data from TMDB)

The verdict logic lives in src/lib/verdict.ts and thresholds can be adjusted by modifying the ratio constants.

Recommendation Engine

The recommendation system uses a content-based hybrid approach:

Scoring Components

  1. Genre Overlap (40%) — Weighted Jaccard similarity between item genres and user preference profile. Genre weights are built from like/dislike history.

  2. Quality Signal (30%) — Bayesian-weighted average rating that accounts for vote count (prevents low-vote-count outliers from ranking too high).

  3. Popularity Signal (15%) — Log-scaled popularity score to balance blockbusters vs. hidden gems.

  4. Recency Boost (15%) — Time-decay function that gives newer content a slight edge.

Personalization

  • Like/Dislike feedback builds a genre weight profile over time
  • Liked items boost their genres; disliked items penalize theirs
  • Watchlisted items get a small score boost
  • Previously rated items are excluded from recommendations

Recommendation Labels

Each recommendation includes a contextual reason:

  • "Because you enjoy Thriller"
  • "Matches your taste in Sci-Fi"
  • "Critically acclaimed"
  • "Trending now"

Detail-Page Recommendations

On detail pages, recommendations use:

  • TMDB's own similar/recommended endpoints
  • Genre overlap with the current item
  • "Similar in Drama & Crime" style labels

Tech Stack

Layer Technology
Framework Next.js 14 (App Router)
Language TypeScript 5.5
Styling Tailwind CSS 3.4
Animations Framer Motion 11
Icons Lucide React
Data Source TMDB API v3
State localStorage + custom hooks
Deployment Vercel-ready

Future Enhancements

  • User Authentication — OAuth-based accounts with server-side preference persistence
  • Collaborative Filtering — "Users who liked X also liked Y" using aggregated interaction data
  • Semantic Search — Embedding-based search over movie descriptions for natural language queries
  • Watch Providers — Integration with TMDB's watch provider data to show where titles are streaming
  • Trailer Modal — Inline YouTube player instead of external redirect
  • Infinite Scroll — Paginated loading for search results and browse pages
  • PWA Support — Offline capability and installability
  • Advanced Filters — Runtime range, decade picker, multi-genre selection, cast/crew search
  • Social Features — Share lists, collaborative watchlists, friend recommendations
  • AI-Powered Mood Matching — "I want something like Inception but more emotional" natural language recommendations

License

MIT

About

Netflix-inspired movie & TV recommendation platform: content-based recommender, commercial-verdict analytics, and a cinematic Framer Motion UI. Next.js 14 · TypeScript · TMDB.

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors