The backend/server software for FRC team 1816's scouting app, GreenScout.
IMPORTANT: IT'S FINE THAT SERVER.CRT AND SERVER.KEY ARE PUBLIC. THEY ARE ONLY USED FOR MOCKING HTTPS ON LOCALHOST FOR TESTING (this will be fixed...)
It's expected that you at least know basic programming principles and practices. Additionally, knowing the Go Programming Language will be neccessary when contributing to this project. A (relatively) short primer on Go is provided here.
VS Code is the recommended editor of choice for this project, along with installing it's Golang Extension.
Regardless of your development enviroment, you will need:
- Go
- Git
- Python and pip
- Sqlite 3 (optional)
- C/C++ toolchain for
cgo
bindings
⚠️ C/C++ on WindowsWindows does not ship with native capabilities to compile C/C++ programs. That plus the absence of a built-in package manager means there's a bit of a process to get this working.
We recommend following this guide on Using GCC with MinGW to install and configure
mingw-w64
to set up an appropriate toolchain. AvoidCygwin
.
💡 IDE of Choice
While the rest of this document will detail how to set up your environment from a command line terminal, feel free to continue by your own method of choice.
Once you have all that installed, you'll need to actually download the code. From the terminal, clone and open this git repo:
$ git clone https://github.com/TheGreenMachine/GreenScout-Backend.git
$ cd GreenScout-Backend
This repo makes use of a vendor/
directory for its Go dependencies. This ensures that anyone will be able to build and run the program even if some dependency (or the developer) falls offline. During development, if you need to update your dependencies, go to the terminal and do the following from the base of the repo:
$ go mod tidy && go mod vendor
To run through the setup:
$ go run main.go setup
For a thoughrough breakdown of the setup process, go here
Once you've finished that, you can run the server in production.
If you're on a mac or linux machine, ports 80 and 443 are bound to the root only, so you have to run this with sudo
:
## Production
$ sudo go run main.go prod
## Testing
$ sudo go run main.go test
If you want it to write the match numbers of the configured event to the spreadsheet first
$ sudo go run main.go prod matches
- You will need to know how to port forward in order to ping the server from external networks.
- You will need a valid domain name, as I could not find a way to get ACME autocert to work without it.
Additional documentation on various topics can be found in the docs
directory. Technical documentation can be found in the exhaustively-annotated functions in this project, however.
- Admin Features
- Removing assigned matches from users. (Mutable schedules - talk to Lydia for specifics of what she wants)
- Discrepencies for multi-scouting - the only one that is implemented right now is average times being too different
- Greenlogger improvement
- Having the errors also spit out the line of code/method/stacktrace they came from