How houarizegai/quiz-app works
Project type and purpose
• This is a standalone desktop quiz application built with JavaFX.
• Purpose: Allow users to take Java‐based quizzes, fetch questions from a MySQL database, and display results.
High‐level file structure analysis
• pom.xml: Maven manages dependencies (JavaFX, JFoenix, FontAwesomeFX, Connector/J).
• src/main/java/com/houarizegai/quizappfx:
• App.java – entry point, starts JavaFX runtime
• controllers/ – JavaFX controllers (UI event handlers)
• dao/db/ – JDBC connection & DAO classes (MysqlConnection, QuestionDao)
• dao/vo/ – Value Objects (QuestionVo) representing data models
• src/main/resources:
• views/ – FXML layout files (About.fxml, JavaQuiz.fxml)
• css/ – style sheets applied to FXML views
• images/ – static assets for UI
• database/quiz_app_db.sql: SQL scripts to build and seed the MySQL quiz database
Main architectural components
a. Presentation Layer (JavaFX UI)
• FXML views + CSS styles
• Controllers handle user interactions and UI updates
b. Data Access Layer (DAO)
• MysqlConnection manages JDBC connection to MySQL
• QuestionDao executes SQL queries, maps result sets to QuestionVo
c. Domain Model
• QuestionVo represents quiz questions and answers
d. Database
• MySQL schema defined in quiz_app_db.sql
e. Application Launcher
• App.java initializes the JavaFX Application, loads the primary view
Relationships & data flow
1. User clicks a button in the JavaFX UI
2. Controller (e.g., JavaQuizController) receives the event
3. Controller calls QuestionDao via MysqlConnection
4. QuestionDao runs SQL, returns QuestionVo objects
5. Controller updates the UI with question data
6. User submits answer → Controller evaluates, shows results
Key architectural patterns & design principles
• Layered architecture: clear separation between UI, controllers, DAO, and database
• MVC-ish: FXML views (V), controllers (C), VO/DAO act as the Model layer
• Dependency injection via FXMLLoader for controllers and CSS for styling
• Single responsibility: each class focuses on one concern (UI logic vs. data access)
Technologies & frameworks to annotate
• JavaFX (UI framework)
• JFoenix + FontAwesomeFX (UI component libraries)
• JDBC Connector/J (database connectivity)
• Maven (build & dependency management)
• MySQL (relational database)
• All FXML views (Home, Quiz, About) and their controllers
• DAO classes and connection manager
• QuestionVo as the data contract between layers
• MySQL schema as an external system component
• Maven as the build/dependency layer (optional placement)