Source code
The following is a tutorial on local deployment development for different operating systems.
Prepare dependencies​
macOS​
Install homebrew​
First you need to install Xcode Command tools:
$ xcode-select --install
Then install Homebrew, the package management tool for macOS
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install dependencies​
$ brew install redis postgresql webp imagemagick node git
Setup Database and cache services​
Run postgresql and redis services
$ brew services start postgresql
$ brew services start redis
You also need to create a default username in Postgresql:
$ createuser --superuser zealot
# If you are worried about the high privilege, you can only enable the create database privilege
$ createuser --createdb zealot
yarn​
$ npm install -g yarn
Debian (Ubuntu)​
System dependencies​
$ apt update
$ apt install -y libssl-dev tar tzdata git imagemagick libjpeg-dev libpng-dev libtiff-dev libwebp-dev
Install dependencies​
$ apt install -y redis postgresql-client node
Setup Database and cache services​
Run postgresql and redis services
$ systemctl postgres start
$ systemctl redis start
You also need to create a default username in Postgresql:
$ initdb -D /var/lib/postgresql/data
$ createuser --superuser zealot
# If you are worried about the high privilege, you can only enable the create database privilege
$ createuser --createdb zealot
node​
$ npm install -g yarn
Alpine Linux​
System dependencies​
$ apk --update --no-cache add build-base libxml2 libxslt git \
libxml2-dev libxslt-dev yaml-dev postgresql-dev nodejs npm yarn libwebp-dev libpng-dev tiff-dev \
tzdata
Needs install gcompat
if use arm
architecture. or an exception will throws such like "Error loading shared library".
Install dependencies​
$ apk --update --no-cache redis postgresql
Setup Database and cache services​
Run postgresql and redis services
$ rc-service postgres start
$ rc-service redis start
You also need to create a default username in Postgresql:
$ initdb -D /var/lib/postgresql/data
$ createuser --superuser zealot
# If you are worried about the high privilege, you can only enable the create database privilege
$ createuser --createdb zealot
Install Ruby​
Can be installed by either asdf, rvm as ruby version manager.
- asdf
- rvm
Following the offical install guide then:
# Enable Ruby 3.2.0 YJIT need install Rust 1.58+
# Optinal install:
asdf plugin add rust
asdf install rust latest
asdf global rust latest
export RUBY_CONFIGURE_OPTS=--enable-yjit
# Required:
asdf plugin add ruby
asdf install ruby 3.2.0
asdf global ruby 3.2.0
$ curl -sSL https://get.rvm.io | bash -s stable
$ rvm install 3.2.0 --disable-binary
Fetch source code​
git clone https://github.com/tryzealot/zealot.git
Initialize Zealot​
All the following steps need to be performed in the zealot root directory.
bundler​
Install Ruby gems
$ [sudo] gem install bundler
$ bundle install
yarn​
Install javascript packages:
$ yarn install
Initialize database​
Make sure there are no problems with the connection database information, then the database tables will be created and the table structure will be created:
$ rails db:create
$ rails db:migrate
Configuring the connection database can be done via environment variables or by changing the config/database.yml
file.
Initialize default account and demo data​
Initialize administrator account and sample application
$ rails db:seed
Launch services​
$ bin/dev
Open brower http://localhost:3000