Skip to content

Instantly share code, notes, and snippets.

@MrJadaml
Last active May 20, 2021 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrJadaml/4f486da086bead2dd82e1ce2c6e3f47c to your computer and use it in GitHub Desktop.
Save MrJadaml/4f486da086bead2dd82e1ce2c6e3f47c to your computer and use it in GitHub Desktop.

Startup Steps

Brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

You can run brew doctor to insure the install ran without any issues. brew doctor


Ruby Version Manager (RVM)

\curl -sSL https://get.rvm.io | bash -s stable

Load rvm without restarting your shell session

/Users/foo/.rvm/scripts/rvm

Node Version Manager (NVM)

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

You can check that nvm was installed by running command -v nvm. If installed correctly you should see the text "nvm" output to the terminal.

To install the version of Node being used by the Garmentier app, run the following from within the .../Garmentier directory.

nvm install

Yarn

npm install -g yarn

Node modules

To install the npm modules used by the Garmentier app, run the following from within the .../Garmentier directory.

yarn install

DB Setup

You will need to have both a PostgreSQL and Redis database installed to run the app.

brew install postgresql
brew install redis

You can verify that they are installed by running brew services list. This will also show you their status, which should be "stopped". We will want to have these servers running, so run the following commands:

brew services start postgresql
brew services start redis

If you run brew services list again, you should see the status for both is "started"

Postgresql

In addition to installing and starting the postgresql server, you will also need to create a database in it for the app. Note that the path in the second command will depend on where you have the SQL dump file. You will need to ask someone on the team to provide you with that file.

createdb curate_development
pg_restore -O -d curate_development  ~/path_to_sql_dump

Check out Getting started with postgres for help.


Rails dependencies

There will be a couple of rails dependencies you will need to manually install before bundling the app.

brew install imagemagick
gem install rmagick -v '4.1.2'

With those installed, you can now install all the rails gems.

bundle install

Web servers

To run the api and client servers you will need to install foreman.

gem install foreman

With that installed you can now run the servers with:

foreman start -f Procfile.dev

You should now find the app running at localhost:3000



📚 Resources

  • Homebrew - The Missing Package Manager for macOS (or Linux).
  • RVM - A verson manager for Ruby.
  • NVM - A version manager for Node.
  • Yarn - A package manager that doubles down as project manager. An alternative to npm.
  • PostgreSQL - The World's Most Advanced Open Source Relational Database.
  • Redis - An open source, in-memory data structure store. It's used as a database, cache, and message broker.
  • Redis brew install - Install Redis with brew.
  • Imagemagick - A widly used tool in the Ruby and Rails community for working with images.
  • Rails - A Ruby based web application framework.
  • Foreman - An orchestration tool used to proxy and manage your infrastructure.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment