AI • Science • Technology • Future

Side Projects

How CineHindi’s Recommendation Engine Works

Image from the original article
Featured image: original publisher image. Via original publisher.

Crucial to any content discovery app is how it decides what to show next. CineHindi, a movie and TV discovery app built with Next.js and the TMDB API, tackles this challenge with a personal recommendation engine that adapts to user behavior in real time. Source: dev.to.

From Catalogue to Recommendation

TMDB provides metadata—titles, posters, genres, ratings, and cast—but not a reason to pick one item over another. A grid of posters is a catalogue, not a guide. Without a mechanism to interpret user preferences, content remains static and impersonal.

Crish Verma, the app’s creator, wanted the home page to feel like it understood user habits. To achieve that, he built a small scoring engine that re-ranks content based on user history. This engine evaluates not just what users watch, but how they engage with content—what they like, how long they watch, and which genres they consistently return to.

How the Scoring Engine Works

  • Genre affinity: If a user watches three South Indian action films in a row, the engine increases the weight of similar genres. Genres abandoned or skipped decay over time, ensuring the system does not overcommit to outdated preferences.
  • Recency decay: Content watched last week scores higher than something watched two months ago. The engine gradually forgets past activity, reflecting how tastes evolve over time and preventing the system from being locked into early behavior.
  • Language preference: The app supports Hindi, South Indian languages, English, Korean, and Japanese content. If a user consistently watches K-dramas, more K-dramas appear in recommendations—no manual filtering needed. This signal is embedded directly into the algorithm, not treated as a secondary setting.

The engine lives in a single module, lib/recommend.ts, and is shared between the browse UI and API routes. This ensures consistency—what users see on the home page matches what the API returns, creating a unified experience across all user-facing features.

Guest-First Personalization

Most apps require signups before personalization. CineHindi removes that barrier. Users can browse, like, and add content without ever creating an account. All interactions—watch history, likes, and watchlists—are stored in localStorage.

The recommendation engine runs entirely from this local store, meaning users get personalized content from the moment they open the app. When a user signs in, their guest library merges into their account. The rule is simple: existing cloud data takes precedence. All other data carries over, preserving continuity in user experience.

Cloud writes are fire-and-forget. Browsing never waits for a network response, which improves performance and reduces latency. Row-level security ensures users can only access their own content, protecting privacy and maintaining data integrity.

Image from the original article
original publisher image. Via original publisher. · Source

Resume, Categories, and Deep Links

TV shows remember the last season and episode a user opened. The app jumps back to that point, offering a seamless viewing experience. Playback runs through third-party iframe servers, and resume is tracked at the episode level, not the second. The schema is designed to support position-based resume when playback events are exposed, allowing for future integration with second-level resume features.

The app features 28 curated categories—such as Bollywood, Hollywood, anime, and Indian web series. Each category is shareable. A link like /browse?category=anime&type;=all opens exactly that shelf, enabling users to easily share content with friends or save specific views for later.

The discovery UI—rows, carousels, genre pages, and live search—uses the same scoring engine. This ensures a consistent user experience across all features, from initial discovery to deep dives into specific genres.

What Could Be Improved

Verma identifies two key improvements:

  1. Position-based resume: Episode-level resume is functional, but second-level resume—resuming at a specific point—is what users expect. This feature should be implemented from the start, not as a later addition.
  2. Early testing of the scoring engine: The engine is a single module with clear inputs and outputs, making it easy to test. Verma suggests putting it behind a test suite earlier to catch drift and ensure reliability. This would allow for faster iteration and more confident deployment of new features.

The full codebase is open source at github.com/akyourowngames/Movix. The author invites others to share their own recommendation approaches—how they weight recency, genres, or other signals—offering a valuable opportunity for community-driven innovation in personalization systems.

For readers building similar apps, this case offers a clear, practical model of how to build a personalization engine without relying on user signups or complex infrastructure. It demonstrates that effective personalization can emerge from simple, well-designed signals and robust local data handling.

Related reading: Spotify Wrapped for Git History explores how developers track personal patterns over time. Cobra Music Studio shows how a self-contained app can be built with minimal infrastructure. Schema Drift Repair highlights how technical systems evolve and require maintenance.

Sources & further reading

Featured image: original publisher image. Via original publisher. Image source