The Flashcard Learning App is a simple REST API for creating and studying flashcard decks. Whether you're learning a new language, preparing for exams, or just want to memorize anything, this app has you covered.
You can create decks, add cards, and practice with two different game modes: multiple choice (pick the right answer) and typing mode (type it from memory). It's straightforward, clean, and built with Spring Boot following solid architecture practices.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ CREATE โ ๐ฏ ORGANIZE โ ๐ง MASTER โ
โ โ
โ Build flashcard decks โ
โ Practice with interactive learning โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ Java 17 โ The foundation of reliability
๐ Spring Boot 3 โ Rapid development, zero compromise
๐ Spring Web โ RESTful elegance
๐พ Spring Data JPA โ Database magic without the boilerplate
โ
Spring Validation โ Guard your data gates
๐ฌ MySQL โ Rock-solid persistence
๐ฆ Maven โ Dependency harmonygit clone https://github.com/YOUR_USERNAME/Flashcard-App.git
cd Flashcard-AppCreate your MySQL database:
CREATE DATABASE flashcard_db;Configure src/main/resources/application.properties:
spring.datasource.url=jdbc:mysql://localhost:3306/flashcard_db
spring.datasource.username=your_username
spring.datasource.password=your_password
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=truemvn clean installmvn spring-boot:runYour API is now live at: http://localhost:8080 ๐
mvn testThese endpoints let you create and manage your flashcard decks.
POST /flashcards/create
Content-Type: application/json
{
"title": "Basic English",
"description": "Simple vocabulary words"
}Response: 201 CREATED
{
"id": 1,
"title": "Basic English",
"description": "Simple vocabulary words",
"cards": []
}GET /flashcardsResponse: Array of all your flashcard sets
[
{
"id": 1,
"title": "Basic English",
"description": "Simple vocabulary words",
"cards": [...]
}
]You can search by id, title, or description:
GET /flashcards/flashcard?id=1
GET /flashcards/flashcard?title=Basic English
GET /flashcards/flashcard?description=Simple vocabularyResponse: The matching flashcard set with all its cards
Find by id or title, then update:
PUT /flashcards/flashcard?id=1
Content-Type: application/json
{
"title": "Advanced English",
"description": "Complex vocabulary"
}Response: Updated flashcard set
Remove by id, title, or description:
DELETE /flashcards/flashcard?id=1
DELETE /flashcards/flashcard?title=Basic EnglishResponse: 200 OK with message "Flashcard deleted"
These endpoints let you add and manage individual cards within a deck.
Add a new card using the deck's ID:
POST /flashcards/1/card
Content-Type: application/json
{
"term": "Dog",
"definition": "Cachorro"
}Response: 201 CREATED
{
"id": 1,
"term": "Dog",
"definition": "Cachorro"
}Search by id, term, or definition:
GET /flashcards/card?id=1
GET /flashcards/card?term=Dog
GET /flashcards/card?definition=CachorroResponse: The matching card
Find by id, term, or definition, then update:
PUT /flashcards/card?id=1
Content-Type: application/json
{
"term": "House",
"definition": "Casa"
}Response: Updated card
Remove by id, term, or definition:
DELETE /flashcards/card?id=1
DELETE /flashcards/card?term=DogResponse: 200 OK with message "Card deleted successfully"
This is where the magic happens! These endpoints power the interactive learning experience.
What it does: Gives you a random card's term and 4 possible definitions to choose from. Perfect for quick practice!
How it works: The system picks a random card from your deck, shows you the term, and generates 3 wrong answers + 1 correct answer (shuffled randomly).
GET /game/multiple-choice?id=1
GET /game/multiple-choice?title=Basic EnglishResponse:
{
"term": "Dog",
"options": [
"Casa",
"Gato",
"Cachorro",
"Livro"
],
"correctAnswer": "Cachorro"
}Simple explanation: You get a term and 4 choices. Pick the right definition!
What it does: Gives you either a term or definition, and you have to type the answer yourself. Harder than multiple choice!
How it works: The system randomly picks a card and randomly decides whether to show you the term (you type the definition) or the definition (you type the term).
GET /game/typing/question?id=1
GET /game/typing/question?title=Basic EnglishResponse:
{
"question": "Dog",
"isTermQuestion": true
}- If
isTermQuestion: trueโ you saw the term, now type the definition - If
isTermQuestion: falseโ you saw the definition, now type the term
Simple explanation: You get a word/definition and must type the matching answer from memory.
What it does: After you type your answer, this checks if you got it right or wrong.
How it works: Send back the question, whether it was a term question, and your typed answer. The system compares your answer with the correct one.
POST /game/typing/check
Content-Type: application/json
{
"question": "Dog",
"isTermQuestion": true,
"answer": "Cachorro"
}Response:
{
"correct": true,
"correctAnswer": "Cachorro"
}correct: trueโ You got it right! ๐correct: falseโ Wrong answer, but you'll see what the correct one was
Simple explanation: Submit your typed answer and find out if you're right or wrong. If wrong, you'll see the correct answer.
This project follows separation of concerns like a sacred law:
๐ฆ Flashcard-App
โโโ ๐ฏ Controllers โ Your API gateway
โโโ ๐ผ Services โ Business logic lives here
โโโ ๐๏ธ Repositories โ Data access layer
โโโ ๐๏ธ Models โ Your domain entities
โโโ โ
Validators โ Keep chaos at bay
By creating this project, I learned:
- โ RESTful API design patterns
- โ Spring Boot ecosystem fluency
- โ JPA/Hibernate relationship management
- โ Clean architecture principles
- โ Request validation strategies
- โ Database modeling for real-world apps
- โ Game logic implementation
- โ DTO pattern usage
Found a bug? Have an idea? Want to add something else?
- Fork this repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
Built with โ and Spring Boot.