4.2 KiB
4.2 KiB
MultiChat Overlay - Setup and Testing Instructions
This document provides instructions to set up and test the MultiChat Overlay application.
1. MySQL Database Setup
- Install MySQL: Ensure you have MySQL server installed and running on your system.
- Create Database: Log in to your MySQL server and create a new database.
CREATE DATABASE multichat_overlay; - Create User (Optional but Recommended): Create a dedicated MySQL user for the application and grant it privileges to the
multichat_overlaydatabase.CREATE USER 'multichat_user'@'localhost' IDENTIFIED BY 'your_secure_password'; GRANT ALL PRIVILEGES ON multichat_overlay.* TO 'multichat_user'@'localhost'; FLUSH PRIVILEGES; - Update
php/config.php: Open/home/joe/MultiChatOverlay/php/config.phpand update theDB_USERandDB_PASSconstants with your MySQL credentials.
2. PHP Development Server Setup
- Install PHP: Ensure you have PHP installed on your system (PHP 7.4+ recommended).
- Start Server: Navigate to the
/home/joe/MultiChatOverlay/phpdirectory in your terminal and start the PHP built-in web server:cd /home/joe/MultiChatOverlay/php php -S localhost:80 -t .- Note: The
-t .flag tells the server to use the current directory (php/) as the document root. This means your application will be accessible athttp://localhost/. - If port 80 is already in use, you can choose another port (e.g.,
php -S localhost:8000 -t .) and update theBASE_URLinphp/config.phpaccordingly.
- Note: The
3. Configure Twitch API Credentials
- Create Twitch Application: Go to the Twitch Developer Console (dev.twitch.tv/console/apps) and create a new application.
- Set the OAuth Redirect URLs to
http://localhost/auth.php(orhttp://localhost:PORT/auth.phpif you're using a different port for your PHP server).
- Set the OAuth Redirect URLs to
- Get Client ID and Secret: Note down your Client ID and generate a Client Secret.
- Update
php/config.php: Open/home/joe/MultiChatOverlay/php/config.phpand update theTWITCH_CLIENT_ID,TWITCH_CLIENT_SECRET, andTWITCH_REDIRECT_URIconstants with your application's credentials.
4. Test the Application
- Ensure PHP Server is Running: Make sure your PHP development server is running as described in step 2.
- Access Application: Open your web browser and navigate to
http://localhost/. - Login with Twitch:
- Click on "Get Started" or navigate to
http://localhost/login. - Click "Login with Twitch".
- You will be redirected to Twitch for authorization. Ensure you grant the requested permissions (
user:read:emailandchat:read). - You should then be redirected to the dashboard (
http://localhost/dashboard).
- Click on "Get Started" or navigate to
- Verify Dashboard:
- Check if your Twitch username is displayed.
- Verify that the "Twitch: Connected" status is shown.
- Note the "Your Overlay URL" – it should now contain your
user_id.
- Test Twitch Chat Listener (Manual):
- Open a new terminal.
- Navigate to the
/home/joe/MultiChatOverlaydirectory. - Activate your Python virtual environment:
source python/venv/bin/activate - Run the Twitch chat listener script, replacing placeholders with your actual values:
export TWITCH_CLIENT_ID="YOUR_TWITCH_CLIENT_ID" export TWITCH_CLIENT_SECRET="YOUR_TWITCH_CLIENT_SECRET" python python/twitch_chat_listener.py "YOUR_TWITCH_ACCESS_TOKEN" "YOUR_TWITCH_CHANNEL_NAME" "YOUR_USER_ID_FROM_DASHBOARD"- Note: You will need to manually retrieve your
TWITCH_ACCESS_TOKENfrom the MySQL database for now (e.g., by querying theuserstable). YOUR_TWITCH_CHANNEL_NAMEis your Twitch username.YOUR_USER_ID_FROM_DASHBOARDis theuser_iddisplayed in your overlay URL on the dashboard.
- Note: You will need to manually retrieve your
- Send a message in your Twitch channel. You should see the chat message printed in the terminal where
twitch_chat_listener.pyis running.
This completes the basic setup and verification of the Twitch login and chat listener. The next step will be to integrate the Node.js WebSocket server.