A web application where the owner can upload videos and users can stream them online. Built with Next.js, Supabase, and React.
- User authentication (sign up, sign in, sign out)
- Video upload for authenticated users
- Video browsing and streaming for all users
- Responsive design for all devices
- Protected routes for upload functionality
- Frontend: Next.js, React, Tailwind CSS
- Backend: Supabase (Authentication, Database, Storage)
- Video Player: React Player
- File Upload: React Dropzone
Before you begin, ensure you have:
- Node.js (v18 or newer)
- A Supabase account (free tier works fine)
git clone <repository-url>
cd video-stream-platformnpm install- Create a new project on Supabase
- Go to Project Settings > API and copy the URL and anon key
- Create a
.env.localfile in the root directory with:
NEXT_PUBLIC_SUPABASE_URL=your-supabase-url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
- Set up the database schema by running the SQL commands in
supabase-schema.sqlin the Supabase SQL Editor
npm run devOpen http://localhost:3000 with your browser to see the application.
- Push your code to a GitHub repository
- Go to Vercel and create a new project
- Import your GitHub repository
- Add the environment variables from your
.env.localfile:NEXT_PUBLIC_SUPABASE_URL: Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anonymous key
- Click "Deploy"
-
Create a GitHub Repository:
- Create a new repository on GitHub
- Push your local code to the repository:
git init git add . git commit -m "Initial commit" git branch -M main git remote add origin https://github.com/yourusername/your-repo-name.git git push -u origin main
-
Sign Up/Login to Vercel:
- Go to Vercel
- Sign up or log in with your GitHub account
-
Create a New Project:
- Click "Add New" > "Project"
- Select your GitHub repository
- Vercel will automatically detect that it's a Next.js project
-
Configure Project:
- In the "Configure Project" screen, expand "Environment Variables"
- Add the following environment variables:
NEXT_PUBLIC_SUPABASE_URL: Your Supabase project URLNEXT_PUBLIC_SUPABASE_ANON_KEY: Your Supabase anonymous key
- Keep the default settings for everything else
-
Deploy:
- Click "Deploy"
- Vercel will build and deploy your application
- Once deployed, you'll get a URL where your application is live
-
Custom Domain (Optional):
- In your project dashboard, go to "Settings" > "Domains"
- Add your custom domain and follow the instructions to set it up
- Netlify: Similar process to Vercel, with automatic deployments from Git
- AWS Amplify: Provides additional backend capabilities and easy integration with AWS services
- Digital Ocean App Platform: Simple deployment with scaling options
The application uses the following database schema:
id: UUID (Primary Key)title: Text (Required)description: Texturl: Text (Required)file_path: Text (Required)user_id: UUID (Foreign Key to auth.users)created_at: Timestampupdated_at: Timestamp
MIT