This document outlines server setup and configuration. Please refer to the User's Guide for usage instructions.
This application generally behaves like a normal Rails application.
To generate automated documentation using railroady gem in development environment, Graphviz is required.
Set following environment variables for production:
API_KEY- shared secret to access APIAPP_HOST- hostname that can be used to access the application externally.S3_BUCKET_NAMEAWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEYAWS_REGIONCORS_DOMAINS- comma-separated list of domain names (without protocol and trailing slash) that will be allowed to create applications using AJAX. For example:a.com,b.com.
These are the only required settings. Optionally:
Set ALLOW_FAKER environment variable to enable fake data generator at /setup/.
To deliver emails, configure SMTP settings from application user interface under Settings - System Settings menu using "Mail options" and "Smtp" sections.
Start the web server:
rails serverOptionally start email delivery process:
bundle exec rake jobs:workAdmissions offer an API for submitting an application form. It is designed to be consumed by AJAX frontend and available as a POST endpoint at /app_forms/ URI. The endpoint can handle multipart form for file upload and expects following request parameters:
app_form[klass_id]an integer representing Class id to apply for. Required.app_form[firstname]andapp_form[lastname]- applicant name. Required.app_form[email]- applicant email. Required.app_form[phone]- applicant phone.app_form[country]- applicant country of origin. Two-letter ISO code.app_form[city]- applicant's city and region of origin. A string.app_form[residence]- applicant current country of residence. Two-letter ISO code.app_form[residence_city]- applicant current city and region or address of residence. A string.app_form[gender]- a gender code. One uppercase character.app_form[dob]- date of birth in YYYY-MM-DD format. Can be submitted as three individual fields:app_form[dob(1i)]- year of birth.app_form[dob(2i)]- month of birth. An integer, January=1.app_form[dob(3i)]- day of birth.
app_form[referral]- marketing source. A string.
In addition to the closed list of parameters, any number of arbitrary string answers and file uploads can be passed. File uploads are limited to 5Mb each.
app_form[answers[question_name]]answer toquestion_namequestion. For example:app_form[answers[linkedin_page_url]].app_form[uploads[kind_of_file]]file upload that will be stored askind_of_file. For example:app_form[uploads[cv]].
Backend returns 200 status code on success and 422 status in case if there is a validation error. In latter case response body would be a JSON document with validation errors.
To autogenerate state diagram run:
bin/diagram
This will generate SVG state diagram in doc directory.
Steps through which an Application (AppForm) can go through are described in [Workflow](doc/Workflow Sept 13 2016 feedback.pptx) document, implemented in code in the AppForm model and processed to create autogenerated state diagram.