How d3nhatv0lam/ctuschedule works
Project type and purpose
• This is a Windows desktop scheduling application built on .NET 8.0 with Avalonia UI (AXAML files), following the MVVM (Model-View-ViewModel) pattern.
• Purpose: Help CTU students fetch course data from the CTU HTQL web system, allow them to pick and store course groups, automatically build a timetable, and refresh group capacities.
File structure
• Top-level: CTUschedule solution and project, assets folder (fonts, images, styles), README, and application executable manifest.
• CTUschedule folder layers:
• App.axaml & Program.cs: Application bootstrap / entry point.
• Views (AXAML + code-behind): UI definitions.
• ViewModels: Presentation logic and data binding.
• Models: Domain entities (CourseNode, ScheduleCell, etc.).
• Converter: ValueConverters for XAML bindings.
• Utilities: Infrastructure and helpers (web driver to CTU HTQL, Internet checker, binary search, disposal behaviors).
• Resources/Dialogs: Reusable dialog interfaces and views.
• ViewLocator.cs: MVVM wiring.
• No internal database – data flows in memory and possibly saved in local storage or simple files (not shown here).
README
• Confirms MVVM desktop app, requires internet, logs into CTU’s system via student account, fetches and updates group capacities.
• Future features include export to Excel/images and auto-registration.
a. Main components:
• Presentation Layer:
– Views (AXAML + code-behind)
– Styles & Fonts in Assets
• Presentation Logic:
– ViewModels
– Converters (for data formatting in XAML)
– ViewLocator (resolves views ↔ viewmodels)
• Domain Layer:
– Models (CourseListData, ScheduleCell, CourseNode, etc.)
• Infrastructure Layer:
– Utilities (CTU_HTQLWebDriver for HTTP/WebDriver calls, CheckerInternetHelper, CourseNodeBinarySearch, DisposeBehavior)
– Dialog infrastructure (INotificationPopup, NotificationPopup.axaml)
• External System: CTU HTQL web service (authentication, course group data endpoints)
b. Relationships & data flow:
1. User action in a View (e.g., click “Fetch Groups”)
2. Command bound to a ViewModel method
3. ViewModel invokes Utilities.CTU_HTQLWebDriver → sends HTTP/webdriver request to CTU HTQL, awaiting response
4. Response parsed into Domain Models
5. ViewModel updates Models, raises PropertyChanged → View updates via data binding and Converters
6. On “Save” or “Refresh”, ViewModel triggers another utility call to push data back to CTU HTQL
7. NotificationPopup shown via Dialog infrastructure on success/failure
c. Architectural patterns & principles:
• MVVM for clear separation: Views ←→ ViewModels ←→ Models
• Dependency injection likely via ViewLocator or service locators
• Single Responsibility: Converters only format data, Utilities only handle I/O
• Layered architecture: Presentation / Domain / Infrastructure
d. Technologies/frameworks/libraries:
• .NET 8.0, Avalonia UI (AXAML)
• C#
• WebDriver or HttpClient (in CTU_HTQLWebDriver)
• INotifyPropertyChanged for ViewModelBase
Detail
• Essential subsystems: Converters, Dialogs, Utilities.
• Important classes (ViewLocator, Program.cs) showing startup flow.