How vodinhluan/flashwizapp works
Based on your project’s file tree and README, FlashWizApp is a full-stack mobile learning application that uses flashcards to help users learn English. It consists of two main parts:
1. The back-end (“FlashWizBE”): a server-side application built in Java (using Spring Boot conventions, Gradle build scripts, and a modular structure with dedicated projects for authentication, password change, etc.) that exposes REST endpoints and communicates with a MySQL database.
2. The front-end (“FlashWiz_FrontEnd”): an Android application (written in Kotlin) following an MVVM architecture pattern with clear separation of UI (Activities, Composables), presentation (ViewModels), use cases, and data layers (repositories and remote API services).
Start by outlining your main system components
• Mobile Frontend:
• Android App UI components (Activities, Fragments, Composables under the “presentation” and “ui” packages)
• ViewModels and state management (see “presentation/viewmodel” and “presentation/state”)
• Domain layer (use cases, repository interfaces), and Data layer (repository implementations, Retrofit API client from “data/remote”)
• Dependency Injection modules (the “di” package) that bind the dependencies
• Back-End Server:
• Controllers handling incoming REST API calls (located in the “controller” package)
• Models representing data objects (in the “model” package)
• Services/DAO components that implement business logic (in the “service” packages)
• Data access repositories (in the “repository” package)
• Security modules (JWT utilities, security configuration, etc.)
• A configuration file (application.properties) that configures the database (MySQL) and other settings
• Database:
• MySQL database which is configured via the backend’s application.properties file
• External Services:
• For the front-end, you have Firebase Messaging and other Android-specific integrations (e.g., Google Services)
• Additionally, any external authentication providers or push notification services to be noted if applicable.
Relationships and Data Flows
• From the Android App to the Back-End: API calls via Retrofit to endpoints managed by controllers.
• From the “controller” layer in the back-end to the “service/DAO” layer for processing business logic.
• From the “service/DAO” layer to the “repository” layer for database interactions.
• Dependency injection flows in the Android app (via modules) to bind view models with repositories and use cases.
• Security flows: The authentication entry points where the Android app sends login or register requests to the backend security endpoints, which then use JWT token generation and verification.
Architectural Patterns and Principles
• Separation of concerns between the mobile client (presentation, domain, data) and server (controllers, services, repositories).
• Use of the Model-View-ViewModel (MVVM) pattern in the Android app.
• In the backend, show how the layered structure (Controller -> Service -> Repository -> Database) is maintained.
• Mention the use of Dependency Injection both in the Android app (DI modules) and on the server side (likely via Spring’s DI container).
Incorporate Relevant Technologies
• Backend: Java, Spring Boot, Gradle, MySQL, JWT-based authentication, RESTful API design.
• Frontend: Android (Kotlin), Retrofit for API consumption, Jetpack Compose (or traditional Android components, as evidenced by the “presentation” and “ui” directories), Firebase Messaging for push notifications.
• Build and configuration tools: Gradle scripts, configuration files like application.properties for the backend and google-services.json for the Android app.
• "Android Frontend" block segmented into UI, ViewModel, Domain, Data, and DI layers.
• "FlashWiz Server" block segmented into Controllers, Services/DAOs, Repositories, Security, and Configuration.
• A separate "MySQL Database" block.
• Optionally, an "External Services" block that includes Firebase Messaging and other integrations.
• Use rounded rectangles for client-side components.
• Standard rectangles for back-end modules.