This code was originally written by @jwasham and other contributors. I modified according to my needs and built deployment automation scripts to make it easier for future developers/users.
This is a little responsive website that allows ESL learners (me included) to easily make flash cards and quiz themselves for memorization of:
- General English Knowledge
- Vocabulary
- Prepositions
- Expressions
Technologies used when building it:
- Python 3
- Flask
- SQLite
UI for listing cards. From here you can add and edit cards.
The front of a General flash card.
The reverse (answer side) of an Expression flash card.
Run the following command: $ docker run -it --rm -p 8000:8000 --name english-flash-cards paulomigalmeida/english-flash-cards:0.1-sample
Go your browser and type: http://localhost:8000
Provided by @Tinpee - tinpee.dev@gmail.com - Reach out to this contributor if you have trouble.
Make sure you already installed docker
- Clone project to any where you want and go to source folder.
- Edit the config.txt file. Change the secret key, username and password. The username and password will be the login for your site. There is only one user - you.
- Build image:
docker build . -t english-flash-cards
- Run container:
docker run -d -p 8000:8000 --name english-flash-cards english-flash-cards
- Go your browser and type
http://localhost:8000
If you already had a backup file cards.db
then run the following command:
Note: We don't need to rebuild image, just delete old container if you already built.
docker run -d -p 8000:8000 --name english-flash-cards -v :<path_to_folder_contains_cards_db>:/src/db english-flash-cards
.
<path_to_folder_contains_cards_db>
: is the full path contains cards.db
.
Example: /home/user/english-flash-cards/db
, and cards.db
is inside this folder.
For convenience, if you don't have cards.db
, this container will auto copy a new one from cards-empty.db
.
We just need store cards.db
file, and don't need any sql command.
- If you run container with
-v <folder_db>:/src/db
just go tofolder_db
and storecards.db
anywhere you want. - Without
-v flag
. Type:docker cp <name_of_container>:/src/db/cards.db /path/to/save
- Delete old container (not image):
docker rm english-flash-cards
- Build a new one with
-v flag
:docker run -d -p 8000:8000 --name english-flash-cards -v <path_to_folder_contains_cards_db>:/src/db english-flash-cards
- Voila :)
Happy learning!