How I built a cross-platform contest tracking app with Flutter, tracking contests from Codeforces, CodeChef, and LeetCode.
As a competitive programmer, I constantly needed to check multiple platforms for upcoming contests. I wanted a single app that aggregates contests from Codeforces, CodeChef, and LeetCode.
I followed a clean architecture pattern:
class ContestRepository {
final List<ContestSource> sources;
Future<List<Contest>> getAllContests() async {
final contests = await Future.wait(
sources.map((source) => source.fetchContests()),
);
return contests.expand((list) => list).toList()
..sort((a, b) => a.startTime.compareTo(b.startTime));
}
}
Each platform has its own source implementation, making it easy to add new platforms.
The biggest challenge was normalizing data from different APIs. Each platform has its own format for contest durations, start times, and difficulty ratings. I created a unified model that handles all variations.