FReCon is an API for scouting at FIRST Robotics competitions. It is designed to be season-agnostic, that is, as dynamic as possible from year to year.
FReCon is built in Ruby, using Sinatra for the foundations of a server and the Mongoid database backend to interface with MongoDB as our system-level database backend. You need to have Ruby installed before you can use FReCon. We recommend using rvm to achieve this.
Getting Started
$ gem install frecon
You can install FReCon through RubyGems by running the above command.
You can also include gem "frecon"
in your Gemfile
, if you're writing a Ruby project using Bundler that has FReCon as a dependency.
However, FReCon will not work unless some System Dependencies are installed.
Basic Usage
$ frecon
This command starts the FReCon API as its own server on your device.
$ frecon console
$ frecon c
Both of these commands start a FReCon console.
A FReCon console is simply a pry shell that allows you to type Team
instead of FReCon::Team
to access that class.
It is more convenient than loading FReCon into an existing pry or irb session.
System Dependencies
-
MongoDB
- On Fedora, you can install MongoDB with
dnf install mongodb mongodb-server
, and start it withservice mongod start
. - On OS X, (with Homebrew) you can install MongoDB with
brew install mongodb
. - No configuration should be necessary; the packaged version of MongoDB works just fine.
- On Fedora, you can install MongoDB with
Architecture
FReCon is written as a JSON API.
This means that it returns responses which can be parsed via JSON.parse
in JavaScript or the corresponding function in a different language.
You can also interact with FReCon directly from the console, which is mentioned in the Quick Usage section.
As it is written in Ruby, FReCon should run on Mac OSX/Linux without much trouble. Windows users of FReCon may need to do a bit of fenangling, but we'd love to work with you if you're trying to use FReCon on Windows and need help. As a result of your effort, we could make a tutorial for future users.
Implementation
The project is split up into models and controllers, housed in their respective folders.
When you start the server, all these files are loaded.
When you make a query, the server checks to see what do in routes.rb
.
That usually directs it to a controller, which does some logic and may access one or more models before returning the content of the page requested, which is then sent to the client.
License
FReCon is distributed under the terms of the MIT license. You should have received a copy of the MIT license with this program. If not, you can find a copy at opensource.org/licenses/mit. You can also contact us with any licensing concerns or requests for permission at frc-frecon@googlegroups.com. (Or, if email bounces from there, you may contact Kristofer Rye, the primary maintainer of this project, at kristofer.rye@gmail.com)