/geography-quiz-fe

Primary LanguageRubyMIT LicenseMIT

Geography Quiz Front-End

A fun online quiz to test your knowledge of world geography

Ruby Rails

This is the front end to the Geography Quiz web application made by students at Turing School of Programming and Design over the course of two weeks. It is deployed on Heroku and uses PostgreSQL to store user data, along with OAuth2 to create accounts. The quiz questions are randomly generated using data from the REST Countries API. Each quiz is 20 questions and there is a high scores list displaying the most knowledgable folks. The back end of this project is open source and available on GitHub.

drawing

Example quiz questions

  • Is Yemen landlocked?

    • true
    • false <--
  • What country has the population of 7,275,556?

    • Zimbabwe
    • Dominica
    • North Macedonia
    • Laos <--
  • What is the flag of the Dominican Republic?

    • <--

Q&A

  • Is there a database of possible questions?

    • No, these questions are generated randomly from a large dataset of geographical information.
  • What personal information do you store if I create an account?

    • We only store your name as it appears on your Google account. No emails or other personal information is saved.
  • Can I retake the quiz?

    • You can take the quiz as many times as you want, and your dashboard will show your previous quiz scores and the dates you attempted those quizzes.
  • How do I create an account/log in?

    • This application uses Google OAuth2 for logging in and creating an account. In order to create an account, you must have a Google account. Because we use OAuth2, you do not need to create a password for this application.

Development setup

The front-end of this project uses Ruby on Rails 7.1.3 and was built using macOS Sonoma 14.4.1. It uses the hotwire-livereload gem to dynamically refresh the browser whenever changes are made to files within /app/.

First, clone the repository to your computer

git clone git@github.com:NeilTheSeal/geography-quiz-fe.git

This guide assumes you have installed homebrew, Rails 7.1.3, node.js 21.6.2, and PostgreSQL >= 14. In the repository root directory, run

npm install --save

If you do not have redis installed, run

brew install redis

Next, install all of the Gems

bundle install

Install the bun JavaScript bundler globally -

npm install -g bun

Install the livereload feature -

rails livereload:install

Start the redis background task -

brew services restart redis

Create the necessary databases -

rails db:{create,migrate,seed}

Finally, start the development server

./bin/dev

and open a web browser with URL localhost:3000. Keep in mind that the back end of this application must be running on localhost:5000 for the front end to function correctly. For instructions on how to run the back-end server, see the back end GitHub page.

Run the test suite to diagnose issues. Keep in mind that the back end must be set up correctly and serving on localhost:5000 for these tests to pass -

bundle exec rspec

Release History

  • 0.0.1
    • Initial deployment 06/07/2024

Meta

Neil Hendren | NeiltheSeal | neil.hendren@gmail.com | LinkedIn

Luis Aparicio | LuisAparicio14 | lfelipeaparicio2004@gmail.com | LinkedIn

Rodrigo Chavez - RodrigoACG | Rodrigo103004@gmail.com | LinkedIn

Distributed under the MIT license. See LICENSE.txt for more information.

Contributing

Email any author to inquire about contributing.