Skip to content
forked from kir-dev/pek-next

PéK like Profiles and Groups. The administration system for Schönherz Zoltán Student Hostel and SVIE

Notifications You must be signed in to change notification settings

sfphoton/pek-next

 
 

Repository files navigation

PéK-Next

The administration system for Schönherz Zoltán Student Hostel and SVIE

Build Status Code Climate Dependency Status

Requirements

  • Ruby 2.4.2
  • Postgresql 9.6
  • Node (asset compiling)
  • Redis (optional)

or

  • Docker

Installing requirements

Debian derivatives

Packages
# Redis is optional
sudo apt install postgresql-9.6 libpq-dev nodejs redis-server
Ruby 2.4.2

Use asdf with ruby plugin or rbenv. Install Ruby 2.4.2 and set executable version. You can check current ruby version with ruby -v

MacOS

Brew

Easiest way to install brew, then install required packages.

# Redis is optional
brew install asdf [email protected] redis
brew services start [email protected]
brew services start redis
Ruby 2.4.2 and Node

Add ruby and node plugin to asdf. Install Ruby 2.4.2 and set executable version. You can check current ruby version with ruby -v. Install node too.

Setting up

The source code and dependencies
git clone https://github.com/kir-dev/pek-next.git
cd pek-next
gem install bundler
bundle install
Environment

Create a .env file using .env.example and replace the values with real ones.

The database
sudo su postgres
psql -c 'create user "pek-next" with superuser password '\''pek-next'\'';'
Init database

As your own user

rake db:setup

Running

The server
rails s
Worker (optional, requires redis)
bundle exec sidekiq
The tests (of course)
rake test

Deployment

Easiest way for deployment is docker-compose.

Copy .env from .env.example, add APP_ID and APP_SECRET according to auth.sch and generate a SECRET_KEY_BASE using bundle exec rake secret.

Then run the following commands:

# These volumes are not necessary and could be removed from docker-compose, but a named volume easier to find later on
docker volume create pek_public
docker volume create pek_database
docker-compose up --build

After creating, while the containers are running run the following commands:

# This is only necessary at new setups
docker-compose run web bash -c "bundle exec rake db:setup"

# This is only necessary after pending migrations
docker-compose run web bash -c "bundle exec rake db:migrate"

# This is required at new setups and after changing in assets
docker-compose run web bash -c "bundle exec rake assets:precompile"

Problems you may encounter and the solutions

Ruby cannot build the native extensions
sudo apt install ruby-dev
Rbenv install only gives ruby-build usage instructions
rbenv install -v 2.4.2
Rbenv doesn't modify your ruby version
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
Rails command is not recognized after install

Restart your terminal

by Kir-Dev Team

Special thanks for

Rollbar

About

PéK like Profiles and Groups. The administration system for Schönherz Zoltán Student Hostel and SVIE

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 53.1%
  • Ruby 34.1%
  • TSQL 6.8%
  • JavaScript 4.7%
  • CSS 1.2%
  • Dockerfile 0.1%