A modern streaming platform built with SvelteKit that offers a seamless experience for watching embedded content. Features a rich user interface, comprehensive media management, and social features.
- TMDB API integration for extensive movie and TV show data
- Multiple provider support (VidSrc, VidSrc Pro, Embed.su)
- Advanced search with genre, year, and rating filters
- User authentication
- Watchlist
- Rich comment system with replies, mentions, and emoji support
- Comment moderation and reporting
- Server-side rendering (SSR)
- Image optimization and caching
- Rate limiting and Captcha protection
- Password reset functionality (WIP)
- SvelteKit 2.0 with TypeScript
- TailwindCSS
- Tiptap (Rich text editor)
- Emoji Mart
- Prisma ORM with MySQL
- JWT Authentication
- Sharp for image optimization
streamium/
βββ src/
β βββ lib/ # Components, services, stores
β βββ routes/ # SvelteKit routes and API
β βββ app.html # App template
βββ prisma/
β βββ schema.prisma # Database schema
βββ static/ # Static assets
You can run this project either using Docker (recommended) or manual setup.
-
Install WSL2:
# Run in PowerShell as Administrator wsl --install
- Restart your computer when prompted
- After restart, a Ubuntu terminal will open to set up your Ubuntu username and password
- If it doesn't open automatically, search for "Ubuntu" in the Start menu
-
Install Docker in WSL2 (Recommended):
# Update package list and install prerequisites sudo apt update sudo apt install -y ca-certificates curl gnupg lsb-release # Add Docker's official GPG key sudo mkdir -m 0755 -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg # Add Docker repository echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null # Install Docker sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin # Add your user to docker group (to run docker without sudo) sudo usermod -aG docker $USER # Apply group changes (alternatively, you can log out and back in) newgrp docker
Alternative: If you prefer a GUI, you can install Docker Desktop:
- Download Docker Desktop for Windows
- Run the installer (keep all default options)
- In Docker Desktop settings, enable WSL2 integration
-
Set up Git (in Ubuntu terminal):
git config --global core.autocrlf false git config --global user.name "Your Name" git config --global user.email "[email protected]"
-
Clone and Set up the Project:
# Go to your home directory in WSL cd ~ # Clone the repository git clone https://github.com/gmonarque/streamium.git cd streamium # Copy environment file cp .env.example .env
-
Configure Environment:
- Get your TMDB API key from https://www.themoviedb.org/settings/api
- Open .env in a text editor:
nano .env
- Update the TMDB_API_KEY value
- Save the file (Ctrl+X, then Y, then Enter)
-
Start the Application:
# Build and start containers docker compose up -d # Wait about 30 seconds for MySQL to initialize, then run: docker compose exec web npx prisma migrate dev
-
Access the Application:
- Open http://localhost:5173 in your browser
- The application should now be running
-
Useful Commands:
# View logs docker compose logs -f # Stop the application docker compose down # Completely reset (including database) docker compose down -v
-
Install Docker and Docker Compose on your system
-
Copy the example environment file:
cp .env.example .env
-
Update the .env file with your TMDB API key (get from https://www.themoviedb.org/settings/api)
-
Build and start the containers:
docker compose build
docker compose up (-d for detached)
- Wait for the services to fully start (you should see "ready for connections" in the MySQL logs), then in a new terminal, run the database migrations:
docker compose exec web npx prisma migrate dev
The application will be available at http://localhost:5173
Note: If you encounter any migration issues:
- Clean up the environment completely:
# Stop and remove containers, volumes, and networks
docker compose down -v
# Remove any Docker volumes that might persist
docker volume rm streamium_mysql_data
- Start the services again:
docker compose up
- Wait for MySQL to initialize (you should see "MySQL Server - ready for connections" in the logs), then run migrations:
docker compose exec web npx prisma migrate dev
If you still encounter issues, you can check the MySQL logs:
docker compose logs db
To stop the services:
docker compose down
To completely reset (including database):
docker compose down -v
npm install
(Setting up a database is not necessary if you only want to launch streamium locally and watch content)
- Install MySQL if not already installed:
# Ubuntu/Debian
sudo apt install mysql-server
# macOS with Homebrew
brew install mysql
- Start MySQL service:
# Ubuntu/Debian
sudo systemctl start mysql
# macOS
brew services start mysql
- Create database and user:
# Log into MySQL as root
sudo mysql
# Create database and user (in MySQL prompt)
CREATE DATABASE streamium;
CREATE USER 'streamium'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON streamium.* TO 'streamium'@'localhost';
FLUSH PRIVILEGES;
exit;
- Copy the example environment file:
cp .env.example .env
- Update the .env file with your settings:
# Database - update with your MySQL credentials
DATABASE_URL="mysql://user:password@localhost:port/db"
# Authentication - generate a secure random string
JWT_SECRET="your-jwt-secret"
# TMDB API - get from https://www.themoviedb.org/settings/api
TMDB_API_KEY="your-tmdb-api-key"
TMDB_API_URL="https://api.themoviedb.org/3"
# Streaming Providers
VIDSRC_BASE_URL="https://vidsrc.cc/v2/embed"
VIDSRC_PRO_BASE_URL="https://vidsrc.pro/embed"
EMBEDSU_BASE_URL="https://embed.su/embed"
- Generate Prisma Client:
npx prisma generate
- Run migrations to create database tables:
npx prisma migrate dev
- (Optional) Create an admin user:
# Log into MySQL
mysql -u streamium -pstreamium123 streamium
# Create admin user (in MySQL prompt)
INSERT INTO users (username, email, passwordHash, isAdmin, createdAt, updatedAt)
VALUES ('admin', '[email protected]', '$2b$10$BK2yg8osv06HgfAiUoKQhu4zHNY5svt.uBuovXWBuM5JyPYkYZxlO', true, NOW(), NOW());
exit;
# Default admin password is 'admin123', generate a new one with bcrypt.
npm run dev
The application will be available at http://localhost:5173
-
If Docker commands fail with "permission denied":
- Check that you're using WSL2 (not WSL1):
wsl --status
- Verify Docker service is running:
sudo service docker status # If not running, start it: sudo service docker start
- Ensure your user is in the docker group:
groups # If docker group is missing: sudo usermod -aG docker $USER newgrp docker
-
If you experience slow performance:
- Store the project in WSL filesystem instead of Windows filesystem
- Avoid running Docker commands from Windows CMD/PowerShell
- Use WSL terminal for all Docker operations
-
If port conflicts occur:
- Check if Windows services are using the ports:
# Run in PowerShell as Administrator netstat -ano | findstr "3306" netstat -ano | findstr "5173"
- Stop conflicting services or change ports in docker-compose.yml
-
If line endings cause issues:
- Configure Git to use LF instead of CRLF:
git config --global core.autocrlf false
- Re-clone the repository if needed
-
If you get MySQL connection errors:
- Verify MySQL is running:
sudo systemctl status mysql
- Check credentials in .env file
- Ensure database exists:
mysql -u user -ppassword -e "SHOW DATABASES;"
- Verify MySQL is running:
-
If Prisma migration fails:
- Check DATABASE_URL in .env
- Try resetting database:
npx prisma migrate reset
- Check Prisma logs:
npx prisma migrate status
This project is licensed under the MIT License.
This project is provided strictly for research and educational purposes only. By using this software:
- You acknowledge that this is a research project and agree to use it in compliance with all applicable local, state, and federal laws.
- You understand that the author(s) provide this code "as is" without warranty of any kind, express or implied.
- You accept full responsibility for any use, misuse, or illegal use of this software.
- You agree that the author(s) cannot be held liable for any damages, legal issues, or consequences arising from the use of this software.
- You acknowledge that this project does not include, distribute, or promote any copyrighted or unlawful material.
- You understand that streaming copyrighted content without proper authorization may be illegal in your jurisdiction.
- You agree to use this software only with properly licensed and authorized content in accordance with your local laws.
The purpose of this project is to demonstrate modern web development techniques and architectures. Any actions and/or activities related to the material contained within this project is solely your responsibility.