The new face of https://www.mbta.com/
-
Request a V3 API key at https://dev.api.mbtace.com/, and request an increased rate limit for it (someone with access will need to approve this). Note that, at any given time, the site may not be compatible with the very latest API version.
-
Install Homebrew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -
Install asdf package version manager
-
Follow the instructions on https://github.com/asdf-vm/asdf
-
Install the necessary tools to set up asdf plugins:
brew install coreutils automake autoconf openssl libyaml readline libxslt libtool unixodbc -
Add asdf plugins
asdf plugin-add erlang asdf plugin-add elixir asdf plugin-add nodejsYou can verify the plugins were installed with
asdf plugin-list -
Import the Node.js release team's OpenPGP keys to install 'nodejs' plugin:
bash ~/.asdf/plugins/nodejs/bin/import-release-team-keyringIf you run into problems, you might have to update the
import-release-team-keyringscript. -
If running OSX 10.15 Catalina, run
export MACOSX_DEPLOYMENT_TARGET=10.14. This works around a known issue with compiling versions of Erlang prior to 22.1.4. -
Run the install:
asdf install -
Verify that all the languages for our setup were installed:
asdf currentYou should see the following output with versions specified from
.tool-versions:elixir <version> (set by ~/dotcom/.tool-versions) erlang <version> (set by ~/dotcom/.tool-versions) nodejs <version> (set by ~/dotcom/.tool-versions)If you are missing any versions, you should re-run
asdf install. Related Github issue about asdf-erlang
-
-
Install chromedriver (for Elixir acceptance tests using Wallaby)
brew cask install chromedriverNote:
chromedriverrequires Chrome to be installed. If you don't already have it,brew cask install google-chromeis an easy way to install it. -
Install our Elixir dependencies. From the root of this repo:
mix deps.get -
Install npm globally
npm install -g [email protected] -
Install our Node dependencies. From the root of this repo:
npm run install -
Setup serverside rendering for React:
npm run react:setup && npm run react:build -
Build the assets:
npm run webpack:build -
Set up required environment variables:
cp .envrc.template .envrcThen uncomment the
V3_API_KEYline and fill it in with the key you obtained in the first step. If you have direnv installed, it will automatically load and unload the environment using this file. If not,source .envrcwill load or update the variables in your shell session manually.
For details on environment configuration, including optional variables, see ENVIRONMENT.md.
Start the server with mix phx.server
Then, visit the site at http://localhost:4001/
See docs for information about testing and other development details.