A full-stack Netflix-style streaming platform for discovering and watching movies & TV shows.```markdown
PrerequisitesCineScope is a full-stack web application that helps users discover, search, and explore movies and TV series from multiple platforms β all in one place.
-
Node.js 18+With real-time data fetching from the TMDB API, users can view trending titles, apply filters, manage watchlists, and add favorites β creating a personalized entertainment experience.
-
MongoDB (local or Atlas)
-
TMDB API Key (Get here)---
In the modern digital landscape, thousands of movies and TV shows release every year across platforms like Netflix, Amazon Prime, Disney+, and more.
# 1. Clone repository
git clone https://github.com/sarcaxticlarka/capstone3.git**CineScope** addresses this problem by providing:
cd capstone3- A single platform to **explore**, **search**, and **filter** entertainment content.
- Real-time updates and intelligent discovery powered by **TMDB API**.
# 2. Setup Server- User personalization features like **favorites** and **watchlists**.
cd server
npm install---
echo "MONGO_URI=your_mongodb_uri\nJWT_SECRET=your_secret_key\nPORT=5000" > .env
node src/index.js## ποΈ System Architecture
# 3. Setup Client (new terminal)### π Architecture Flow
cd client```
npm install
echo "TMDB_API_KEY=81f4065ed423ff304fb5c85d33617a83\nNEXT_PUBLIC_API_URL=http://localhost:5000" > .env.localNext.js (Frontend + Backend API Routes) β MongoDB β TMDB API
npm run dev
Visit: **http://localhost:3000**### βοΈ Stack Overview
| Layer | Description |
---|-------|--------------|
| Frontend | Next.js (App Router) with dynamic routing and server-side rendering |
| Database | MongoDB (storing user accounts, favorites, and watchlists) |
-
π User Authentication - JWT-based login/signup with protected routes| Hosting | Vercel (frontend + backend) + MongoDB Atlas (database) |
-
π¬ Continue Watching - Auto-tracked watch history with resume functionality| External API | TMDB (The Movie Database) API |
-
β€οΈ Favorites & Watchlist - Save and manage your content
-
π Smart Search - Debounced search (500ms) with infinite scroll---
-
π± Fully Responsive - Mobile-first design with TailwindCSS
-
π₯ 9 Categorized Sections: Trending, New Releases, Emotional/Drama, Romantic, Blockbusters, Hollywood Action, Bollywood, New Series, Popular TV| Category | Features |
-
π― Genre Filtering - Dropdown with 20+ genres|-----------|-----------|
-
πΊ Movies & TV Shows - Dedicated pages for each| Authentication & Authorization | JWT-based user registration, login, logout; secure protected pages for watchlist & favorites |
-
π₯ Embedded Player - Watch content directly via vidsrc| Dynamic Data Fetching | Real-time data fetching with SWR caching for optimal performance |
| Searching | Live search with debounced input (500ms) and infinite scroll pagination |
Performance| Sorting & Filtering | Genre dropdown, region filters, language filters, sort by popularity/rating/release date |
-
β‘ SWR Caching - 60% reduction in API calls| Categorized Sections | 9+ horizontal scroll sections: Trending, New Releases, Emotional/Drama, Romantic, Blockbusters, South Indian, Hollywood, Bollywood, New Series |
-
π Infinite Scroll - Seamless pagination| Pagination | Infinite scroll with intersection observer (no manual pagination needed) |
-
π¨ Loading Skeletons - Better perceived performance| CRUD Operations | Add/remove items in watchlist and favorites with optimistic updates |
-
π¨ Optimized Rendering - Fast page loads with Next.js| Frontend Routing | Pages:
/,/login,/register,/search,/movie/[id],/tv/[id],/profile,/category,/player/[type]/[id]|
| Responsive UI | Fully responsive using TailwindCSS with loading skeletons for better UX |
---| Performance | SWR caching reduces API calls by ~60%, debounced search, optimized rendering |
| Player Integration | Embedded vidsrc player for movies and TV shows |
| Hosting | Deployed on Vercel for full-stack functionality |
| Layer | Technology |
|-------|-----------|---
| Frontend | Next.js 16, React 19, TailwindCSS v4 |
| Backend | Express.js, Next.js API Routes |## π» Tech Stack
| Database | MongoDB + Mongoose |
| Auth | JWT (7-day expiry) || Layer | Technologies |
| API | TMDB API ||--------|---------------|
| Caching | SWR || Frontend | Next.js (App Router), TailwindCSS, SWR (data fetching & caching), React Intersection Observer |
| Deployment | Vercel (client), Render (server) || Backend (API Routes) | Next.js API Routes, bcrypt for password hashing, Express.js (standalone server) |
| Database | MongoDB with Mongoose |
---| Authentication | JWT (JSON Web Token) |
| External API | TMDB (The Movie Database) API |
capstone3/
βββ client/ # Next.js frontend## π API Overview
β βββ app/ # App router pages
β β βββ landing/ # Home page| Endpoint | Method | Description | Access |
β β βββ movie/[id]/ # Movie details|-----------|---------|-------------|---------|
β β βββ tv/[id]/ # TV show details| `/api/auth/signup` | **POST** | Register new user and store credentials in MongoDB | Public |
β β βββ player/ # Video player| `/api/auth/login` | **POST** | Authenticate user and return JWT token | Public |
β β βββ profile/ # User profile| `/api/movies/trending` | **GET** | Fetch trending movies/series from TMDB | Authenticated |
β β βββ search/ # Search results| `/api/movies/search` | **GET** | Search movies by title query | Authenticated |
β β βββ api/tmdb/ # TMDB proxy routes| `/api/movies/:id` | **GET** | Fetch detailed movie/series info | Authenticated |
β βββ components/ # React components| `/api/user/favorites` | **GET** | Fetch userβs favorite list | Authenticated |
β βββ .env.local # Environment variables| `/api/user/favorites` | **POST** | Add a movie/series to favorites | Authenticated |
β| `/api/user/favorites/:id` | **DELETE** | Remove movie/series from favorites | Authenticated |
βββ server/ # Express backend| `/api/user/watchlist` | **GET** | Get userβs watchlist | Authenticated |
βββ src/| `/api/user/watchlist` | **POST** | Add movie/series to watchlist | Authenticated |
β βββ models/ # Mongoose schemas| `/api/user/watchlist/:id` | **DELETE** | Remove movie/series from watchlist | Authenticated |
β βββ routes/ # API endpoints
β βββ index.js # Server entry---
βββ .env # Server config
```## π Hosting
- **Frontend + Backend:** [Vercel](https://capstone3-lemon.vercel.app/)
---- **Backend:** [Render](https://capstone3-6ywq.onrender.com)
- **External API:** [TMDB API](https://www.themoviedb.org/documentation/api)
## π API Endpoints
---
### Authentication
- `POST /api/auth/signup` - Register user
- `POST /api/auth/login` - Login user---
### User Data (Protected)## π§ Future Enhancements
- `GET /api/user/favorites` - Get favorites- AI-based movie recommendations
- `POST /api/user/favorites` - Add to favorites- Multi-language support
- `DELETE /api/user/favorites/:id` - Remove favorite- Advanced watch history tracking
- `GET /api/user/watchlist` - Get watchlist- User reviews and ratings
- `POST /api/user/watchlist` - Add to watchlist
- `DELETE /api/user/watchlist/:id` - Remove from watchlist---
- `GET /api/user/watch-history` - Get watch history
- `POST /api/user/watch-history` - Track watched content## π¨βπ» Author
**Md Sajjan**
### TMDB Proxy
- `GET /api/tmdb/trending` - Trending content---
- `GET /api/tmdb/search` - Search movies/TV
- `GET /api/tmdb/movie/:id` - Movie details
- `GET /api/tmdb/tv/:id` - TV show details
- `GET /api/tmdb/genres` - Genre list
- `GET /api/tmdb/discover` - Filtered discovery
---
## π― Key Pages
| Route | Description |
|-------|-------------|
| `/` | Landing page with hero banner & categories |
| `/login` | User login |
| `/register` | User registration |
| `/films` | Browse all movies |
| `/TV-Shows` | Browse all TV shows |
| `/search` | Search results with infinite scroll |
| `/movie/[id]` | Movie detail page |
| `/tv/[id]` | TV show detail page |
| `/player/[type]/[id]` | Video player |
| `/profile` | User profile with history/favorites/watchlist |
| `/category` | Filtered category view |
---
## π§ͺ Testing
```bash
# Client tests
cd client
npm test
# Server tests
cd server
npm test
cd client
vercel --prod- Connect GitHub repository
- Set environment variables:
MONGO_URIJWT_SECRETPORT=5000
- Deploy
- Automatically tracks watched content
- Shows on home page for logged-in users
- Click to resume watching
- Real-time search with debouncing
- Infinite scroll pagination
- Genre-based filtering
- Sort by popularity, rating, date
- Recently watched (with dates)
- Favorites collection
- Watchlist management
- One-click remove buttons
- Embedded vidsrc player
- Auto-tracks to watch history
- Fullscreen support
- Works for movies & TV shows
- Passwords hashed with bcrypt
- JWT tokens with 7-day expiry
- Protected API routes
- Environment variables for secrets
- CORS enabled for API
- SWR Caching: ~60% reduction in API calls
- First Load: < 2s (with fast 3G)
- Infinite Scroll: Smooth 60fps
- Lighthouse Score: 90+ (Performance)
- Frontend + Backend: Vercel
---- Backend: Render
Md Sajjan
GitHub: @sarcaxticlarka
MIT License - feel free to use this project for learning!
β Star this repo if you found it helpful!