SARA: Smart Automatic Research Assistant
In Ubuntu
-
Install required binary dependencies
sudo apt-get install libmysqlclient-dev -
Install proper NodeJS version, we recommend using NVM:
nvm install lts/gallium nvm use lts/galliumYou may need to close and reopen terminal window after nvm installation
-
Install proper version of yarn package manager:
npm install yarn --globalThis will install 'classic' yarn version 1.x. You need to switch it to latest version:
yarn set version berryConfigure yarn to use node-modules linker instead of PnP linker (Damir: I did not found other way to make cssbundling gem to work properly):
yarn config set nodeLinker node-modulesensure that yarn have version >= 3.x:
yarn --versionInstall project js dependencies:
yarn install -
Build javascript assets using yarn
yarn buildNote: if you want yarn to monitor changes to js files and automatically recompile them launch it with
watchoption:yarn build --watch -
Build stylesheets assets using yarn
yarn build:cssNote: if you want yarn to monitor changes to css/scss/sass files and automatically recompile them launch it with
watchoption:yarn build:css --watch -
Setup and launch DB and other services using Docker (see instruction in development/README.md)
We expect all settings like database URLs, security keys, etc to be stored in environment variables.
To simplify settings management in development we use dotenv-rails gem.
In test and developent environments it uses set of configuration files to load environment variables when app starts.
Project repo has two files: env.test and env.development having environments variables values for corresponding
environments, assuming that database and other services will be managed by docker.
If your local development setup requires some changes to those files (e.g. you do not want to use docker and prefer to
host database and other services locally), you don't need to overwrite those files or change other configuration.
Instead you should create personal env file with name .env.<ENVIRONMENT>.local and override required values there.
Values specified in env.<ENVIRONMENT>.local file take precedence over values specified in env.<ENVIRONMENT>
NOTE: env.*.local files are added to .gitignore and will not be stored in repo, because those files should be
different for each developer.
Project uses Memcached as caching serice.
Development and production environment expects to have environment variable MEMCACHE_SERVERS to be set to address of
Memcached server (or servers) to be used. If this variable is not set it will fallback to 127.0.0.1:11211
By default development environment has cache disabled, you can toggle it by running command
rails dev:cache