How dinuradamsara99/cinemanest-automated works
This repository is a Next.js movie and TV streaming catalog. A viewer can browse catalog pages, open a title, and use its watch-page player and related features; the sampled watch route shows catalog data being fetched before the client watch experience is rendered. Separate branches support comments, AI insights, watch progress, user requests, and automated content ingestion. The source index identifies these capabilities, but several route and component bodies were not sampled, so their internal connections are omitted where not evidenced.
Main entry points: pipeline.ts Ingestion pipeline · WatchPageClient.tsx Watch experience · auth.ts Authentication · rate-limiter.ts Rate limiting
Components 34
Catalog browsing
- Catalog pages
app/(main)/(home)/page.tsx - Category and language
app/category/[slug]/page.tsx - Search API
app/api/search/route.ts - Catalog queries
lib/sanity.ts - Content grid
components/ContentGrid.tsx - Media cards
components/MediaCard.tsx
Viewing experience
- Watch route
app/(main)/watch/[slug]/page.tsx - Watch experience
components/WatchPageClient.tsx - Video player
components/CustomVideoPlayer.tsx - Video resolver
lib/video-resolver.ts - Resolve video API
app/api/resolve-video/route.ts - Subtitle downloads
components/SubtitleDownload.tsx
Viewer features
- Comments
components/CommentSection.tsx - Comments API
app/api/comments/route.ts - Comment queries
lib/queries/comments.ts - AI insights
components/VideoAIInsights.tsx - AI insights API
app/api/ai-insights/route.ts - Watch progress API
app/api/watch-progress/route.ts - Request API
app/api/request/route.ts - Request actions
app/actions/movie-request.ts
Content operations
- Scrape automation
app/api/cron/scrape-movies/route.ts - Ingestion pipeline
lib/automation/pipeline.ts - Movie scraper
lib/automation/scraper.ts - Link validation
lib/automation/link-validator.ts - TMDB enrichment
lib/automation/tmdb-enricher.ts - Description generation
lib/automation/ai-generator.ts - Sanity publishing
lib/automation/sanity-publisher.ts - Sanity CMS
sanity/lib/client.ts
Identity and safeguards
- Authentication
lib/auth.ts - User database
lib/prisma.ts - Security utilities
lib/security.ts - Rate limiting
lib/rate-limiter.ts - Upstash Redis
Other components
- Viewer
Connections 37
- Viewer → Catalog pages: browses
- Catalog pages → Catalog queries: fetches content
- Category and language → Catalog queries: fetches content
app/category/[slug]/page.tsx - Category and language → Content grid: renders
app/category/[slug]/page.tsx - Category and language → Media cards: renders
app/category/[slug]/page.tsx - Search API → Catalog queries: searches
app/api/search/route.ts - Viewer → Watch route: opens title
- Watch route → Catalog queries: fetches title
app/(main)/watch/[slug]/page.tsx - Watch route → Watch experience: renders
app/(main)/watch/[slug]/page.tsx - Watch experience → Video player: renders
components/WatchPageClient.tsx - Watch experience → Subtitle downloads: renders
components/WatchPageClient.tsx - Watch experience → Comments: renders
components/WatchPageClient.tsx - Watch experience → AI insights: renders
components/WatchPageClient.tsx - Resolve video API → Video resolver: resolves stream
app/api/resolve-video/route.ts - Comments → Comments API: loads and posts
- Comments API → Comment queries: uses queries
- Comments API → Rate limiting: limits requests
app/api/comments/route.ts - AI insights → AI insights API: requests insights
- AI insights API → Authentication: checks session
app/api/ai-insights/route.ts - AI insights API → Security utilities: verifies and sanitizes
app/api/ai-insights/route.ts - AI insights API → Rate limiting: limits requests
app/api/ai-insights/route.ts - Watch progress API → Authentication: checks session
app/api/watch-progress/route.ts - Request API → Authentication: checks session
app/api/request/route.ts - Request API → Security utilities: validates input
app/api/request/route.ts - Request API → Rate limiting: limits requests
app/api/request/route.ts - Request API → Sanity CMS: submits request
app/api/request/route.ts - Scrape automation → Ingestion pipeline: starts pipeline
- Ingestion pipeline → Movie scraper: scrapes titles
lib/automation/pipeline.ts - Ingestion pipeline → Link validation: validates links
lib/automation/pipeline.ts - Ingestion pipeline → TMDB enrichment: enriches titles
lib/automation/pipeline.ts - Ingestion pipeline → Description generation: generates descriptions
lib/automation/pipeline.ts - Ingestion pipeline → Sanity publishing: publishes titles
lib/automation/pipeline.ts - Sanity publishing → Sanity CMS: writes content
- Authentication → User database: reads user data
lib/auth.ts - Authentication → Security utilities: logs auth events
lib/auth.ts - Rate limiting → Security utilities: gets client IP
lib/rate-limiter.ts - Rate limiting → Upstash Redis: uses when configured
lib/rate-limiter.ts