Help Center


Installation on Mac for Development

https://app.chaskiq.io/rails/active_storage/representations/redirect/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBBbXdEIiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--827f2d0b5794f7bb660c48b79e228655bd857bed/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdCem9MWm05eWJXRjBTU0lJYW5CbkJqb0dSVlE2RkhKbGMybDZaVjkwYjE5c2FXMXBkRnNIYVdscGFRPT0iLCJleHAiOm51bGwsInB1ciI6InZhcmlhdGlvbiJ9fQ==--cf24ea7784b3789671bb09c4029aca003c26b32d/me.jpg

Written by Miguel Michelson

updated

So you want to set up Chaskiq on macOS to hack on and develop with?

Install Chaskiq Dependencies

First. you will need to install the following requirements for installation.

Now that we have installed Chaskiq dependencies, let’s move on to installing Chaskiq itself.

Clone Chaskiq

Clone the Chaskiq repository in ~/chaskiq folder:

git clone https://github.com/chaskiq/chaskiq.git ~/chaskiq

~ indicates home folder, so Chaskiq source code will be available in your home folder.

Bootstrap Chaskiq

Switch to your Chaskiq folder:

cd ~/chaskiq

Configure Environment

Note that you will need to set up some environment variables first, the example file is located a .env.example in the root folder. Rename that to .env and add your variables for development.
Your file should look like this:

HOST=http://localhost:3000
ASSET_HOST=http://localhost:3000
WS=ws://localhost:3000/cable



SES_ADDRESS=
SES_USER_NAME=
SES_PASSWORD=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_S3_BUCKET=
AWS_S3_REGION=
ADMIN_EMAIL=your@email.com
ADMIN_PASSWORD=123456
SNS_CONFIGURATION_SET=metrics
DEFAULT_SENDER_EMAIL=

Important things are: your HOST and WS vars and ADMIN_EMAIL and ADMIN_PASSWORD for initial admin generation

Install the needed gems

bundle install

Now that you have successfully installed gems, run these commands:

bundle exec rails db:setup

Try running the specs:

bundle exec rspec

All the tests should pass.

Start rails server:

To fully configure development in Chaskiq you will need to run it in a subdomain. That subdomain has to be declared in your /etc/hosts file, and declared in your .env file.
Example:
/etc/hosts

127.0.0.1 app.chaskiq.test

chaskiq/.env

HOST=http://app.chaskiq.test:3000
ASSET_HOST=http://app.chaskiq.test:3000
WS=ws://app.chaskiq.test/cable

Now, start the engines 🤖

bundle exec rails server

You should now be able to connect with your Chaskiq app on http://app.chaskiq.test:3000 - try it out!

Asset precompilation

If you want to run the app asset precompilation in parallel in another terminal tab run the following:

yarn start

Background tasks

to run the service background tasks like email sending, file processing. you will need to run

bundle exec sidekiq

Create New Admin

The rails admin_generator task will create an admin user for you, you will need to have an ADMIN_EMAIL and ADMIN_PASSWORD on your .env try these credentials:

rails admin_generator

Happy hacking! And to get started with that, see Beginner Guide to develop Chaskiq plugins.