SportX is a complete, centralized Sports Event Management, Live Score, and QR Access Platform. It has been built from the ground up prioritizing simplicity, stability, maintainability, and a professional user experience.
The system is designed with a Central Source of Truth architecture to support multiple administrators seamlessly without state desynchronization. The platform is entirely web-based.
graph TD
A["Admin Web Client 1"] -->|REST API| C("Central Node.js API")
B["Admin Web Client 2"] -->|REST API| C
C <-->|Read/Write| D[("Central PostgreSQL DB")]
E["Public Web App"] -->|REST API Polling| C
F["Mobile Phones via QR"] -->|HTTP| E
- Central Database (
database/): PostgreSQL database serving as the single source of truth for all events, teams, and live scores. - Central API (
server/): A Node.js/Express REST API written in TypeScript. It handles all business logic, QR code generation, and database interactions. - Admin Dashboard (
web/admin.html): A secure, protected web dashboard for authorized staff, allowing tournament control and score updates from any modern browser. - Public Web Application (
web/): A mobile-first, responsive HTML/JS/CSS frontend. Spectators scan QR codes and instantly view auto-updating live scores and brackets.
- Ensure you have PostgreSQL installed and running on port
5432. - Create a database named
sportx. - Run the schema and seed scripts against it:
psql -U postgres -d sportx -f database/schema.sql psql -U postgres -d sportx -f database/seed.sql
cd server
npm install
npm run devThe API will start on http://localhost:5000.
You can use any standard HTTP server to serve the static files.
cd web
npx http-server -p 3000The website will be available at http://localhost:3000.
The admin dashboard is an integrated secure portal.
- Navigate to
http://localhost:3000/login.html - Login with the default credentials:
- Username:
admin - Password:
admin123
- Username:
SportX includes a built-in terminal tool to inspect tables and run queries directly in your terminal without requiring psql to be installed:
# View all tables and row counts
node server/query.js
# View data from a specific table (e.g. teams, matches, sports, events, players)
node server/query.js teams
node server/query.js matches
# Run a custom SQL query directly
node server/query.js "SELECT id, name, captain, coach FROM teams LIMIT 5"Tip: If you are inside the
server/directory, you can also usenpm run db:viewornode query.js <table_name>.
- Multi-Admin Synchronization: Update a score on one admin device, and it is instantly reflected on all other devices and spectator phones.
- QR Code System: Generate printable QR posters dynamically via the backend API.
- Zero-Friction Mobile Experience: Scanning a match QR code routes directly to the specific live match page—no menus, no searching.
- Automated Bracket Generation: Admins can generate and visualize tournament brackets dynamically.
- Live Auto-Polling: The web client automatically polls the central API to update scores in real-time with subtle visual indicators.
- Premium UI: Dark sports aesthetics, high-contrast typography, and micro-animations designed for professional broadcast environments.