Bouflix Docs

๐ŸŽฌ Bouflix โ€” Movies & TV Shows

A premium, full-stack streaming platform with an Android app and a powerful admin panel.

Next.js 16 Kotlin Jetpack Compose MySQL Firebase Auth Stripe

What's Included

๐Ÿ“ฑ Android App

Beautiful Jetpack Compose UI with built-in mpv player, subtitle support, background playback, PiP mode, multi-language (EN/AR), Google Sign-In, and subscription billing.

๐Ÿ–ฅ๏ธ Admin Panel

Full dashboard to manage movies, TV shows, episodes, streaming sources, slideshows, users, subscriptions, ads, and all app settings โ€” powered by Next.js + Prisma + MySQL.

๐Ÿ”’ License Protection

Built-in CodeCanyon license verification system with multi-layer protection (server-side + encrypted device storage).

๐Ÿ’ฐ Monetization Ready

AdMob, AppLovin MAX, Meta Audience Network, Stripe checkout, and Google Play Billing โ€” all configurable from the dashboard.

Features

๐ŸŽฌ TMDB Integration
๐Ÿ” Search Movies, TV, People
๐Ÿ“บ Season & Episode Management
๐ŸŽฏ Multiple Stream Sources
๐ŸŒ Embed Source Extraction
๐Ÿ–ฅ๏ธ Built-in mpv Video Player
๐Ÿ“ฑ Picture-in-Picture
๐Ÿ”Š Background Playback
๐Ÿ“ Subtitle Support (OpenSubtitles)
๐ŸŽจ Material 3 Dark Theme
๐ŸŒ Multi-language (EN / AR)
๐Ÿ‘ค User Auth (Email + Google)
๐Ÿ’ณ Stripe Subscriptions
๐Ÿ›’ Google Play Billing
๐Ÿ“ข AdMob / AppLovin / Meta Ads
๐Ÿ–ผ๏ธ Customizable Slideshow
๐Ÿ‘ฅ Staff & Role Management
๐Ÿ” VPN / ADB / DevOptions Block
๐Ÿ“Š Dashboard Analytics
๐ŸŽŸ๏ธ Coupon System
๐Ÿ“œ Privacy Policy & ToS Editor

Requirements

Admin Panel (Server)

RequirementDetails
Node.jsv18+ (recommended v20 LTS)
MySQL8.0+ or MariaDB 10.5+
RAMMinimum 1 GB (2 GB recommended)
Disk500 MB+ free space
OSUbuntu 20.04+, CentOS 7+, or any cPanel hosting with Node.js

Android App (Development)

RequirementDetails
Android StudioLatest stable (Ladybug or newer)
JDK17
Compile SDK35 (Android 15)
Min SDK26 (Android 8.0)
GradleAGP 9.0+

Accounts Needed

ServiceWhyLink
TMDBMovie & TV database APIGet API Key
FirebaseGoogle Sign-In & AuthFirebase Console
StripeWeb subscriptions (optional)Stripe Dashboard
Google Play ConsolePublish app + in-app billingPlay Console
AdMobAds monetization (optional)AdMob

Admin Panel โ€” Database Setup

The Admin Panel uses MySQL via Prisma ORM. You need a MySQL database before deploying.

Option A: cPanel (Shared Hosting)

1

Create MySQL Database

In cPanel โ†’ MySQLยฎ Databases โ†’ create a new database (e.g. bouflix).

2

Create Database User

Create a user with a strong password and grant ALL PRIVILEGES on the database.

3

Note Your Credentials

Host: localhost
Database: your_cpanel_user_bouflix
Username: your_cpanel_user_dbuser
Password: your_password
Port: 3306

Option B: VPS / Dedicated Server

1

Install MySQL

sudo apt update
sudo apt install mysql-server -y
sudo mysql_secure_installation
2

Create Database & User

sudo mysql -u root -p

CREATE DATABASE bouflix CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'bouflix_user'@'localhost' IDENTIFIED BY 'StrongP@ssw0rd';
GRANT ALL PRIVILEGES ON bouflix.* TO 'bouflix_user'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Admin Panel โ€” Environment Configuration

Never share your .env file publicly. It contains sensitive credentials.

Rename .env.example to .env in the Admin Panel root, then fill in each variable:

