How venu1011/cinevault works
1. What this repo is
CineVault is a client-side React SPA for movie discovery and personal collection tracking. There is no custom backend in the repository; the app talks directly to external movie services and persists user-specific data in browser storage.
2. Application shell
src/main.jsx boots the app, src/App.jsx defines the top-level layout and routing, and index.html is the Vite entry document. Global styling lives in src/index.css and the visual system is driven by Tailwind config.
3. Route-level architecture
The main navigable screens are in src/pages:
- Home.jsx for discovery and featured content
- SearchResults.jsx for filtered/search-driven browsing
- MovieDetails.jsx for the full movie view
- Watchlist.jsx for the user’s saved collection
These pages are the primary boundaries for data loading and UI state.
4. Reusable UI layer
src/components contains the shared presentational and interaction pieces used across pages:
- navigation and layout: Navbar, Footer, HeroSection
- browsing controls: FilterPanel, Pagination, MovieCard
- feedback states: LoadingSkeleton, EmptyState, ErrorBoundary
- transitions and overlays: PageTransition, TrailerModal, BackToTop
This layer keeps page components focused on orchestration rather than markup.
5. State management boundary
The app uses Zustand stores in src/store:
- themeStore.js controls dark/light theme and persistence
- watchlistStore.js owns the user’s saved movies, watched status, ratings, and related collection state
These stores are the main client-side source of truth for user preferences and collection data.
6. Data access and external API boundary
Movie data is fetched through utilities in src/utils:
- api.js centralizes TMDb API configuration
- api-tmdb-proxy.js wraps TMDb requests through a proxy to avoid CORS issues
- helpers.js likely contains normalization/formatting helpers used by UI and data transforms
The external dependency is The Movie Database (TMDb) API, which provides movie metadata, images, trailers, genres, and watch-provider data.
7. Recommendation flow
src/utils/recommendations.js implements the app’s “AI-powered” recommendation behavior. In practice, this is a client-side recommendation engine that uses the watchlist and ratings to infer genre and preference patterns, then returns suggested movies for the Home page “For You” section.
8. Core user flows
The major runtime flows are:
- search input in Navbar or HeroSection → TMDb search/autocomplete → SearchResults
- selecting a movie card → MovieDetails → fetch details, cast, trailers, providers
- adding/removing items from watchlist → Zustand store → persistent localStorage
- changing theme → theme store → persisted preference
- viewing recommendations → watchlist store + recommendation utility → Home page suggestions
9. Movie detail boundary
MovieDetails.jsx is the densest integration point. It aggregates multiple TMDb data types into one view: movie metadata, cast/crew, ratings, runtime, trailer playback via TrailerModal, and streaming/provider links. This page is the main hub where external movie data is combined with local watchlist actions.
10. Persistence model
User-specific state is browser-local, not server-side. The repo emphasizes persistence through localStorage via Zustand, so watchlist and theme survive refreshes and sessions. The app also uses browser-based UX state like modals, skeletons, and navigation transitions rather than backend session state.
11. UX and resilience layers
Several components act as cross-cutting infrastructure:
- ErrorBoundary prevents the entire SPA from crashing on render errors
- LoadingSkeleton and EmptyState define async and no-data states
- PageTransition and Framer Motion provide animated navigation
- react-hot-toast is used for non-blocking feedback
- BackToTop and keyboard shortcuts improve navigation ergonomics
12. Build and deployment shape
This is a Vite-built static frontend with Tailwind CSS and React 18. Deployment files (netlify.toml, vercel.json, public/_redirects) show SPA rewrite handling for client-side routing on static hosts. public/manifest.json indicates PWA support, but there is still no backend service in-repo.
13. Where architecture boundaries matter
For a diagram, the important separations are:
- UI shell and routing
- page-level orchestration
- reusable component layer
- Zustand client state
- TMDb/proxy data access
- browser persistence
- deployment/static hosting rewrites
The system is essentially a layered frontend that composes external movie data with local user collection state.
Main entry points: SearchResults.jsx Search · App.jsx App shell · Home.jsx Home · MovieDetails.jsx Details
Components 18
App shell
Vite entry, top-level layout, and routing boundary.
Pages
Route-level screens that orchestrate major user flows.
- Home · Featured content and recommendation landing screen.
src/pages/Home.jsx - Search · Filtered browsing and search-driven movie discovery.
src/pages/SearchResults.jsx - Details · Full movie view with metadata, cast, trailers, and providers.
src/pages/MovieDetails.jsx - Watchlist · User saved movies, watched status, and ratings.
src/pages/Watchlist.jsx
Shared UI
Reusable components and cross-cutting UX infrastructure.
- Navbar · Primary navigation, search entry, and top-level actions.
src/components/Navbar.jsx - Hero · Featured discovery area on the home screen.
src/components/HeroSection.jsx - Movie card · Reusable movie preview tile for lists and grids.
src/components/MovieCard.jsx - Filters · Filtering controls for search and discovery views.
src/components/FilterPanel.jsx - Trailer modal · Trailer playback overlay used from movie detail flows.
src/components/TrailerModal.jsx - UX states · Loading, empty, error, transition, and scroll-to-top behaviors.
Client state
Zustand stores and browser-persisted user state.
- Theme store · Persists dark/light theme preference in the browser.
src/store/themeStore.js - Watchlist store · Holds saved movies, watched status, ratings, and collection state.
src/store/watchlistStore.js
Data layer
External API access and client-side recommendation logic.
- TMDb API · Central TMDb configuration and request setup.
src/utils/api.js - Proxy client · Wraps TMDb requests through a proxy to avoid CORS issues.
src/utils/api-tmdb-proxy.js - Recommendations · Derives suggested movies from watchlist patterns and ratings.
src/utils/recommendations.js
Static deploy
SPA hosting and routing rewrite configuration.
- SPA hosting · Static hosting rewrites and deployment settings for client-side routing.
netlify.toml
Connections 25
- Entry → App shell: boots · Entry point renders the application shell.
- App shell → Home: routes to · Shell dispatches to the home discovery screen.
- App shell → Search: routes to · Shell dispatches to search results.
- App shell → Details: routes to · Shell dispatches to movie detail view.
- App shell → Watchlist: routes to · Shell dispatches to the user collection screen.
- Home → Hero: uses · Home composes the featured landing section.
- Home → Movie card: uses · Home renders movie previews in discovery lists.
- Search → Filters: uses · Search page exposes filtering and browse controls.
- Search → Movie card: uses · Search results are rendered as movie cards.
- Details → Trailer modal: uses · Detail page opens trailers in an overlay.
- Details → Watchlist store: reads/writes · Detail view updates saved movies and ratings.
- Watchlist → Watchlist store: reads/writes · Watchlist page is backed by the collection store.
- Navbar → Search: initiates · Navbar provides the main search entry flow.
- Hero → Search: initiates · Hero content can drive discovery searches.
- Watchlist store → Recommendations: feeds · Collection data powers personalized suggestions.
- Recommendations → Home: drives · Recommendation output populates the home for-you area.
- Watchlist store → Theme store: persists · Stores user preferences alongside collection state.
- TMDb API → Proxy client: wrapped by · Proxy layer is used to reach TMDb endpoints safely.
- Proxy client → Details: supplies · Movie details page consumes external metadata and media.
- Proxy client → Search: supplies · Search page consumes movie browse and query data.
- Proxy client → Home: supplies · Home page consumes featured and discovery data.
- UX states → Home: supports · Async and empty states are shared across screens.
- UX states → Search: supports · Async and empty states are shared across screens.
- UX states → Details: supports · Async and empty states are shared across screens.
- SPA hosting → App shell: enables · Static host rewrites support client-side routing.