The source code belonging to Alpha SOFIA. It is a system built with Ruby on Rails with Turbo and a little VueJS, used to manage orders in our own bar "Flux". Users authenticate via OAuth API (currently "Alpha AMBER") or through the built-in login portal to see how much credit they have left, or 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 installbundle exec rails db:setupbundle exec rails s -b 0.0.0.0 -p 5000- Go to http://localhost:5000 and you should see SOFIA running
- Copy
.env.exampleto.envwithcp .env.example .envand 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 rspecTo run the linting locally you can use the following commands
yarn lint yarn run sass-lint -v -q bundle exec rubocopWhen migrations are executed on master and everthing worked they can be archived with the following command.
bundle exec rails db:migrate:archiveWhen fonts need to be updated, they can be copied from the node_modules folder to assets/fonts with the following command.
yarn update:fontDeploying 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!