Skip to content

Welcome to Safira !

Resende edited this page Feb 9, 2019 · 1 revision

Deploy

To deploy Safira to Heroku we advise that you create a pipeline with staging and a production server.

This will allow you to generate the required QR-Codes for the attendees (need to be printed), managers accounts and company accounts in the production server (needed for the organization).

You need to set this env variables in the heroku dyno :

  • AWS_ACCESS_KEY_ID
  • AWS_REGION
  • AWS_SECRET_ACCESS_KEY
  • DATABASE_URL
  • FRONTEND_URL
  • GUARDIAN_SECRET
  • POOL_SIZE
  • S3_BUCKET
  • SECRET_KEY_BASE
  • URL

Remember to run commands in heroku you can use the heroku run ### -a ***, where ### is the command and *** the app name.

If you wish to run bash just put bash there if you need to run a phoenix task you need to specify the POOL_SIZE (because of the limited pool offered by Heroku, normally POOL_SIZE=2 works.

I advise you to use the staging as safira and the production environment as safira-prod. More words less accidental commands to be run.

Setup

Badges

Currently, all the badges are in the image folder together with the correspondent csv file.

They are organized by type of badge.

To Populate badges you just need to run the populate.sh task in the utils/populateBadges folder.

Companies

You need to create all the company badges before creating any companies because the mix task that creates a company takes as argument the badge id of the company. Save the stdout output in a file, its the email and password of said company.

Give it to the Event organizer for safe keeping and to stop everyone from spamming you in the morning every day for the email and password. Keep it safe just in case.

Attendees

You just need to run the mix task with the number of users and save the stdout to a file, those are the uuids of each user. To generate the QR-codes use the utils/genAttendees.

WARNING: Please read this little script before running, you might need to change frontend URL.

Staff/Organization

KEEP IN MIND: Please ask the event organizer to give you the uuids that he pretends to use for the credentials of the people that can't participate in the badge contest (Organization and/or staff).

Change them to staff using the govern.staff task providing a uuid.

Managers

You can generate accounts for managers aka the people that gift badges with the mobile app with the gen.managers task and saving the stdout to a file.

WARNING: Please disable an account when the person using it is not working as a manager.

REMEMBER: Remember that every redeem has the manager identified, so please check if any of the managers are not cheating by giving badges to participants out of his shift or at the wrong time.

Contest

Winner

To get the list of possible winners of the random badge capture the stdout of the get.winner. Make sure that all members of the organization are marked as staff or else... it's gonna be awkward.

Ban

You can disable silently an account to ban a user with the ban.user task.

Clone this wiki locally