Flashcards is a program designed to assist with memorizing terms for tests or interviews. The application utilizes Python for the server-side functionality and HTML/CSS/JavaScript for the client-side user interface.
-
Flashcards for Interview Preparation: Create and review flashcards tailored for job interviews, covering a wide range of topics from technical questions to behavioral inquiries.
-
Knowledge Refresh: Use the flashcards to reinforce and refresh your memory, ensuring you are well-prepared for tests or exams. The flashcards can be used for topics such as math, chemistry, biology, etc.
-
Server-Side: The server-side of Flashcards is powered by Flask, providing a lightweight and efficient web framework. SQLAlchemy is used to manage the database containing the flashcards and user data.
-
Client-Side: The client-side interface is built using a combination of HTML, CSS, and JavaScript, offering a seamless and interactive user experience.
To get started with Flashcards, follow these steps:
-
Clone the Repository:
git clone https://github.com/AuricFox/Flashcards.git
-
Navigate to the Project Directory:
cd Flashcards
-
Setup Environment:
pip install virtualenv virtualenv env .\env\Scripts\activate # Windows source env/bin/activate # Mac OS
-
Install Dependencies:
pip install Flask FLask-WTF Flask-SQLAlchemy Flask-Testing python-dotenv
-
Run Server:
python wsgi.py
The server will start running, and you can access the application by navigating to
http://localhost:5000
in your web browser.
The models, forms, and routes can be tested individually or all together with the test cases located in the tests
directory. To run all the
tests execute the following command in the terminal from the base directory:
python commands.py tests
Model Tests:
python commands.py test_models
Form Tests:
python commands.py test_forms
Route Tests:
python commands.py test_routes
The tables have not yet been added to the database and need to be created. Execute the following command from the base directory in the command-line:
python commands.py create_database
If the database needs to be re-initialized, then enter the following script into the command-line from the base directory:
python commands.py clear_database
Creating and clearing the database can also be accomplished in the flash shell. This is done by following these steps:
- Open the Flask shell to create a table:
flask shell
- Run the folling code to create the table:
from app.extensions import db
from app.models.flashcard_model import FlashcardModel, FigureModel
db.create_all()
- To Update or Delete tables:
db.drop_all()
db.create_all()
- Run the following code to exit:
exit()
The figure table stores blocks of code, language type, or the filename of the image for figures related to any flashcards. Currently, users can only store one type (image or code/type) to prevent the flashcard from getting cluttered.
id | code_example | code_type | image_example |
---|
- id (INTEGER): An autoincremented primary key.
- code_example (TEXT): A block or snippet of code.
- code_type (TEXT): The language that the code block is written in.
- image_example (TEXT): A filename, not path, of the stored image.
The flashcard table stores the flashcard infomation and related figure id's for referencing. Users can create flashcards without a question or answer as long as there is an associated figure id attached, otherwise the card will not be saved.
id | category | question | anwser | q_figure | a_figure |
---|
- cid (INTEGER): An autoincremented primary key.
- category (TEXT, Not Null): The subject or topic of the question.
- question (TEXT): The query being asked.
- answer (TEXT): The expected response to the question.
- q_figure (INTEGER): A foreign key referencing the Figure table for any figures related to the question.
- a_figure (INTEGER): A foreign key referencing the Figure table for any figures related to the answer.
This project is licensed under the MIT License - see the LICENSE file for details.