Skip to content

Commit 522a49d

Browse files
authored
Merge pull request #33 from NTUT-NPC/update-docs
2 parents dd2cf73 + 1b779b3 commit 522a49d

File tree

3 files changed

+58
-24
lines changed

3 files changed

+58
-24
lines changed

AGENTS.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,46 @@
22

33
Flutter 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)

CONTRIBUTING.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Contributing
2+
3+
## Commit Messages
4+
5+
Follow [Conventional Commits](https://www.conventionalcommits.org/):
6+
7+
```
8+
<type>[optional scope]: <description>
9+
```
10+
11+
**Types:** `feat`, `fix`, `chore`, `ci`, `test`, `docs`
12+
13+
**Scopes (optional):** `android`, `ios`
14+
15+
**Examples:**
16+
- `feat: add student query service`
17+
- `fix(android): resolve notification permission crash`
18+
- `docs: update architecture section`
19+
20+
## Branch Names
21+
22+
Use kebab-case: `add-student-query-service`, `fix-login-crash`

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ flutter run
3535

3636
**VS Code users:** See [.vscode/README.md](.vscode/README.md) for project-specific setup instructions.
3737

38+
**Contributors:** See [CONTRIBUTING.md](CONTRIBUTING.md) for commit and branch guidelines.
39+
3840
## Project Context
3941

4042
This project exists alongside two other implementations:

0 commit comments

Comments
 (0)