The app display a survey form for users to use and a report page for admins to check the results.
It will show errors to user if invalid input is submitted such as empty params or invalid email.
Once submitted, it sets a cookie to remember. To avoid abuse, it also sends an email to user to confirm the validity of their email.
To gather data, it is using CSV file for the survey answers and a JSON file for emails validation process.
For the survey report, the app use HTTP Basic Authentification to access it. The admins will just need to type the username and password.
It will only show the survey results from validated emails. If the email has not been validated, it will not be included in the report.
The report is displayed in a pie chart format for each survey questions with only one line of code such as <%= pie_chart(data) %>
thanks to the Chartkick gem.
From the project directory, use the command line and run rackup config.ru
in order to start the server.
Choose your preferred browser and go the url http://localhost:9292
.
You might need ruby 2.7.5 to run it.
To run the tests : ruby test\{test_file_name}.rb
There is 6 tests files test :
app_integration_test.rb
admin_test.rb
email_test.rb
survey_test.rb
template_test.rb
route_test.rb
Presentation made to project assessor @amuntasim , a senior software engineer and mentor at Openclassrooms (https://amuntasim.github.io/).