Project Description
Today’s project is to build a full-featured Flashcards Web App using Flask, Python’s popular web framework. This is a real-world project that will teach you how to create dynamic web pages, handle forms, manage user sessions, and work with in-memory data. It’s a great entry point into web development with Python and will give you a strong foundation for more advanced web applications.
What You'll Build
You’ll create an interactive flashcard app where users can:
View one flashcard at a time
Flip the card to see the answer
Skip to another random card
Add their own new flashcards
Delete any existing flashcard
The app keeps track of the current flashcard being viewed using Flask’s session object, allowing the user to stay in the flow while navigating, flipping, or skipping cards.
This version uses in-memory storage, meaning that all flashcards are stored in a Python list and are reset whenever the server restarts. However, the app is built in such a way that you can later swap in a real database or JSON file to persist data.
Key Features
✅ Clean UI with HTML and CSS
✅ Flip cards to reveal answers
✅ Randomized next-card selection
✅ Form for adding new cards
✅ Deletion with a single click
✅ Fully working Flask backend
✅ Session-based state tracking
Expected Output
When you visit the homepage, you’ll see:
A flashcard showing a question like “What is the capital of France?”
A button to Flip the card and reveal the answer
A button to go to the Next random card
A button to Add a new flashcard
A Delete button to remove the current card
If there are no flashcards left, the page displays a message prompting the user to add new ones.
When you go to the add card form, you’ll see two fields:
One for the question (front)
One for the answer (back)
You can submit the form to create a new card, and then return to the main flashcard view.
💡 Hint
Don’t know where to start? This hint will show you how to begin.
𝌣 Solution
🔒 This solution is available to paid subscribers only.