Boop is a web application which acts like a library checkout system, but for computers, allowing for an efficient barcode-based issue/return workflow.
Its current main goal is to be better than writing on paper.
Boop requires Ruby 3.0.1, Bundler, Node 16, Yarn, and preferably a Linux environment. It must be connected to a PostgreSQL database.
To install it in a consistent environment, a Docker Compose configuration is provided; this is the recommended method of installaton.
- Clone this repository (
git clone https://github.com/microlith57/boop.git --depth 1
) - Run
bin/bundle install
andbin/yarn install
to install dependencies - Configure environment variables as below
- Run
bin/rails secret
- Run
RAILS_ENV=production bin/rails db:prepare
to prepare the production database - Run
RAILS_ENV=production bin/rails log:clear tmp:clear assets:precompile
to clear the temporary files and logs, and precompile the necessary assets
Environment variables can be configured using .env
files.
It is recommended to create a file .env.production.local
in the boop
directory, and place overrides there.
You must set the following:
NODE_ENV=production
POSTGRES_HOST
to the database hostname (eg.localhost
)POSTGRES_PORT
to the database port (eg.5432
)POSTGRES_USERNAME
andPOSTGRES_PASSWORD
to the database credentialsRAILS_SERVE_STATIC_FILES
totrue
(unless you have a web server set to handle this)
- Pull the latest changes (
git pull
or download a new version) - Run
bin/bundle install
andbin/yarn install
to update dependencies - Run
RAILS_ENV=production bin/rails db:migrate
to migrate any database changes - Store old logs somewhere if necessary
- Run
RAILS_ENV=production bin/rails log:clear tmp:clear assets:precompile
to clear the temporary files and logs, and precompile the necessary assets
To start the server, run bin/rails server -e production
; see the Rails documentation for more details.
Currently, no user interface exists to create new accounts or edit existing ones; this requires the use of the Rails console (bin/rails console -e production
).
Using an external editor for editing passwords is not recommended because the passwords are hashed before storage.
To create an account via the console:
Admin.create email: '[email protected]', password: '12345'
To edit an existing account:
admin = Admin.find_by! email: '[email protected]'
# Edit email
admin.email = '[email protected]'
# Edit password
admin.password = '54321'
admin.save!
To delete an admin:
admin = Admin.find_by! email: '[email protected]'
admin.destroy