VariableDescriptionExample
DATABASE_URLMySQL connection stringmysql://user:pass@localhost:3306/bouflix
JWT_SECRETRandom 32+ char string for auth tokensmy-super-secret-random-string-here-123
JWT_EXPIRES_INAccess token lifetime7d
JWT_REFRESH_EXPIRES_INRefresh token lifetime30d
TMDB_API_KEYYour TMDB API key55bd1c1e128ecf...
TMDB_BASE_URLTMDB API base (don't change)https://api.themoviedb.org/3
TMDB_IMAGE_BASE_URLTMDB images (don't change)https://image.tmdb.org/t/p
SUPER_ADMIN_EMAILEmail auto-promoted to superadminadmin@yoursite.com
STRIPE_SECRET_KEYStripe secret key (optional)sk_live_... or sk_test_...
NEXT_PUBLIC_BASE_URLPublic URL of your panelhttps://panel.yoursite.com
V1_HMAC_SECRETHMAC key for API signing (generate random 64-char hex)be44ce8449b504...
Generate a random JWT_SECRET:
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

Admin Panel โ€” Deploy on cPanel

Your cPanel host must support Node.js 18+. Check with your hosting provider.

Part 1 โ€” Extract the ZIP

1

Extract the downloaded ZIP

Right-click the Bouflix ZIP file and click Extract Here (or Extract filesโ€ฆ). You'll get a folder containing WebPanel inside.

Extract Bouflix ZIP

Part 2 โ€” Upload to cPanel File Manager

2

Open File Manager

In cPanel, click File Manager to open the file browser.

cPanel File Manager
3

Create a new folder

Click + Folder to create a new directory for the panel.

New Folder button
4

Name the folder

Enter the folder name (e.g. bouflix) and click Create New Folder.

Name the folder
5

Enter the new folder

Double-click the folder to open it.

Enter into folder
6

Upload the WebPanel ZIP

Click the Upload button in the top toolbar.

Upload button
7

Drag & drop the WebPanel ZIP

Before uploading, compress the WebPanel folder on your PC into a ZIP file (right-click โ†’ Send to โ†’ Compressed folder, or use 7-Zip/WinRAR). Then drag and drop the ZIP into the upload area.

Drag and drop ZIP
8

Go back when upload is complete

Wait for the upload to finish, then click the back link to return to the folder.

Upload complete
9

Extract the WebPanel ZIP

Right-click the uploaded ZIP file and click Extract. This will extract all files into the current directory.

Extract WebPanel ZIP

Part 3 โ€” Create MySQL Database

10

Open MySQL Databases

Go back to cPanel home and click MySQLยฎ Databases (or Manage My Databases).

Manage Databases
11

Create a new database

Enter a database name (e.g. bouflix_db) and click Create Database.

Create Database
12

Create a database user

Scroll down and create a new MySQL user with a strong password.

Create Database User
13

Add user to database

Link the user to the database you just created.

Add User to Database
14

Grant ALL PRIVILEGES

Check ALL PRIVILEGES and click Make Changes.

Grant Privileges

Part 4 โ€” Setup Node.js Application

15

Open Node.js App Manager

Go back to cPanel home โ†’ click Setup Node.js App.

Setup Node.js App
16

Create Application

Click CREATE APPLICATION.

Create Application
17

Fill out the form

Configure the application with these settings:

  • Node.js version: 18 or higher
  • Application mode: Production
  • Application root: path to your WebPanel folder (e.g. bouflix/WebPanel)
  • Application URL: your domain/subdomain
  • Application startup file: app.js

Click CREATE.

Fill out form and create
18

Run NPM Install

After creating the application, click Run NPM Install and wait for the dependencies to install.

Run NPM Install

Part 5 โ€” Run the Setup Wizard

19

Open your panel URL

Open the application URL in your browser. You'll be automatically redirected to the Setup Wizard.

Open your URL
20

Fill the database form & Install

Enter your MySQL credentials from Part 3 and set your admin email/password, then click Install Bouflix.

  • Host: localhost
  • Port: 3306
  • Database Name: your database name
  • Database Username: your database user
  • Database Password: your database password
  • Admin Email: your admin email
  • Admin Password: your desired password
This will create all database tables and your admin account automatically โ€” no SSH needed!
After installation, the application will automatically restart to apply the new database configuration. Wait a few seconds, then you'll be redirected to the login page.
Install Bouflix

Part 6 โ€” Login & Activate License

21

Sign in

After the automatic restart, you'll see the login page. Sign in with the admin email and password you created in Step 20.

Sign In
22

Enter your license & package name

After login, you'll be redirected to the License Activation page. Enter:

  • Envato Purchase Code: Your CodeCanyon purchase code (find it in CodeCanyon โ†’ Downloads โ†’ License certificate)
  • Android Package Name: Your app's package name from build.gradle.kts (e.g. com.bouflix.app)

Click Activate License.

Enter License
23

Done! ๐ŸŽ‰

You're now in the Bouflix Admin Panel dashboard. Your panel is fully set up and ready to use!

Dashboard

Admin Panel โ€” Deploy on VPS

1

Install Node.js

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs
node -v  # should show v20.x
2

Upload & Install

# Upload files via SCP/SFTP to /var/www/bouflix-panel
cd /var/www/bouflix-panel
npm install
3

Configure .env & Setup DB

cp .env.example .env
nano .env   # Fill in your credentials
npm run setup
npm run create-admin
4

Build Production

npm run build
5

Install PM2 & Start

sudo npm install -g pm2
pm2 start app.js --name bouflix-panel
pm2 save
pm2 startup  # auto-start on reboot
6

Nginx Reverse Proxy

sudo nano /etc/nginx/sites-available/bouflix

# Paste this config:
server {
    listen 80;
    server_name panel.yoursite.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_cache_bypass $http_upgrade;
    }
}

sudo ln -s /etc/nginx/sites-available/bouflix /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
7

SSL Certificate (Let's Encrypt)

sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginx -d panel.yoursite.com

Admin Panel โ€” Deploy on Vercel

Important: If using Vercel, you need an external MySQL database (e.g., PlanetScale, Railway, Aiven, or your own VPS). Vercel does not provide MySQL.
1

Push to Git

Push the Admin Panel to a GitHub/GitLab repository (exclude node_modules, .next, .env).

2

Import on Vercel

Go to vercel.com/new โ†’ Import your repo โ†’ Select the Admin Panel directory as root.

3

Environment Variables

In Vercel project settings โ†’ Environment Variables, add all variables from the .env configuration section.

4

Deploy

Vercel builds automatically. After deployment, run the setup commands via Vercel CLI or connect to your DB manually and run:

npx prisma db push --accept-data-loss
node create-admin.js

Admin Panel โ€” First Run

On cPanel, the Setup Wizard handles everything automatically (database tables, admin account, and license activation). On VPS/Vercel, the same wizard appears when you first open your panel URL.
1

Open your panel URL

Navigate to your panel URL in a browser. The Setup Wizard will appear automatically if the database hasn't been configured yet.

2

Database & Admin Setup

The wizard will ask for your MySQL credentials and let you create an admin account โ€” all from the browser. No SSH or terminal needed.

3

Login & Activate License

After setup, log in with your admin credentials. You'll be prompted to enter your CodeCanyon purchase code and Android package name to activate the license.

4

Post-Deploy Checklist

  • โœ… Go to Settings โ†’ API Keys and add your TMDB API key
  • โœ… Add your first movie or TV show from Content
  • โœ… Configure Slideshow for the app home screen
  • โœ… Set up Embed Sources for streaming
  • โœ… Configure V1_HMAC_SECRET in Settings for mobile app API security

Android App โ€” Prerequisites

ToolVersionDownload
Android StudioLatest stableDownload
JDK17Bundled with Android Studio
Android SDKAPI 35SDK Manager in Android Studio
1

Open the Project

Open the bouflix-Android Source folder in Android Studio. Wait for Gradle sync to complete.

2

Gradle Sync

If prompted, accept SDK licenses. Let Android Studio download all dependencies (first time may take 5-10 minutes).

Android App โ€” Change Package Name

Changing the package name is required before publishing. The default com.bouflix.app is a placeholder.
1

Open build.gradle.kts

In Android Studio, open app/build.gradle.kts. You'll see the default package name com.bouflix.app in both the namespace and applicationId fields.

2

Rename the package folder

In the Project panel (left side), expand app โ†’ src โ†’ main โ†’ java โ†’ com. Right-click the bouflix folder โ†’ Refactor โ†’ Rename.

Right-click bouflix folder โ†’ Refactor โ†’ Rename
3

Enter the new name

In the Rename dialog, type your new company/app name (e.g. bouflix1, netfinity, etc.). Make sure "Search for text occurrences" is checked, then click Refactor.

Rename dialog with new package name
4

Review and apply refactoring

Android Studio will show a Refactoring Preview with all affected files (imports, package declarations, references, etc.). Review the changes, then click Do Refactor.

This will automatically update all Kotlin files, imports, and references across the entire project โ€” no manual search needed.
Refactoring preview showing all affected files
5

Update namespace & applicationId

After the refactor, open app/build.gradle.kts and verify that both values match your new package name:

android {
    namespace = "com.yourcompany.app"  // โ† Must match your new package
    ...
    defaultConfig {
        applicationId = "com.yourcompany.app"  // โ† Must match your new package
        ...
    }
}

If Android Studio didn't update them automatically, change them manually.

Updated namespace and applicationId in build.gradle.kts
6

Set your Admin Panel URL

In the same build.gradle.kts file, scroll down to the Buyer Configuration section and set ADMIN_PANEL_URL to your deployed admin panel URL:

buildConfigField("String", "ADMIN_PANEL_URL", "\"https://your-panel-url.com/\"")
Make sure the URL starts with https:// and ends with a trailing slash /.
Setting ADMIN_PANEL_URL in build.gradle.kts
7

Update google-services.json & Rebuild

You must re-download google-services.json from Firebase after changing the package name (see Firebase Setup section).

Then rebuild the project:

Build โ†’ Clean Project
Build โ†’ Rebuild Project
If you see a yellow bar saying "Gradle files have changed...", click Sync Now before building.

Android App โ€” Firebase Setup

1

Create Firebase Project

Go to Firebase Console โ†’ Add Project โ†’ Name it (e.g., "MyStreamApp").

2

Add Android App

Click Add App โ†’ Android. Enter your new package name (e.g., com.yourcompany.yourapp).

3

SHA-1 Certificate

Required for Google Sign-In. Get it from Android Studio:

Gradle panel (right side) โ†’ app โ†’ Tasks โ†’ android โ†’ signingReport

Copy the SHA-1 value and paste it in Firebase.

4

Download google-services.json

Download the file and replace the existing one at:

app/google-services.json
5

Enable Authentication

In Firebase Console โ†’ Authentication โ†’ Sign-in method:

  • Enable Email/Password
  • Enable Google (add your Web Client ID)

Android App โ€” Connect to Admin Panel

The Android app fetches all configuration (TMDB keys, ads, settings) from your Admin Panel API at runtime.

The ADMIN_PANEL_URL is configured in Step 6 of the Change Package Name section. Make sure your URL is correct and accessible via HTTPS before building the app.

Android App โ€” App Icon & Splash

1

Change App Name

Open app/src/main/res/values/strings.xml and change:

<string name="app_name">YourAppName</string>
2

Replace App Icon

Right-click res โ†’ New โ†’ Image Asset. Select your icon image (512ร—512 recommended). Android Studio generates all density variants automatically.

3

Splash Screen

The splash uses Android 12+ Splash API. Customize in res/values/themes.xml under Theme.Bouflix: change windowSplashScreenBackground and windowSplashScreenAnimatedIcon.

Android App โ€” Ads Configuration

All ad unit IDs and settings are managed from the Admin Panel dashboard โ€” no need to hardcode anything in the app!
1

AdMob App ID

The only thing you need to update in the app code is the AdMob App ID in AndroidManifest.xml:

<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-XXXXXXXXXXXXXXXX~XXXXXXXXXX" />

Replace with your real AdMob App ID from admob.google.com.

2

Configure in Dashboard

Go to Admin Panel โ†’ Settings โ†’ Ads to set up:

  • Banner, Interstitial, Rewarded ad unit IDs
  • AppLovin MAX SDK Key & Unit IDs
  • Meta Audience Network Placement IDs
  • Ad frequency and placement rules

Android App โ€” Google Play Billing

1

Create Subscriptions in Play Console

In Google Play Console โ†’ Your App โ†’ Monetize โ†’ Products โ†’ Subscriptions. Create your plans (e.g., monthly, yearly) matching the plan IDs configured in the Admin Panel.

2

Configure in Admin Panel

Go to Settings โ†’ Subscriptions in the admin dashboard and set up matching plan IDs, prices, and features.

Android App โ€” Build APK / AAB

Debug APK (Testing)

1

In Android Studio: Build โ†’ Build Bundle(s) / APK(s) โ†’ Build APK(s)

Output: app/build/outputs/apk/debug/app-debug.apk

Signed Release APK/AAB (Production)

1

Generate Signing Key

In Android Studio: Build โ†’ Generate Signed Bundle / APK โ†’ Create new keystore:

  • Choose a safe location for the .jks file
  • Set a strong password
  • Fill in the certificate details
โš ๏ธ NEVER lose your keystore file! You cannot update your app on Play Store without it.
2

Build Release

Select APK or Android App Bundle (AAB) (recommended for Play Store). Choose release build variant.

Output locations:

APK: app/build/outputs/apk/release/app-release.apk
AAB: app/build/outputs/bundle/release/app-release.aab
Google Play Store requires AAB format. Use APK only for direct distribution outside Play Store.

Dashboard โ€” Content Management

Navigate to Content in the sidebar to manage movies and TV shows.

Adding a Movie

1

Click "Add Movie" โ†’ Search by TMDB title or ID โ†’ Select โ†’ The movie metadata (poster, overview, genres, etc.) is auto-filled from TMDB.

2

Add Streams โ€” click the streams tab and add direct video URLs or embed sources with quality/language tags.

3

Toggle Active to make it visible in the app.

Adding a TV Show

Same as movies, but after adding the show, you can manage Seasons โ†’ Episodes โ†’ Streams per episode.

Dashboard โ€” Embed Sources

Embed sources are global streaming providers that automatically generate stream URLs for all content using TMDB IDs.

1

Go to Settings โ†’ Sources

2

Add a source with:

  • Name: Display name
  • Movie URL: URL template with {tmdbId} placeholder
  • TV URL: URL template with {tmdbId}, {season}, {episode} placeholders
3

Drag & drop to reorder. The app tries sources in order until one works.

Dashboard โ€” Slideshow

Configure the home screen slideshow/banner from Slideshow in the sidebar.

Dashboard โ€” User Management

View and manage registered users from Users:

Dashboard โ€” Subscriptions

Configure subscription plans from Settings โ†’ Subscriptions:

Dashboard โ€” Ads Settings

All ad configuration is centralized in Settings โ†’ Ads:

Dashboard โ€” App Settings

Configure app behavior from Settings:

๐ŸŽฌ Content

Content mode, maintenance mode, force update

โ–ถ๏ธ Player

Default quality, autoplay, auto-resume

๐Ÿ”’ Security

Block VPN, ADB, developer options

๐ŸŒ Restrictions

Region blocking, auth requirements

๐Ÿ“ž Contact

Support email, Telegram link

๐Ÿ“œ Legal

Privacy Policy & Terms of Service editor

FAQ & Troubleshooting

Build fails with "Cannot find module '@prisma/client'"

Run npx prisma generate before building. The setup script does this automatically, but if you skipped it, run it manually.

App shows "Connection failed" on launch

Verify that ADMIN_PANEL_URL in build.gradle.kts points to your deployed Admin Panel and the URL is accessible with HTTPS.

Google Sign-In not working

Ensure you added the correct SHA-1 fingerprint in Firebase Console matching your signing key. For debug builds, use the debug SHA-1.

Streams not playing in the app

Check that embed sources are configured in the dashboard and the URLs are valid. Test the source URL directly in a browser first.

Database connection fails on cPanel

cPanel prefixes database names and users. Use the full prefixed name: cpaneluser_dbname and cpaneluser_dbuser.

"Prisma db push" fails with timeout

Your MySQL server may be slow or remote. Add ?connect_timeout=30 to your DATABASE_URL.

How to update the app later?

Replace the source files, keep your .env, google-services.json, and keystore. Run npm install && npm run build for the panel. For the app, just rebuild in Android Studio.

Changelog

v1.0 โ€” Initial Release

  • Full Android app with Jetpack Compose UI
  • Admin Panel with Next.js 16 + Prisma + MySQL
  • TMDB integration for movies & TV shows
  • Multi-language support (English + Arabic)
  • Subscription system (Stripe + Google Play Billing)
  • Ad monetization (AdMob, AppLovin, Meta)
  • Built-in mpv video player with subtitle support
  • License protection system

Support

Need Help?

If you have questions or need assistance, please reach out through CodeCanyon comments or our support channels.

๐Ÿ“ง Email: your-support@email.com

๐Ÿ’ฌ Telegram: @yourusername

Please include your purchase code when contacting support.