22
33Flutter app for NTUT students: course schedules, scores, enrollment, announcements.
44
5+ Follow @CONTRIBUTING .md for git operation guidelines.
6+
7+ ** Last updated:** 2026-02-02. If stale (>30 days), verify Status section against codebase.
8+
59## Status
610
711** Done:**
812- PortalService (auth+SSO), CourseService (HTML parsing), ISchoolPlusService (getStudents, getMaterials, getMaterial)
913- HTTP utils, InvalidCookieFilter interceptor
1014- Drift database schema with all tables
11- - UserRepository, CourseRepository, ISchoolPlusRepository (repository pattern implementation)
1215- Service DTOs migrated to Dart 3 records
16+ - Service integration tests (copy ` test/test_config.json.example ` to ` test/test_config.json ` , then run ` flutter test --dart-define-from-file=test/test_config.json ` )
1317
14- ** Todo - Data Layer:**
18+ ** Todo - Service Layer:**
1519- ISchoolPlusService: getCourseAnnouncement, getCourseAnnouncementDetail, courseSubscribe, getCourseSubscribe, getSubscribeNotice
16- - ScoreService: grade retrieval, GPA calc
17- - ScoreRepository
20+ - CourseService: getDepartmentMap, getCourseCategory (syllabus)
21+ - StudentQueryService (sa_003_oauth - 學生查詢專區):
22+ - getStudentStatus (學籍資料查詢)
23+ - getAcademicPerformance (學業成績查詢)
24+ - getGradeRanking (學業成績排名查詢)
25+ - getGPA (學期及歷年GPA查詢)
26+ - getMidtermWarnings (期中預警查詢)
27+ - getStudentAffairs (獎懲、缺曠課、請假查詢)
28+ - getGeneralEducationDimension (查詢已修讀博雅課程向度)
29+ - getEnglishProficiency (查詢英語畢業門檻登錄資料)
30+ - getClassAndMentor (註冊編班與導師查詢)
31+ - getGraduationQualifications (查詢畢業資格審查)
32+ - StudentQueryRepository
33+ - PortalService: getCalendar, changePassword
1834
1935** Todo - App:**
20- - Secure storage (flutter_secure_storage)
21- - State management (Riverpod/Bloc/Provider)
22- - go_router + auth guards
36+ - State management (Riverpod/Bloc)
37+ - Page routing
2338- UI: login, course table, course detail, scores, profile
2439- i18n (zh_TW, en_US)
25- - Testing
26- - File downloads
40+ - File downloads (progress tracking, notifications, cancellation)
2741
2842## Architecture
2943
30- Following Flutter's official architecture guide (layered architecture):
31-
32- ```
33- UI Layer (Widgets)
34- ↓
35- Repository Layer (Business Logic + Coordination)
36- ↓
37- Service Layer (HTTP) + Database Layer (Drift/SQLite)
38- ```
44+ MVVM pattern: UI (Widgets) → Repositories (business logic) → Services (HTTP) + Database (Drift)
3945
4046** Structure:**
4147- ` lib/models/ ` - Shared domain enums (DayOfWeek, Period, CourseType)
@@ -54,13 +60,17 @@ Service Layer (HTTP) + Database Layer (Drift/SQLite)
5460- ** DTOs** : Dart records defined in service files - lightweight data transfer objects
5561- ** Domain models** : Drift entities or custom query result classes - what UI consumes
5662
57- ** Services:** PortalService, CourseService, ISchoolPlusService, ScoreService
63+ ** Services:**
64+ - PortalService - Portal auth, SSO
65+ - CourseService - 課程系統 (` aa_0010-oauth ` )
66+ - ISchoolPlusService - 北科i學園PLUS (` ischool_plus_oauth ` )
67+ - StudentQueryService (TODO) - 學生查詢專區 (` sa_003_oauth ` )
68+ - Design principle: Match NTUT's actual system boundaries. Each service corresponds to one NTUT SSO target.
5869- All share single cookie jar (NTUT session state)
59- - PortalService handles SSO for scoreService, courseService, iSchoolPlusService
6070- Return DTOs as records (UserDTO, SemesterDTO, ScheduleDTO, etc.) - no database writes
6171- DTOs are typedef'd records co-located with service implementation
6272
63- ** Repositories:** UserRepository, CourseRepository, ISchoolPlusRepository, ScoreRepository (TODO)
73+ ** Repositories:** (TODO)
6474- Transform DTOs into relational DB tables
6575- Return DTOs or domain models to UI
6676- Handle data persistence and caching strategies
@@ -83,7 +93,7 @@ Service Layer (HTTP) + Database Layer (Drift/SQLite)
8393
8494** Shared Cookie Jar:** Single cookie jar across all clients for simpler implementation.
8595
86- ** SSO Flow:** PortalClient centralizes auth for 3 separate NTUT services.
96+ ** SSO Flow:** PortalService centralizes auth services.
8797
8898** User-Agent:** Emulate NTUT iOS app requests.
8999
@@ -95,8 +105,8 @@ All available SSO service codes from nportal.ntut.edu.tw (50 total):
95105
96106#### 教務系統 (Academic Affairs - aa)
97107- ` aa_0010-oauth ` - 課程系統 (Course System)
98- - ` aa_003_LB_oauth ` - 學業成績查詢專區 (Grade Inquiry)
99- - ` aa_003_oauth ` - 學業成績查詢專區[ 二機] (Grade Inquiry - Server 2)
108+ - ` aa_003_LB_oauth ` - 學業成績查詢專區 (Grade Inquiry) - redirects to ` sa_003_oauth `
109+ - ` aa_003_oauth ` - 學業成績查詢專區[ 二機] (Grade Inquiry - Server 2) - redirects to ` sa_003_oauth `
100110- ` aa_StuPhoto_oauth ` - 新生電子大頭照上傳系統 (New Student Photo Upload)
101111- ` aa_016_oauth ` - 新生網路選課系統 (Freshman Course Selection)
102112- ` aa_017_oauth ` - 新生網路選課系統[ 二機] (Freshman Course Selection - Server 2)
0 commit comments