-
Notifications
You must be signed in to change notification settings - Fork 32
Installation
The following introduction assumes you're using a Linux-based operating system (Ubuntu) or Docker. You can use other operating systems as well of course but currently we don't provide an introduction for that. The installation procedure of the prerequisites might differ but the one for the application should be the same.
Prerequisites:
- Node.js
- MySQL
- Redis
- Yarn
First of all, make sure to install the prerequisites listed above if you haven't already installed them.
Since the application is based on Node.js install it on your system. We highly recommend to use nvm which allows you to easily switch between Node.js versions.
Run one of the following commands to install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
Afterwards, you can install the latest version of Node.js:
nvm install node
Next, install MySQL. Follow this introduction or run the following:
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
Redis is an in-memory data structure store which we use for Caching. Follow this guide or run the following:
sudo apt update
sudo apt install redis-server
Yarn is our preferred package-manager. Follow their guide for installation or run:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarn
Now we prepare the application's installation. This procedure should work for all operating systems.
First of all, create a new database on your MySQL server:
CREATE DATABASE aionic;
Since we use an ORM, the required tables will be automatically created based on database models when you run the application.
Copy the environment and orm-configuration files and enter your sensitive data:
cp .env.example .env
cp .ormconfig.json.example .ormconfig.json
Afterwards, enter your public information in aionic-config.json
.
Now, run the following commands to install the node modules and start the webserver:
yarn install
yarn build
yarn start
Last but not least run the following command for SQL data seeding: (optional)
yarn seed global
This should create a dummy admin account and outputs the it's password to the console.
We provide data seeding for different Aionic applications. You can run the following seed commands:
-
yarn seed global
- Generates global Admin / User roles and an admin account -
yarn seed milestone
- Generates aionic-milestone specific data
We assume that you run a working Docker and Docker-Compose environment on your system. Here you can find more about installing Docker and here how to install Docker-Compose.
Thanks to docker you don't have to install the prerequisites listed above. They are already all included in the Docker image.
First of all, copy the environment and orm-configuration files and enter your sensitive data:
cp .env.example .env
cp .ormconfig.json.example .ormconfig.json
Since we use Docker the following variables need fixed values:
.env
REDIS_HOST=redis
ormconfig.json
"host": "mysql",
"password": "test",
Afterwards, enter your public information in aionic-config.json
.
Next we build the Docker image and run the containers. Therefore, run the following commands:
docker-compose build
docker-compose up -d
Run docker ps
to check if the containers are running.
Last but not least run the following command for SQL data seeding: (optional)
-
docker exec -it <nodeContainerID> sh
to enter the container's shell -
yarn seed global
to start seeding
This should create a dummy admin account and outputs the it's password to the console.
We provide data seeding for different Aionic applications. You can run the following seed commands:
-
yarn seed global
- Generates global Admin / User roles and an admin account -
yarn seed milestone
- Generates aionic-milestone specific data