Skip to content

ZeusWPI/Saruman

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
app
 
 
bin
 
 
 
 
db
 
 
lib
 
 
log
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Saruman

Saruman the white

Saruman is a material management tool where partners can reserve items from an inventory. There are 2 different roles: Inventory managers and partners. Inventory managers can add items to an inventory. They can create partners and assign reservable items to partners. Partners can follow a unique link to request items they can order.

At an event, they can pick up the items at a pit by scanning their own barcode with the barcode of the item.

Current state

  • Admins can add partners
  • Admins can add items
  • Partners can log in using a unique link
  • Partners can reserve items
  • Admins can approve reservations
  • Admins can disapprove reservations and give feedback why
  • Partners can increase the count of an approved reservation by adding a new reservation for that item
  • Partners can see a short overview of their costs, admins can see general reports
  • Admins can edit the reservation deadline and email in the settings page

Roadmap

  • Automize the "special requests"
  • Create a check-in and check-out system for the material pit

Local installation

  • Clone this repository
  • Make sure the Ruby version defined in .ruby-version is installed (using asfd, just run asdf install)
  • Run bundle install
  • Run bin/dev to start a database docker image
  • Run bundle exec rake db:seed to set up some basic data
  • Run bundle exec rails s to start the Rails server
  • Visit http://localhost:3000
  • Sign in using saruman@zeus.ugent.be and thewhite as password

Deploy update to server

  • Push the updates to master
  • SSH into the server
  • cd into the Saruman directory
  • Stash current changes (git stash)
  • Pull master: git pull
  • Unstash current changes (git stash pop)
  • Run docker-compose down && docker-compose up -d --build

Debug on the server

  • SSH into the server
  • run docker exec -it saruman_saruman_1 /bin/bash
  • run RAILS_ENV=production bundle exec rails console

Snippets

Add an admin user

User.create!(name: 'Your name', email: 'your email', password: 'your super duper secure password', role: :admin)

Docker

Before Saruman can be run the first time, the migrations need to be run on the database, you can use the example docker-compose file and execute the following steps:

# Start the database
docker-compose up -d mysql

# Find the ip of the database in the docker network
docker network inspect saruman_default | jq '.[0].Containers[] | select(.Name == "saruman-mysql-1") | .IPv4Address [:-3]'

# Change the host ip in the production config
vim config/database.yml

# Run the migrations
RAILS_ENV=production bundle exec rails db:migrate

# Change the host ip back to 'mysql'
vim config/database.yml

# Bring up Saruman
docker-compose up -d

After this, you can just use docker-compose up -d to run the application.

Contributors

  • Tom Naessens
  • Felix Van der Jeugt
  • Toon Willems
  • Benjamin Cousaert

About

Saruman is a material management tool where partners can reserve stuff

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published