Traffic Portal is an AngularJS client served from a Node.js web server designed to consume the :ref:`to-api`. Traffic Portal is the official replacement for the legacy Traffic Ops UI.
To work on Traffic Portal you need a *nix (MacOS and Linux are most commonly used) environment that has the following installed:
- Node.js 16.0.x or above
- Grunt CLI 1.2.0 or above
- Access to a working instance of Traffic Ops
Grunt CLI can be installed using NPM.
npm -g install grunt-cli
- traffic_control/traffic_portal/app/src - contains HTML, JavaScript and :abbr:`SCSS (Sassy CSS)` source files.
Clone the Traffic Control Repository
Navigate to the
traffic_portal
subdirectory of your cloned repository.Run
npm install
to install application dependencies intotraffic_portal/node_modules
. Only needs to be done the first time unlesstraffic_portal/package.json
changes.Modify :atc-file:`traffic_portal/conf/configDev.js`:
- Valid SSL certificates and keys are needed for Traffic Portal to run. Generate these (e.g. using this SuperUser answer) and update
ssl
. - Modify
api.base_url
to point to your Traffic Ops API endpoint.
- Valid SSL certificates and keys are needed for Traffic Portal to run. Generate these (e.g. using this SuperUser answer) and update
Run
grunt
to package the application intotraffic_portal/app/dist
, start a local HTTPS server (Express), and start a file watcher. To use a custom configuration file (not just :atc-file:`traffic_portal/conf/config.js` or :atc-file:`traffic_portal/conf/configDev.js`), set the TP_SERVER_CONFIG_FILE environment variable to the location of the desired file.Navigate to http(s)://localhost:[port|sslPort defined in the configuration file used (default: :atc-file:`traffic_portal/conf/configDev.js`)]