Sign inSign up

stellanetops/connect-foundation

By stellanetops

•Updated over 4 years ago

Connect App base image

Image
0

100K+

stellanetops/connect-foundation repository overview

⁠Stella Connect

⁠App Setup

See: dev-stack⁠

⁠Adding documentation

See: docs⁠

⁠Code review

See: docs⁠

⁠Running Tests

To run tests, it's recommended to start a bash prompt within the Docker container:

  • docker-compose exec connect rspec spec/spec_location.rb

⁠Running Feature Tests

To run feature tests, ie tests that require a browser, some local installation is required.

See Native gem extetions dependencies⁠ to setup gems. Steps after setting up .env should not be necessary.

To run a test, open up a terminal and navigate to the connect repo:

  • CHROME=D rspec spec/features/spec_location.rb

CHROME=D will start up Chrome with dev tools open CHROME=1 will start up Chrome with dev tools closed

⁠Debugging

To catch a binding.pry and debug, attach to the running Connect container: docker attach {container_name}

Hit enter if you have already hit the binding.pry and don't see any output.

To detach gracefully from a docker attach command, use the escape sequence: hold ctrl, press 'p', press 'q'

⁠Local Installation

While it is recommended to run the application locally with Docker, it's possible to run it locally without it. You will need to install all prerequisites, as listed here. When in doubt, the Dockerfile⁠ should be up to date with all requirements.

⁠Requirements
  • ruby (2.6.6 - see .ruby-version and Gemfile) | (Recommended (asdf⁠, rvm⁠, or rbenv⁠))
  • postgres (9.x)
  • nodejs (14.3.x) | (Recommended: nvm or asdf⁠)
  • redis
  • elasticsearch (5.x)
⁠Native gems extentions dependencies:
# postgres
brew install libpq
export PATH="/usr/local/opt/libpq/bin:$PATH"

# two commands below are required if postgres will be using in docker w/o installation
# please, check libpq version and replace '14.1' in the second command to the correct version if needed
bundle config --local build.pg --with-opt-dir="/usr/local/opt/libpq"
bundle config --local build.do_postgres --with-opt-dir="/usr/local/opt/libpq" --with-opt-include="/usr/local/Cellar/libpq/14.1/include/postgresql/server"

# image magick (see [https://imagemagick.org/script/download.php])

brew install imagemagick@6
export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/imagemagick@6/lib/pkgconfig"

# mimemagic
brew install shared-mime-info

After those commands bundle install should succeed. Please update these instructions if it didn't.

Create a .env file in the base connect directory.

touch .env

There is a sample file to use under env.sample to help fill out the file, but the simplest way is to ask a fellow dev for their copy.

⁠Install nvm, node, and yarn:
brew install nvm
# setup paths/bash using NVM instructions, like
mkdir ~/.nvm
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion

# yarn should be installed globally
brew install node yarn
nvm install 14.3.0
yarn install

Webpack dev server should start and compile the project:

webpack-dev-server
⁠Usage
⁠Start the server

puma -C config/puma-dev.rb

⁠Run the test suite

rspec

⁠Configuration

For a complete list of Configuration variables and their use, please see the doc⁠.

⁠Production

See the wiki page⁠

Tag summary

Content type

Image

Digest

Size

248.3 MB

Last updated

over 4 years ago

docker pull stellanetops/connect-foundation