Skip to content
PhlexPlexico edited this page Oct 19, 2021 · 2 revisions

Here is the following instructions to ensure a simple setup/config in macOS. This is under the assumption that you already have Homebrew installed.

Install NVM

It's preferable to use node version manager (nvm) to control node installations. It makes it easier to swap between projects.

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

After installation, close and re-open your command window, and run the following statement:

nvm install 14.17.5

Install required database software

MariaDB/MySQL

Either mysql or mariadb is acceptable. Redis is also used as a session store, so it will require some configuration as well. Install with the following commands:

brew update
brew install mariadb redis

Please start the database server once it is ready:

mysql.server start

You may wish to ensure that mariadb runs on system startup, this can be done with the following command:

brew services start mariadb

Once running, please run the secure installation(mysql_secure_installation), then create a get5 user after logging in as root:

CREATE USER 'get5_user'@'localhost' IDENTIFIED BY 'sup3r_s3cUr3_p4ssw0rD'; 
GRANT ALL PRIVILEGES ON get5{ENV}.* TO 'get5_user'@'localhost'; 
FLUSH PRIVILEGES;

Where {ENV} is either dev, test, or nothing (for production). Write down the password that you gave get5_user as this will be needed later.

Redis

To ensure we have a secure installation for Redis, we must also edit the config file. Using your favourite text editor (such as vi/vim), open the file located at /usr/local/etc/redis.conf and locate the line requirepass. Un-comment this line (remove the #) and change the password to something nice and secure. This will prevent anyone from logging into the redis database and stealing sessions. Write down this password as it will be needed. Once that is done, you may restart your redis instance via:

brew services restart redis

and check the status of redis with the following command:

brew services

With that, all requirements for the API have been met. Next up is configuring the application, which can be found at this page.