How revo2026/stla works
1. Overall shape
- This is a JavaFX desktop application for a learning platform, not a web app.
- The codebase is organized as a Clean Architecture stack: ui → services → patterns → data → domain, with core providing shared infrastructure and app providing startup/bootstrap.
2. Application entry and bootstrap
- com.stla.app.Launcher and com.stla.app.StlaApplication are the launch path into the JavaFX runtime.
- AppConfig acts as central configuration, likely reading environment values such as app size, titles, and Supabase credentials.
- Startup responsibilities are split from business logic, so the application shell is separate from feature workflows.
3. UI layer: role-based desktop screens
- com.stla.ui is split into auth, student, instructor, and admin controllers.
- Each subpackage maps to FXML screens under src/main/resources/com/stla/views/..., with styling in css/.
- The UI is heavily screen-driven: login/register, dashboards, course catalog/details, checkout, course player, quiz screens, wallet/withdrawal screens, and admin management views.
4. Core infrastructure and user context
- core.database.DatabaseConnection centralizes JDBC access, and the README indicates HikariCP is used for pooling.
- core.session.SessionManager holds the active user/session state across screens.
- core.navigation.NavigationManager and StudentNavigationContext manage view transitions and role-specific navigation flow, which matters in a desktop app where screens replace each other inside one window.
5. Service layer: business workflows
- com.stla.services contains the main orchestration layer: authentication, course/catalog, enrollment, quiz, payment, wallet, notifications, certificates, profile, reviews, learning progress, and admin dashboards.
- These services sit between UI controllers and repositories, so controllers do not talk directly to SQL.
- Feature workflows that span multiple subsystems—such as checkout, enrollment, quiz submission, or certificate issuance—are concentrated here.
6. Domain model and contracts
- com.stla.domain.models contains the business entities: Course, Enrollment, Quiz, QuizAttempt, Payment, Notification, WalletTransaction, WithdrawalRequest, Student, Instructor, Admin, and related composite/view models.
- com.stla.domain.enums defines the platform’s state vocabulary: roles, payment status, course status, verification status, notification type, resource type, and quiz/question types.
- com.stla.domain.interfaces defines repository contracts, keeping the domain independent from persistence details.
7. Data access and persistence
- com.stla.data.repositories contains repository implementations for the major aggregates: courses, lessons, sections, students, instructors, categories, quizzes, questions, notifications, profiles, enrollments, payments, progress, resources, wallets, and withdrawals.
- com.stla.data.mappers.ResultSetMapper indicates a manual JDBC-to-model mapping layer rather than an ORM.
- The backend database is Supabase PostgreSQL, and the repo includes stla.sql, which likely defines schema, tables, enums, triggers, and indexes.
8. External storage and media
- The app does not keep all content in memory or local files; it integrates with Supabase Storage via SupabaseStorageService and SupabaseStorageAdapter.
- This is used for uploaded course assets such as videos, thumbnails, and downloadable lesson resources.
- A video/ folder and LocalVideoHttpServer suggest a local video-serving path for playback or development support, separate from database persistence.
9. Payments, wallets, and withdrawals
- The payment subsystem is one of the main architectural flows: checkout triggers a strategy-based payment method, then enrollment creation, then wallet/commission allocation.
- patterns.strategy provides interchangeable payment and withdrawal behavior (Visa, Wallet, PayPal, withdrawal variants).
- PaymentService and WalletService coordinate the business rules, while repositories persist transactions, balances, and withdrawal requests.
- The architecture separates payment method choice from the downstream accounting workflow.
10. Event-driven notifications
- patterns.observer implements an in-process event bus using EventBus, AppEvent, and NotificationObserver.
- Many workflows can publish events—enrollment, payment, quiz submission, course approval, withdrawal status, certificate issuance—and notifications are then persisted and surfaced in the UI.
- This creates a loose coupling boundary: services raise events, observers react, and the notification UI reads the stored results.
11. Reusable GoF patterns used across business flows
- factory creates role-specific users or strategy instances.
- facade simplifies multi-step operations like enrollment and course publishing.
- decorator models composable course add-ons such as certificate, quiz, and mentor support.
- proxy enforces role-based or enrollment-based access control.
- adapter hides external service differences for payments and report/export behavior.
- singleton-style shared state is used for app-wide registries and managers.
12. Feature domains reflected in the UI
- The student area covers browsing, purchasing, learning, quizzes, progress, reviews, certificates, and notifications.
- The instructor area covers course authoring, quiz building, uploaded resources, revenue/wallet management, withdrawals, and analytics.
- The admin area covers user management, course review, category management, instructor verification, payments, withdrawals, and platform dashboards.
- This role separation is a major architectural boundary in both navigation and access control.
13. Typical end-to-end data flow
- A user action starts in a JavaFX controller, which calls a service.
- The service validates rules, may publish events, and calls one or more repositories.
- Repositories execute JDBC against Supabase PostgreSQL and map results back into domain models.
- The service returns data to the controller, which renders the FXML view and updates shared session/navigation state.
14. Testing and build
- The project uses Maven as the build/runtime entry point, and tests are written with JUnit 5.
- Tests in src/test/java/com/stla/patterns focus heavily on the GoF pattern implementations, which suggests those patterns are first-class architectural components rather than incidental utilities.
- There is also enum coverage in domain/EnumsTest, reinforcing that domain rules are treated as stable contract points.
15. What to emphasize in an architecture diagram
- Show the desktop UI as the top layer, split by roles.
- Show services as the orchestration layer in the middle.
- Show repositories and mapper-based JDBC persistence below that, connected to Supabase PostgreSQL and Supabase Storage.
- Show SessionManager, NavigationManager, and EventBus as cross-cutting infrastructure.
- Show payment, wallet, notification, and course-publishing flows as the main multi-component business pipelines.
Main entry points: student Student UI · repositories Repositories · WalletService.java Wallet & Notify · instructor Instructor UI
Components 28
App
JavaFX bootstrap and startup configuration
- Launcher · Starts the desktop application runtime
src/main/java/com/stla/app/Launcher.java - Stla App · Application shell and primary stage setup
src/main/java/com/stla/app/StlaApplication.java - App Config · Central application configuration and environment values
src/main/java/com/stla/app/AppConfig.java
UI
Role-based desktop screens and controllers
- Auth UI · Login and registration screens
src/main/java/com/stla/ui/auth - Student UI · Student flows for browsing, learning, and payment
src/main/java/com/stla/ui/student - Instructor UI · Instructor workflows for authoring and payouts
src/main/java/com/stla/ui/instructor - Admin UI · Administrative review, moderation, and management screens
src/main/java/com/stla/ui/admin
Services
Application workflows and orchestration
- Auth Service · Authentication and account lifecycle workflow
src/main/java/com/stla/services/AuthService.java - Course Service · Course catalog, details, and publishing workflows
src/main/java/com/stla/services/CourseService.java - Enroll & Pay · Checkout, enrollment, and payment orchestration
src/main/java/com/stla/services/EnrollmentService.java - Learning Flow · Quiz taking, progress tracking, and lesson playback support
src/main/java/com/stla/services/QuizService.java - Wallet & Notify · Wallet, withdrawals, notifications, and certificate issuance
src/main/java/com/stla/services/WalletService.java - Storage Service · Supabase Storage integration for course assets and downloads
src/main/java/com/stla/services/SupabaseStorageService.java
Core
Cross-cutting runtime infrastructure
- Session · Active user and role state shared across screens
src/main/java/com/stla/core/session/SessionManager.java - Navigation · View switching and role-aware navigation context
src/main/java/com/stla/core/navigation/NavigationManager.java - DB Connection · Central JDBC access and pooled database connection management
src/main/java/com/stla/core/database/DatabaseConnection.java
Data
JDBC persistence and mapping
- Result Mapper · Manual ResultSet to domain model mapping
src/main/java/com/stla/data/mappers/ResultSetMapper.java - Repositories · Repository implementations for platform aggregates
src/main/java/com/stla/data/repositories
Domain
Business models, enums, and repository contracts
- Domain Models · Courses, users, payments, quizzes, wallets, and related models
src/main/java/com/stla/domain/models - Repo Contracts · Repository interfaces that decouple services from persistence
src/main/java/com/stla/domain/interfaces - Domain Enums · Shared business vocabulary for roles, status, and types
src/main/java/com/stla/domain/enums
Patterns
Reusable GoF pattern implementations
- Event Bus · In-process event publication and notification fan-out
src/main/java/com/stla/patterns/observer/EventBus.java - Strategies · Interchangeable payment and withdrawal behaviors
src/main/java/com/stla/patterns/strategy/PaymentStrategyFactory.java - Facades · Multi-step business workflow simplification
src/main/java/com/stla/patterns/facade/EnrollmentFacade.java - Access Proxies · Role and enrollment based access control
src/main/java/com/stla/patterns/proxy/AccessControlProxy.java
External
Database and storage integrations
- Supabase PostgreSQL · Primary relational backend defined by the SQL schema
stla.sql - Supabase Storage · Remote storage for videos, thumbnails, and resources
video - Local Video Server · Local HTTP video serving path for playback support
src/main/java/com/stla/ui/components/LocalVideoHttpServer.java
Connections 39
- Launcher → Stla App: launches · Bootstraps the JavaFX application runtime
- Stla App → App Config: reads · Loads app size, titles, and environment settings
- Stla App → Auth UI: opens · Starts the authentication entry screens
- Stla App → Session: initializes · Creates shared user state for the desktop session
- Auth UI → Auth Service: calls · Delegates login and registration workflows
- Auth Service → Repositories: queries · Loads and persists user account data
- Auth Service → Domain Models: uses · Works with user and profile entities
- Student UI → Course Service: calls · Requests catalog, details, and learning content
- Student UI → Enroll & Pay: calls · Drives checkout and purchase flow
- Student UI → Learning Flow: calls · Submits quizzes and reads progress
- Student UI → Wallet & Notify: reads · Shows notifications, certificates, and wallet-related views
- Instructor UI → Course Service: calls · Creates and publishes courses
- Instructor UI → Learning Flow: calls · Builds quizzes and monitors learning outcomes
- Instructor UI → Wallet & Notify: calls · Handles wallet balance and withdrawal screens
- Admin UI → Wallet & Notify: calls · Reviews payments, withdrawals, and notifications
- Admin UI → Course Service: reviews · Manages course approval and moderation
- Course Service → Facades: orchestrates · Uses facades to coordinate publishing and enrollment steps
- Enroll & Pay → Strategies: selects · Chooses payment method and downstream withdrawal behavior
- Enroll & Pay → Event Bus: publishes · Emits enrollment and payment events
- Wallet & Notify → Event Bus: subscribes · Consumes events to persist notifications
- Wallet & Notify → Strategies: selects · Applies wallet and withdrawal strategies
- Learning Flow → Access Proxies: guards · Enforces access to courses and learning content
- Course Service → Storage Service: stores · Uploads thumbnails, videos, and resources
- Storage Service → Supabase Storage: uses · Persists and retrieves remote media assets
- Repositories → DB Connection: executes · Runs JDBC queries through the shared connection
- Repositories → Result Mapper: maps · Converts ResultSet rows into domain objects
- Repositories → Supabase PostgreSQL: persists · Reads and writes platform data in PostgreSQL
- Repositories → Repo Contracts: implements · Fulfills repository interfaces from the domain layer
- Repositories → Domain Models: returns · Materializes business entities and views
- Repo Contracts → Domain Models: defines · Contracts are shaped by the domain model
- Domain Models → Domain Enums: uses · Entity states rely on shared enums
- Student UI → Navigation: switches · Moves between screens within one window
- Instructor UI → Navigation: switches · Routes through instructor flows
- Admin UI → Navigation: switches · Routes through admin flows
- Student UI → Session: reads · Uses active user and role context
- Instructor UI → Session: reads · Uses active user and role context
- Admin UI → Session: reads · Uses active user and role context
- Event Bus → Wallet & Notify: notifies · Feeds observers that persist notifications
- Local Video Server → Student UI: feeds · Supports in-app video playback and previews