A fantasy sports web application for the FIRST Robotics Competition (FRC), built with Node.js, MySQL, and Docker.
https://cloud.oracle.com/networking/vcns
The easiest way to run the application is using Docker.
-
Clone the repository
-
Configure environment variables
- Docker: The application runs on a
.inifile, but the Docker container automatically generates this file from environment variables. - You can modify
docker-compose.ymldirectly or create a.envfile to set variables likeSQL_PASSWORDandBLUE_ALLIANCE.
- Docker: The application runs on a
-
Start the Application
docker-compose up --build
-
Access the App
- Open http://localhost in your browser.
- Node.js (v18+)
- MySQL Server (v8.0+)
- Python (v3.x) with
pip
- Install Node Dependencies
cd server npm install - Install Python Dependencies
pip install numpy mysql-connector-python requests statbotics
- Setup Database
- Log in to MySQL and run the initialization script:
mysql -u root -p < server/init.sql - Configuration
- Create
server/server_info.iniwith your credentials:
[SQL] SQL_Passw = "your_password" SQL_IP = "localhost" SQL_User = "root" SQL_Database = "fantasy" [TBA] BLUE_ALLIANCE = "your_tba_api_key" [SERVER] SECRET = "your_session_secret"
- Create
- Run the Server
node server/server.js
The application pulls team data from The Blue Alliance (TBA) and Statbotics. To update the data for a new season:
- Edit the Script
- Open
server/get_team_info.py. - Update the
YEARvariable to the current season (e.g.,YEAR = 2026).
- Open
- Run the Update Script
- Docker:
docker-compose run app python3 server/get_team_info.py
- Local:
python3 server/get_team_info.py
- This will generate a new
server/team_info.jsonfile.
- Docker:
- Restart the Server to load the new data.
The admin user has special privileges to start drafts and manage users.
Currently, the admin user is defined in the server code. To change it:
- Open
server/server.js. - Locate the admin configuration (around line 43):
const adminId = "your_admin_id"; // e.g., "cf3a7c" const adminName = "YourUsername"; // e.g., "Aidan"
- Update
adminNameto the username of the account you want to be admin. - Update
adminId:- You can find a user's ID by checking the
userstable in the database:SELECT * FROM users WHERE name = 'YourUsername';
- Or by logging
req.userin the code for debugging.
- You can find a user's ID by checking the
- Restart the server for changes to take effect.
If you initialized the database using init.sql, the default admin is:
- Username:
Aidan - Password:
mad77777
To manually create a different admin in SQL:
INSERT INTO users (id, name, passw, teams, score, quals_score, elim_score, position)
VALUES ('new_admin_id', 'NewAdminName', 'bcrypt_hashed_password', '', 0, 0, 0, 0);server/- Node.js backend code.server.js- Main application entry point.sqlConnection.js- Database interaction logic.www/- Frontend HTML, CSS, and JS files.get_team_info.py- Script to fetch FRC team data.
docker-compose.yml- Docker service definition.
- Login/Signup: Create an account to participate.
- Draft: The admin starts the draft. Users take turns picking FRC teams.
- Scoring: Points are calculated based on the performance of drafted teams (using data from Statbotics/TBA).