The Event Management System is a suite of programs and applications that work together to provide a comprehensive event experience for it's staff, volunteers, and audience members.
EMS consists of 6 different programs:
- ems-core (Core desktop application)
- ems-api (REST API for communication with local database)
- ems-web (Web server for routing applications)
- ems-frc-fms (Field Management service for controlling driver stations and robots on the field)
- ems-socket (Real-time connection interfacing)
- audience-display (Web application to display scoring and match results)
- ref-tablet (Web application for referee scoring)
- field-monitor (Web application for monitor FMS and/or match status)
Details on each program can be found within their prospective sub-folders within this repository.
Once cloned, the proper module dependencies must be installed. Each sub-folder is treated as it's own project/repository.
In order to cope with this, an npm install
must be ran in each separate program before you run them. Node.js v8.0 or later
is also required to develop or install EMS.
Before running any staging or production builds, run an npm install
at the root directory of EMS. This will install gulp.js and
various other dependencies for the build process. However, it is recommended that you do a global install of the following modules:
npm install -g pm2
npm install -g gulp-cli
If you're interested in building the project from source, there are a few special considerations to take place.
- You must have python 2.7 installed, as well as the
PYTHON
environment variable set - run an
npm install --global --production windows-build-tools
- For windows, make sure your user account has write access to
C:\Program Files (x86)\MSBuild\14.0
- Run an
npm run build
from the root directory of EMS - After the build finishes, change directory to build/ems, and run
npm install sqlite3 --build-from-source --runtime=electron --target=2.0.4 --dist-url=https://atom.io/download/electron
- While in the same directory, run an
npm install --production
. - To build an executable, run
npm run dist
from the root of EMS (not the build/ems directory).
After globally installing the gulp-cli
, the following are some of the tasks associated with the EMS build process:
gulp update-env[:prod]
- Updates environment variables for all sub-projects based upon theecosystem.config.js
module. This file can also be used with pm2, but that's later. Anupdate-env:prod
will create a config for environment variables, while aupdate-env
will update environment variables for development.gulp prebuild[:prod]
- Executes the prebuild process. Right now, this is equivalent togulp update-env[:prod]
gulp postbuild
- Executes the postbuild process which moves allbuild/
folders to the root EMSbuild/ems
folder for packaging. This should also create anapp.asar
file for deployment with electron.
In conjunction with gulp.js, the build process is completely automated through the use of npm. To run the full build process,
execute npm run build
from within the root directory of EMS.
All programs within the EMS suite can be accessed or started through their prospective package.json scripts, or by an abbreviated version in this project's root. The following are the programs and their shortcuts:
- To start the entire application use
npm run ems
Note: Only one instance of either of the commands can be running. Concurrently will kill the other process. If you would like to reload an instance, use pm2.
- To start the api server use
npm run api
- To start the web server use
npm run web
- To start the FMS service use
npm run fms
- To start the socket service use
npm run socket
- To start the audience display use
npm run audience
- To start the ref-tablet use
npm run ref
- To start the field-monitor use
npm run field-monitor
In addition to the program shortcuts listed above, pm2 is a module that is designed for production-level process management.
The process manager can only be fully utilized by installing it globally via npm install -g pm2
.
EMS already comes with a process configuration that is pm2-friendly. To use the prebuilt
configuration, use pm2 start ecosystem.config.js
from the project root.
This will spawn the ems-socket, ems-api,
ems-web, and ems-frc-fms, .
microservices. For production environment variables, use pm2 start ecosystem.config.js --env production
. Use pm2 help
for a list of commands and options.