A Simple Flashcard Web App!
A simple way to keep track of words and definitions that I'm trying to memorize.
How to Install to Run the App Locally
- First, clone this directory to your computer by typing this into the command line where you would like to save the repository.
$ git clone https://github.com/loupe/flashcard-homework-savannah.git
- Install the bundler gem if you don't have it yet.
gem install bundler
- Install required gems after cd'ing into the flashcard-homework-savannah folder.
bundle install
- Start the app
ruby main.rb
- Open the app in your browser: http://localhost:4567/
You will be using the database that I created while working on the project. If you'd like to dump it and start anew, delete flashcards.db from the folder, make a new blank flashcards.db file and then type the following into your terminal:
irb
require './main'
Flashcard.auto_migrate!
Then you can create a flashcard in the terminal with this format:
>Flashcard.create(word:"put word or phrase here", definition:"put the definition of your word or phrase here", difficulty:1)
For difficulty put a 1 for easy, 2 for medium, and 3 for hard. Alternatively, once you create the database you can add cards through the user interface at http://localhost:4567/
How to Use the App
On main page you can make a new flashcard or study your cards. Click on the easy, medium, or hard toggles to limit the cards you study by difficulty. Otherwise, you will be able to flip through all your cards. Click "flip" to see the answer/defintion and then "next" to see another card. You can also view all of your cards by clicking "See All Cards". You can also see all of your cards by visiting "/flashcards". From the flashcard page, you can edit any of your existing flashcards.
Tech stack
- Sinatra
- Jquery
- Database - SQLite
- GitHub
- Slim Templates