A full-stack video streaming platform built with React, Node.js, Express, and MongoDB. Features include user authentication, TMDB-powered video imports, Vidking player integration, and a modern, responsive UI.
- Admin Bootstrapping: The first user to register automatically becomes an Admin.
- User registration and login with JWT tokens.
- Role-based access control (User/Admin).
- Secure password hashing with bcrypt.
- Protected routes and API endpoints.
- Profile editing (name, email, avatar).
- Avatar upload (file or URL).
- Personal watchlist functionality.
- Real-time profile updates.
- TMDB Integration: Search and import movies and TV shows directly from The Movie Database (TMDB).
- Vidking Player: Seamless integration with Vidking for high-quality video embedding.
- Automatic metadata fetching (posters, backdrops, descriptions, ratings).
- Video deletion with full cleanup.
- Clear Cache: Admin tool to clear local storage and sync with the backend.
- Centered Search Bar: Modern, accessible search bar centered in the header.
- Real-time Search: Instant search results with a dropdown preview.
- Responsive design optimized for mobile, tablet, and desktop.
- Premium aesthetics with glassmorphism and smooth transitions.
- MongoDB with Mongoose ODM.
- Real-time synchronization.
- Efficient querying with pagination.
- Node.js (v16 or higher)
- MongoDB (local or Atlas)
- TMDB API Key (Get one at themoviedb.org)
- npm or yarn
- Clone the repository
git clone https://github.com/pratham-prog861/StreamFlix.git
cd streamflix- Setup Backend
cd server
npm installCreate .env file:
copy .env.example .env # Windows
cp .env.example .env # macOS/LinuxEdit .env:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/streamflix
JWT_SECRET=your_super_secret_jwt_key
TMDB_API_KEY=your_tmdb_api_key_here
CLIENT_URL=http://localhost:3000- Setup Frontend
cd ../client
npm install- Run the Application
Terminal 1 - Backend:
cd server
npm run devTerminal 2 - Frontend:
cd client
npm run devStreamFlix features Automatic Admin Bootstrapping. The very first account registered on the platform will be granted the admin role automatically.
- Go to the Register page.
- Create your account.
- You will now have access to the Admin tab in the header.
streamflix/
βββ client/ # React Frontend
β βββ components/ # Reusable UI components
β β βββ Header.tsx # Navigation header (Centered Search)
β β βββ SearchInput.tsx # Real-time search component
β β βββ ...
β βββ context/ # React Context API
β β βββ AuthContext.tsx # Authentication state
β β βββ VideoContext.tsx # Video state (Real data only)
β βββ pages/ # Page components
β β βββ HomePage.tsx # Landing page (Empty state handled)
β β βββ AdminPage.tsx # TMDB Import & Cache Management
β β βββ ...
β βββ ...
βββ server/ # Node.js Backend
β βββ models/ # Mongoose models
β β βββ User.js # User schema with roles
β β βββ Video.js # Video schema with TMDB support
β βββ routes/ # API routes
β β βββ auth.js # Auth with bootstrapping & logs
β β βββ video.js # Video search & import logic
β βββ ...
βββ README.md| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/auth/register |
Register new user | Public |
| POST | /api/auth/login |
Login user | Public |
| GET | /api/auth/me |
Get current user | Protected |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/videos |
Get all videos (paginated) | Public |
| GET | /api/videos/search-tmdb |
Search TMDB for content | Admin |
| POST | /api/videos/import |
Import video from TMDB | Admin |
| DELETE | /api/videos/:id |
Delete video | Admin |
StreamFlix uses a streamlined import system:
- Search: Admins search for movies or TV shows using the TMDB API.
- Import: One-click import fetches all metadata and sets up the Vidking embed.
- Sync: The frontend immediately refreshes to show the new content.
- React 19 & TypeScript
- Vite (Build Tool)
- Tailwind CSS (Styling)
- Context API (State Management)
- Node.js & Express
- MongoDB & Mongoose
- JWT (Authentication)
- TMDB API (Content Discovery)
- Fork the repository.
- Create a feature branch.
- Commit your changes.
- Open a Pull Request.
This project is licensed under the ISC License.
Built with β€οΈ by Pratham Darji