This guide will walk you through setting up the Stream Monitoring application on your local machine.
Before starting, ensure you have the following installed:
- Git
- Python 3.10+
- Node.js and npm
- A Google account (for YouTube API)
- A Supabase account
git clone https://github.com/ZyrusAlvez/Stream-Monitoring.git
cd Stream-Monitoringcd backendCreate a .env file in the backend folder with these exact variable names:
YOUTUBE_API_KEY=your_youtube_api_key_here
SUPABASE_URL=your_supabase_url_here
SUPABASE_KEY=your_supabase_key_herepip install -r requirements.txtAfter installing the Python dependencies, you also need to install Playwright:
playwright install
⚠️ Don't start the server yet - we need to configure everything first!
cd Stream-Monitoring/frontendCreate a .env file in the frontend folder with these exact variable names:
VITE_SUPABASE_URL=your_supabase_url_here
VITE_SUPABASE_KEY=your_supabase_key_here
VITE_BACKEND_URL=http://localhost:8000npm install
⚠️ Don't start the server yet - we need to set up the database and APIs first!
- Go to Google Cloud Console
- Sign in with your Google account
- Click Select a project (top bar) → New Project
- Enter a project name and click Create
- Ensure your new project is selected (check top bar)
- Navigate to APIs & Services → Library (left menu)
- Search for YouTube Data API v3
- Click on it and press Enable
- Go to APIs & Services → Credentials
- Click Create Credentials → API Key
- Copy the generated API key
- Update
YOUTUBE_API_KEYin your backend.envfile
- Visit Supabase Dashboard
- Sign in and click New Project
- Fill in:
- Project name
- Database password
- Region
- Click Create new project
- In your project dashboard, go to SQL Editor (left sidebar)
- Copy the following SQL script and paste it into the editor:
CREATE TABLE public."CustomSourceLogs" (
log_id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
status TEXT,
timestamp TEXT,
error TEXT,
type TEXT
);
CREATE TABLE public."Folder" (
folder_id UUID NOT NULL DEFAULT gen_random_uuid() PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
url TEXT,
name TEXT,
type TEXT,
ongoing BOOLEAN DEFAULT true,
repetition BIGINT,
interval BIGINT,
start_time TEXT,
next_call_time TEXT
);
CREATE TABLE public."Logs" (
log_id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
folder_id UUID NOT NULL,
status TEXT,
timestamp TEXT,
url TEXT,
error TEXT,
CONSTRAINT Logs_folder_id_fkey FOREIGN KEY (folder_id) REFERENCES public."Folder" (folder_id) ON UPDATE CASCADE ON DELETE CASCADE
);
CREATE TABLE public."YoutubeChannelLogs" (
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
status TEXT,
error TEXT,
log_id BIGINT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
folder_id UUID,
results JSONB,
timestamp TEXT,
CONSTRAINT YoutubeChannelLogs_folder_id_fkey FOREIGN KEY (folder_id) REFERENCES public."Folder" (folder_id) ON UPDATE CASCADE ON DELETE CASCADE
);- Click RUN to execute the script
- Verify tables were created in Table Editor → Tables
- Go to Storage and click on the New Bucket
- Enter bucket name "screenshots" and click create
- In Supabase dashboard, click Authentication (left sidebar)
- Go to Users tab
- Click Add User → Create new user
- Enter your preferred email and password
- Important: Remember both the email AND password - the password will be used for authentication when logging into the app
- Open
frontend/src/pages/Login.tsx - Find line 15 with the
emailvariable:
const email = 'zyrusalvez13@gmail.com';- Replace the email address with the one you created in Step 4
- In your Supabase project dashboard, click Connect (upper middle)
- Select App frameworks
- Copy the Project URL and anon/public key
- Update both
.envfiles:- Backend: Set
SUPABASE_URLandSUPABASE_KEY - Frontend: Set
VITE_SUPABASE_URLandVITE_SUPABASE_KEY
- Backend: Set
Now that everything is configured, you can start the servers!
Open a terminal and navigate to the backend directory:
cd Stream-Monitoring/backend
uvicorn main:app --reload✅ Backend should now be running on http://localhost:8000
Open a new terminal and navigate to the frontend directory:
cd Stream-Monitoring/frontend
npm run dev✅ Frontend should now be running on http://localhost:5173
If everything is set up correctly:
- Backend: Running on http://localhost:8000
- Frontend: Running on http://localhost:5173
- Database: Tables created and accessible
- Authentication: User account ready
- YouTube API: Enabled and key configured
You can now access your application at http://localhost:5173 and log in with the email and password you configured in Step 6!
Backend won't start?
- Check if Python dependencies are installed
- Ensure Playwright is installed (
playwright install) - Verify
.envfile has correct variable names - Ensure port 8000 is available
- Make sure all environment variables are filled in
Frontend won't start?
- Check if Node.js and npm are installed
- Verify
.envfile has correct variable names withVITE_prefix - Run
npm installagain if needed - Ensure port 5173 is available
API errors?
- Verify YouTube API key is valid and API is enabled
- Check Supabase URL and keys are correct
- Ensure database tables were created successfully
Authentication issues?
- Make sure you updated the email in
Login.tsx - Verify the user exists in Supabase Authentication
- Use the password you set when creating the user account in Step 6
- Check that Supabase keys are correctly set
If you encounter issues, please check:
- All environment variables are correctly named and filled
- All dependencies are installed (including Playwright)
- Ports 8000 and 5173 are available
- YouTube API and Supabase services are properly configured
- Database tables are created
- User account exists in Supabase with the correct email and password