How notpradip/football-scoreboard-for-obs works
1. Overall shape
This is a small PHP/MySQL web application for managing a live football scoreboard. The architecture is split into a private admin/control side and a public display side intended for OBS Browser Source.
2. Main runtime boundary
The app runs on a standard PHP web server with a MySQL/MariaDB database. There is no separate backend service or build pipeline; the PHP pages handle both presentation and server-side logic.
3. Administrative workflow
signup.php, login.php, logout.php, and dashboard.php form the authenticated control path. Users create an account, log in, and are redirected to the dashboard where they can edit team names and scores.
4. Public scoreboard path
score.php is the public-facing display page used in OBS. It is accessed through a unique token in the URL, which is the privacy boundary preventing viewers from reaching the admin UI.
5. Data access/API-like layer
data.php is the data retrieval endpoint for the scoreboard state. It uses the token to fetch the correct scoreboard record from the database and supplies the display page with current values.
6. Database model
user.sql contains the schema and seed structure. Based on the README, the database stores user accounts, scoreboard data, and the unique tokens that map a display URL to a specific scoreboard.
7. Shared application logic
function.php likely holds reusable PHP helpers such as authentication checks, database queries, token generation, or scoreboard update logic. This is the main shared code boundary across the page scripts.
8. Configuration boundary
connects/config.php contains the database connection credentials. That file is the deployment-specific configuration point separating code from environment setup.
9. Client-side rendering and live updating
js/main.js and js/popper.js support the browser-side behavior, while css/style.css and Bootstrap/Font assets provide the UI. The score display is designed to update live for broadcasts, so the front end likely refreshes or polls scoreboard data rather than relying on a separate push service.
10. External integration
OBS Studio is an external consumer of the public scoreboard URL. In the architecture diagram, it should be shown as a browser client pointing at score.php?token=..., not as a system component that talks directly to the database.
11. Security and access boundaries
Authentication protects the dashboard and score editing actions. The tokenized public URL exposes only the scoreboard view, while update privileges remain restricted to logged-in users.
12. What to diagram as core flows
The important flows are: account creation/login to establish an authenticated session; dashboard updates writing score/team data to MySQL; score display reading the same data through a tokenized endpoint; OBS rendering that public page during the broadcast.
Main entry points: function.php Helpers · dashboard.php Dashboard · score.php Score view · data.php Data endpoint
Components 16
Admin control
Authenticated workflow for managing the scoreboard.
Public display
Tokenized view used by OBS and viewers.
- Score view · Tokenized public scoreboard rendered in the browser/OBS.
score.php - Data endpoint · Fetches the current scoreboard state by token.
data.php - OBS · External browser source consumer of the public scoreboard.
Shared app core
Common PHP logic, configuration, and persistence.
Browser assets
Client-side UI and styling used by the pages.
- Main JS · Client-side behavior for the pages and live updates.
js/main.js - Popper · Frontend dependency bundled with the browser assets.
js/popper.js - Styles · Application styling for the dashboard and display.
css/style.css - Bootstrap · Shared CSS framework assets used by the UI.
css/bootstrap/mixins/_table-row.css - Icons · Icon font assets used by the browser UI.
fonts/ionicons/fonts/ionicons.eot
Connections 17
- Signup → Helpers: uses · Signup relies on shared validation and account logic.
- Login → Helpers: uses · Login relies on shared authentication helpers.
- Logout → Helpers: uses · Logout uses shared session handling.
- Dashboard → Helpers: uses · Dashboard uses shared auth and scoreboard update logic.
- Score view → Data endpoint: loads · The public view fetches live scoreboard state.
- Data endpoint → Helpers: uses · Data endpoint uses shared token lookup and read logic.
- Helpers → Config: reads · Shared code uses the database connection settings.
- Helpers → MySQL: queries · Shared logic performs reads and writes against MySQL.
- Schema → MySQL: defines · The SQL file defines the persistent database structure.
- Dashboard → MySQL: writes · Admin edits persist scoreboard changes to the database.
- Data endpoint → MySQL: reads · Score data is loaded from persistent storage.
- Score view → Main JS: uses · The display page uses browser-side behavior.
- Score view → Styles: styles · The public page uses the shared stylesheet.
- Dashboard → Styles: styles · The admin UI uses the shared stylesheet.
- Dashboard → Main JS: uses · Admin interactions are supported by browser script.
- Main JS → Popper: depends on · Main browser script relies on Popper bundle support.
- Score view → OBS: renders in · OBS loads the public scoreboard as a browser source.