This project is a console-based Flashcards application built in Java, supporting translations between Polish, English, and German. It implements various Spring features such as Dependency Injection, IoC Container, Profiles, and YAML-based configuration.
The goal of the project is to demonstrate proficiency in:
- Java OOP design
- Application configuration
- Separation of concerns and SOLID principles (notably Dependency Inversion Principle)
- Practical usage of Spring Profiles, Configuration classes, and Property injection
The flashcards app allows users to:
- Add new words to a multilingual dictionary
- View all entries with display formats controlled by profiles
- Take interactive translation quizzes (user inputs are case-insensitive)
Represents a word translation between Polish, English, and German.
Acts as the in-memory store for Entry objects.
Responsible for reading words from a CSV file and loading them into the repository.
Handles business logic and interaction with the user through the console.
Main class to start the application.
Behavior changes based on active Spring profile:
default: Displays words as they appear in the CSVuppercase: Displays all words in CAPITAL LETTERSlowercase: Displays all words in lowercase
- ✅ Add a new word to the dictionary
- ✅ Display all words in a selected format (controlled via Spring profiles)
- ✅ Quiz mode: Test the user's knowledge by prompting them to translate a random word into the other two languages
- ✅ Case-insensitive matching for quiz answers
| Concept | Usage |
|---|---|
| Dependency Injection | Injecting service and repository dependencies |
| Dependency Inversion Principle (DIP) | Business logic depends on abstractions rather than implementations |
| IoC Container | Application context controls object creation |
| Spring Profiles | Change display behavior (original, uppercase, lowercase) |
| YAML Configuration | App configured via application.yml |
| External Properties | File path configured via external property: pl.edu.pja.tpo02.filename |
| Custom App Banner | Uses contents of logo-app file for startup banner |
spring:
profiles:
active: uppercase
pl:
edu:
pja:
tpo02:
filename: data/words.csv- Ensure you have a compatible Spring setup (or manually wire dependencies if Spring Boot is not used).
- Place your
logo-appfile (no extension) in the root directory. - Set the profile and filename in
application.yml. - Run the
FlashcardsApp.javaclass.
=== Flashcards App ===
1. Add a new word
2. Show all words
3. Take a translation test
0. Exitkot,cat,Katze
pies,dog,Hund
+---------------------+
| FlashcardsApp | <-- entry point
+---------------------+
|
v
+--------------------------+
| FlashcardsController |
+--------------------------+
| |
v v
+------------+ +-------------+
| FileService| |EntryRepository|
+------------+ +-------------+
^
|
+-------------+
| Entry |
+-------------+
Profile-specific display format logic is injected into FlashcardsController via Spring Profiles.
- The app is designed using SOLID principles.
- Display behavior is fully dynamic and controlled by profiles.
- Supports external customization via
application.yml. - The banner and file path are both configurable and decoupled from the core logic.
Built with ❤️ for educational purposes.