Skip to content

Survey website built with only the Rack gem, no frameworks.

License

Notifications You must be signed in to change notification settings

Natblow/survey-rack-ruby

Repository files navigation

Online Survey Rack App

The app display a survey form for users to use and a report page for admins to check the results.

Survey Form

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.

image

Survey Report

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.

image

Usage

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.

Tests

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

Live Demo

image

Video Link

Presentation made to project assessor @amuntasim , a senior software engineer and mentor at Openclassrooms (https://amuntasim.github.io/).

About

Survey website built with only the Rack gem, no frameworks.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published