Thanks to visit codestin.com
Credit goes to github.com

Skip to content

churcho/dotcom

 
 

Repository files navigation

Build Status

Dotcom

The new face of https://www.mbta.com/

Getting Started

  1. 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.

  2. Install Homebrew:

    /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  3. 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 nodejs
      

      You 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-keyring
      

      If you run into problems, you might have to update the import-release-team-keyring script.

    • 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 current
      

      You 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

  4. Install chromedriver (for Elixir acceptance tests using Wallaby)

    brew cask install chromedriver
    

    Note: chromedriver requires Chrome to be installed. If you don't already have it, brew cask install google-chrome is an easy way to install it.

  5. Install our Elixir dependencies. From the root of this repo:

    mix deps.get
    
  6. Install npm globally

    npm install -g [email protected]
    
  7. Install our Node dependencies. From the root of this repo:

    npm run install
    
  8. Setup serverside rendering for React:

    npm run react:setup && npm run react:build
    
  9. Build the assets:

    npm run webpack:build
    
  10. Set up required environment variables:

    cp .envrc.template .envrc
    

    Then uncomment the V3_API_KEY line 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 .envrc will load or update the variables in your shell session manually.

For details on environment configuration, including optional variables, see ENVIRONMENT.md.

Running the Server

Start the server with mix phx.server

Then, visit the site at http://localhost:4001/

Additional documentation

See docs for information about testing and other development details.

About

mbta.com

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 63.3%
  • TypeScript 15.5%
  • JavaScript 8.9%
  • CSS 6.7%
  • HTML 5.4%
  • Shell 0.2%