The scouting app of Nerd Herd 687.
NerdScout is a scouting app for the FIRST Robotics Competition, aiding in data collection during matches. Scouts watch matches and use NerdScout to record what a robot did during a match, from scoring to defense to fouls.
Pit scouting is also included, allowing scouts to ask prewritten questions to teams and input their answers into the app.
NerdScout then aggregates this data into tables for analytical use during Alliance Selection, along with providing stats for each team in many areas.
NerdScout also incorporates NerdPredict, a game where team members predict match results in order to gain the most points.
MongoDB Community Edition is the self hosted version of MongoDB, helpful for development.
-
Download MongoDB Community Edition
-
(optional) Install MongoDB Compass, the GUI explorer for MongoDB. The installer is usually included with MongoDB Community Edition.
-
Create a folder to store the database. This can be anywhere, but
/databaseis ignored by git in this repo. -
Start the database
To start the database on Windows:
\path\to\exe\mongod.exe --dbpath "\path\to\database"or on Mac:
/path/to/executable/mongod --dbpath "/path/to/database"-
(optional) Open Compass and create a connection. By default, if you're running locally, your connection string should be
mongodb://localhost:27017 -
Once you verify it works, create the file
mongoDBin thesecretsdirectory and paste in you connection string. Again, it ismongodb://localhost:27017by default.
Unless you change how you're hosting MongoDB, you shouldn't have to change your connection string.
Place your MongoDB connection string in secrets/mongoDB and Compass, either beginning in mongodb:// or mongodb+srv://. For more information, visit the MongoDB Documentation.
Unless you change how you're hosting MongoDB, you shouldn't have to change your connection string.
Create a file secretKey in the secrets directory with whatever text you want. This acts as the key for all of the encryption. Once you've set it, do not change it, unless you are resetting the database.
If you don't already have one, create a The Blue Alliance account
Under account, scroll to Read API Keys and create a new key.
Create a new file theBlueAlliance in the secrets directory and paste in the key.
Unless you delete it or your account with The Blue Alliance, you shouldn't have to change API key.
Make sure you have Python 3 installed. If you don't have it, check out "Properly Installying Python" from The Hitchhiker's Guide to Python for more information.
Create a terminal in the directory NerdScout is located in. Then, make a virtual environment and activate it.
For Windows:
py -m venv .venv
.venv\Scripts\activateFor Mac:
python3 -m venv .venv
source .venv/bin/activateNow install the required packages. On Windows:
py -m pip install -r requirements.txtand on Mac:
python3 -m pip install -r requirements.txtYou can deactivate the virtual environment with the deactivate keyword.
deactivateThe next time you want to run NerdScout, simply run the activation script. On Windows:
.venv\Scripts\activateOn Mac:
source .venv/bin/activateBefore running, ensure:
- All required secrets are added. Check /secrets/README.md for the full list.
- The database is running
- The virtual environment is active
Run the script using:
flask runor use debug mode.
flask run --debugThis should open a development server and display an IP Address. Navigate to this IP address to view NerdScout.
The server included with Flask is not meant for production use. There are many options for running WSGI (Web Server Gateway Interface) servers suitable for production. Check out the Flask documentation for more information.