This Django App allows users to create and study flashcards, track their progress, and review learned words. It includes features such as proficiency tracking, statistics, and user authentication.
-
Flashcard Creation: Users can create new flashcards with words in their target language, translation in their native language, and images.
-
Proficiency Tracking: Users can set their proficiency level for each flashcard, indicating whether they need practice or have learned the word.
-
Check learned words: Users can check all learned words in case they need to remember them and know their count.
-
Statistics: The app calculates and displays user statistics, including the total number of cards, cards that need practice, learned cards, the percentage of learned cards, and the last time studied.
-
Study and Review: Users can study new flashcards and review cards that need practice.
-
User Authentication: Users can register, log in, and log out of the application.
The models.py file defines the database models for the application:
- User: represents a user account with attributes such as:
- Username
- Email,
- Password
- Profile picture
- Flashcard: represents a card.
- Target language word
- Native language translation
- Reference image.
- Proficiency: Represents a level of mastery for a specific flashcard word. It is related to the Flashcard and User model using ForeignKeys, with a unique_together attribute between user and flashcard fields to avoid duplication.
- Stats: Represents statistics about a user's performance on studying or practicing flashcards.
- Cards studied count
- Learned flashcards count
- Flashcards that need more practice count
- Last time studied
The views.py file contains all the views functions which handle incoming requests.
- New Flashcard: Receives a POST request to create a new flashcard object and save it in the database.
- Set Proficiency: Receives a POST request from a fetch call and updates an user proficiency of certaing word/flashcard.
- Update Stats: Update user stats into the database and calculate percent of words learned. Is called when a flashcard proficiency is updated.
- Index: Renders index template.
- Study: Gets max 10 flashcards for a study deck and shows one per page using Django paginator.
- Review: Gets max 10 flashcards that needs more practice for a review deck and shows one per page using Django paginator.
- Learned: Gets all learned flashcards ordered by last studied date time, using Paginator shows 5 per page.
- Profile: Gets user stats and renders stats template.
- Login: Handles user login by checking if provided credentials match those stored in the database and redirects accordingly. If not logged in, renders login page with error message (if any).
- Logout: Logs out current user by removing session data and displaying login page.
Here's what you need to be able to run this App:
- Node.js
- MySQLI
- Python
- Django
git clone https://github.com/SofiaBracho/flashcards.git
cd flashcardspython manage.py makemigrations
python manage.py migratepython manage.py runserverhttp://localhost:8000Create your user account in the /register route, then login into the form in the /login route.
Flashcards is an open-source project and anyone from the community can contribute to it.
If you'd like to contribute, fork the repository and make changes as you'd like. Pull requests are welcome.
Sofia Bracho
Web developer
