andoriyaprashant / andoriyaprashant/OpSo
feat: program data (GSoC, Summer of Bitcoin, etc.) is hardcoded in Dart files — adding or updating a program requires a code change and app release, making the data impossible to keep current without contributor intervention
- 主要语言
- Dart
- 星标
- 53
- 派生
- 108
- PR 合并指标
- 30 天内没有已合并 PR
描述
## 🚀 Problem Statement
OpSo stores open-source program information (organization names, stipend amounts, timeline dates, eligibility criteria) as hardcoded data in Dart files within `lib/`. When program details change — which happens every year (new application dates, updated stipends, new mentoring organizations) — the data goes stale without a new app release.
For example:
- GSoC stipend amounts change annually
- Application deadlines differ every year
- New programs are added (NSoC, ECSoC are listed in the repository but may not be in the app)
- Programs may be discontinued
This creates a maintenance burden that grows with each program added and makes the app a stale information source after each annual program cycle.
## Proposed Fix
Move program data to a JSON-based data layer that can be updated without an app release:
### Option A — Remote JSON data source (recommended for production)
Host a `programs.json` at a static URL (GitHub Pages or a CDN) and fetch it on app launch:
```dart
// lib/services/programs_service.dart
import 'package:http/http.dart' as http;
import 'dart:convert';
class ProgramsService {
static const String DATA_URL =
'https://andoriyaprashant.github.io/OpSo/data/programs.json';
Future> fetchPrograms() async {
try {
final response = await http.get(Uri.parse(DATA_URL));
if (response.statusCode == 200) {
final List data = json.decode(response.body);
return data.map((p) => Program.fromJson(p)).toList();
}
} catch (e) {
// Fall back to bundled data on network error
}
return _loadBundledData();
}
}
```
### Option B — Asset-based JSON (simpler, updates with each release)
Move data from Dart files to `assets/data/programs.json`:
```json
// assets/data/programs.json
[
{
"id": "gsoc",
"name": "Google Summer of Code",
"year": 2026,
"applicationStart": "2026-03-24",
"applicationEnd": "2026-04-08",
"stipendUSD": { "min": 1500, "max": 6600 },
"eligibility": "University students",
"organizationsUrl": "https://summerofcode.withgoogle.com/organizations"
}
]
```
This approach at minimum allows updating program data by editing one JSON file rather than touching Dart code.
### Data model update
```dart
// lib/models/program.dart
class Program {
final String id;
final String name;
final String year;
final DateTime? applicationStart;
final DateTime? applicationEnd;
final String eligibility;
Program.fromJson(Map json) : ...;
}
```
## Files to Create / Modify
| File | Change |
|---|---|
| `assets/data/programs.json` | New — externalized program data |
| `lib/services/programs_service.dart` | New — data loading service |
| `lib/` (program detail screens) | Update to consume `ProgramsService` |
| `pubspec.yaml` | Add assets entry for `assets/data/` |
**Suggested labels:** `enhancement`, `architecture`, `flutter`
I would like to work on this. Could you please assign it to me?
贡献指南
调研方向
Review the hardcoded program data in lib/ and the existing program detail screens, then inspect pubspec.yaml. Confirm with maintainers whether the remote or asset-based JSON option is intended; done means program records use the chosen data layer and the listed files are updated so details no longer depend on hardcoded Dart data.
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart, flutter
- 领域
- mobile
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 25/100