The source code belonging to Alpha SOFIA. It is a system built with Ruby on Rails with Turbolinks and a little VueJS, used to manage orders in our own bar "Flux". Users authenticate via OAuth API (currently "Alpha AMBER") or through the builtin login portal to see how much credit they got left, or to be able to register new orders and/or payments.
Use this repository to build upon, use as-is, learn from it, prove a point or whatever 😏
On Linux-like systems
- Ruby (see
.ruby-version
) - Bundler (
gem install bundler
) - NodeJS (see
.nvmrc
) - Yarn
- Postgresql 14.7+
- Clone this repository
- Run the following commands:
bundle install
(might take a couple of minutes)yarn install
bundle exec rails db:setup
bundle exec rails s -b 0.0.0.0 -p 5000
- Go to http://localhost:5000 and you should see SOFIA running
- Copy
.env.example
to.env
withcp .env.example .env
and edit the values where necessary - (When you want to use the invoice module) Follow https://github.com/zakird/wkhtmltopdf_binary_gem#installation-and-usage
Before you can start the application you will need the master.key
. Ask a fellow developer for it, or pull it from the server via ssh.
When the master.key
is present, you can use bundle exec rails credentials:edit
to open the default editor on your machine to read and edit the credentials. Be informed: these are production credentials so be careful.
Read more about Rails credentials on EngineYard.com.
$ EDITOR=nano bundle exec rails credentials:edit
Users can have roles in SOFIA, namely Treasurer ("SB-penningmeester"), Renting manager("Verhuur")and/or Main Bartender ("Hoofdtapper"). A user can also log in without a role. These roles are derived from the groups the user is in. These groups are saved in the AMBER API.
Roles are created in the following way during the seeding:
Role.create(role_type: :treasurer, group_uid: 4)
Role.create(role_type: :renting_manager, group_uid: 5)
Role.create(role_type: :main_bartender, group_uid: 6)
To Run the test locally the following command can be used
bundle exec rspec
To run the linting locally you can use the following commands
yarn lint
yarn run sass-lint -v -q
bundle exec rubocop
Deploying procedure is the same as for the AMBER project. See DEPLOY.md for that.
When contributing, please consult with the repository owners in advance to ensure a high chance of PR-success. PR-success means you're PR is merged and you'll be mentioned in the contributors list 🎉.
When submitting a PR, it'll need to be approved, but once approved (and green) you're responsible yourself for clicking the merge button and enjoying the intense feeling of satisfaction!