Skip to content

nerdherd/NerdScout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

436 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


NerdScout

The scouting app of Nerd Herd 687.

About

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.

Setup

MongoDB setup

MongoDB Community Edition

MongoDB Community Edition is the self hosted version of MongoDB, helpful for development.

  1. Download MongoDB Community Edition

  2. (optional) Install MongoDB Compass, the GUI explorer for MongoDB. The installer is usually included with MongoDB Community Edition.

  3. Create a folder to store the database. This can be anywhere, but /database is ignored by git in this repo.

  4. 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"
  1. (optional) Open Compass and create a connection. By default, if you're running locally, your connection string should be mongodb://localhost:27017

  2. Once you verify it works, create the file mongoDB in the secrets directory and paste in you connection string. Again, it is mongodb://localhost:27017 by default.

Unless you change how you're hosting MongoDB, you shouldn't have to change your connection string.

Atlas and Other Hosting

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.

Secret key setup

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.

The Blue Alliance setup

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.

Python setup

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\activate

For Mac:

python3 -m venv .venv
source .venv/bin/activate

Now install the required packages. On Windows:

py -m pip install -r requirements.txt

and on Mac:

python3 -m pip install -r requirements.txt

You can deactivate the virtual environment with the deactivate keyword.

deactivate

The next time you want to run NerdScout, simply run the activation script. On Windows:

.venv\Scripts\activate

On Mac:

source .venv/bin/activate

Running

Before 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 run

or use debug mode.

flask run --debug

This 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.

About

The scouting app of Nerd Herd 687.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 4

  •  
  •  
  •  
  •