Skip to content

Commit

Permalink
v3.0.0
Browse files Browse the repository at this point in the history
Merge pull request #64 from opxdelwin/dev
  • Loading branch information
opxdelwin authored Jul 11, 2024
2 parents 84c9b6a + d87e53e commit 1791c3b
Show file tree
Hide file tree
Showing 52 changed files with 1,096 additions and 395 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ We appreciate your interest in contributing to Plan Sync and helping to make it

5. **Review and Double-Check**: Before submitting your JSON file, review it to make sure all the information is correct. This will help us maintain the quality of data in Plan Sync.

6. **Send Us Your JSON File**: Once you've completed the JSON template, send it as an attachment to [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com). Please include your name and contact information in the email so that we can credit you for your contribution.
6. **Send Us Your JSON File**: Once you've completed the JSON template, send it as an attachment to [connect@plansync.in](mailto:connect@plansync.in). Please include your name and contact information in the email so that we can credit you for your contribution.

7. **Verification**: Our team will review the JSON file you submitted for accuracy and completeness. If any corrections are needed, we will communicate with you to make the necessary adjustments.

Expand Down Expand Up @@ -182,6 +182,6 @@ Best regards,

Thank you for contributing to Plan Sync and helping to create a valuable resource for college students. Your efforts are greatly appreciated!

If you have any questions or need assistance with the contribution process, please don't hesitate to reach out to us at [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
If you have any questions or need assistance with the contribution process, please don't hesitate to reach out to us at [connect@plansync.in](mailto:connect@plansync.in).

Happy scheduling!
4 changes: 2 additions & 2 deletions DELETE_ACCOUNT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
We're sorry to see you go, but if you've made up your mind, we're here to help you delete your Plan Sync account. Please follow these simple steps:

1. **Send an Email:**
- From the email address associated with your Plan Sync account, send an email to: [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
- From the email address associated with your Plan Sync account, send an email to: [connect@plansync.in](mailto:connect@plansync.in).

2. **Subject: Account Deletion Request**
- In the subject line, please mention: "Account Deletion Request."
Expand All @@ -15,7 +15,7 @@ We're sorry to see you go, but if you've made up your mind, we're here to help y
4. **Confirmation:**
- You'll receive a confirmation email once your account deletion request is processed. This may take a few business days.

If you have any concerns or issues, feel free to reach out to us at [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
If you have any concerns or issues, feel free to reach out to us at [connect@plansync.in](mailto:connect@plansync.in).

Thank you for being a part of Plan Sync. We hope to see you again in the future.

Expand Down
2 changes: 1 addition & 1 deletion ERROR_REPORTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ You can opt-in your request via **GitHub Issues** (preferred) or via **mail**, a

If you are not familiar with GitHub or prefer email communication, please follow these steps:

1. **Compose an Email**: Send an email to [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
1. **Compose an Email**: Send an email to [connect@plansync.in](mailto:connect@plansync.in).

2. **Subject**: Use a descriptive subject line that summarizes the issue or modification request.

Expand Down
4 changes: 2 additions & 2 deletions PRIVACY-POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Welcome to [Plan Sync] ("the App"). Your privacy is important to us, and we are

## Your Choices

- You may have the right to access, correct, or delete your personal information. Contact us at [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com) for assistance.
- You may have the right to access, correct, or delete your personal information. Contact us at [connect@plansync.in](mailto:connect@plansync.in) for assistance.
- You can opt-out of receiving promotional emails by following the instructions in the email.

## Changes to This Privacy Policy
Expand All @@ -48,4 +48,4 @@ Welcome to [Plan Sync] ("the App"). Your privacy is important to us, and we are

## Contact Us

If you have any questions or concerns about this Privacy Policy, please contact us at [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
If you have any questions or concerns about this Privacy Policy, please contact us at [connect@plansync.in](mailto:connect@plansync.in).
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Every student should have access to an efficient timetable review tool without a

## Contact Us

If you have any questions, suggestions, or need assistance, feel free to reach out to us. You can contact our team at [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
If you have any questions, suggestions, or need assistance, feel free to reach out to us. You can contact our team at [connect@plansync.in](mailto:connect@plansync.in).

Thank you for choosing Plan Sync as your college timetable companion! We look forward to helping you stay organized and make the most of your college experience.

2 changes: 1 addition & 1 deletion TERMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ We reserve the right to modify or revise these Terms at any time. Your continued

## 9. Contact Us

If you have any questions or concerns regarding these Terms and Conditions, please contact us at [connect.plansync@gmail.com](mailto:connect.plansync@gmail.com).
If you have any questions or concerns regarding these Terms and Conditions, please contact us at [connect@plansync.in](mailto:connect@plansync.in).

6 changes: 3 additions & 3 deletions client-app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if (keystorePropertiesFile.exists()) {

android {
namespace "com.example.plan_sync"
compileSdkVersion flutter.compileSdkVersion
compileSdkVersion 33
ndkVersion "25.1.8937393"

compileOptions {
Expand Down Expand Up @@ -77,10 +77,10 @@ android {
signingConfig signingConfigs.release
}
}

lintOptions {
lint {
abortOnError false
}

}

flutter {
Expand Down
4 changes: 2 additions & 2 deletions client-app/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
buildscript {
ext.kotlin_version = '1.7.10'
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.google.gms:google-services:4.3.14'

classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
Binary file added client-app/assets/logo-no-background-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
1 change: 1 addition & 0 deletions client-app/assets/lottie/graph_animation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"nm":"Stat Chart","ddd":0,"h":500,"w":500,"meta":{"g":"@lottiefiles/creator 1.11.0"},"layers":[{"ty":4,"nm":"Green","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,87.5]},"s":{"a":1,"k":[{"o":{"x":0,"y":0},"i":{"x":0.36,"y":1},"s":[100,100],"t":0},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,75],"t":15},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,50],"t":45},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,85],"t":75},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,25],"t":105},{"s":[100,100],"t":135}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[340,400]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"rc","bm":0,"hd":false,"nm":"Green","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":10},"s":{"a":0,"k":[50,175]}},{"ty":"fl","bm":0,"hd":false,"nm":"Fill","c":{"a":0,"k":[0.2588,1,0.4941]},"r":2,"o":{"a":0,"k":100}}],"ind":1},{"ty":4,"nm":"Yellow","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,125]},"s":{"a":1,"k":[{"o":{"x":0,"y":0},"i":{"x":0.36,"y":1},"s":[100,100],"t":0},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,25],"t":30},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,75],"t":60},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,10],"t":90},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,50],"t":120},{"s":[100,100],"t":149}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[270,400]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"rc","bm":0,"hd":false,"nm":"Yellow","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":10},"s":{"a":0,"k":[50,250]}},{"ty":"fl","bm":0,"hd":false,"nm":"Fill","c":{"a":0,"k":[1,0.7961,0.3608]},"r":2,"o":{"a":0,"k":100}}],"ind":2},{"ty":4,"nm":"Blue","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,100]},"s":{"a":1,"k":[{"o":{"x":0,"y":0},"i":{"x":0.36,"y":1},"s":[100,100],"t":0},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,50],"t":15},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,75],"t":45},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,125],"t":75},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,25],"t":105},{"s":[100,100],"t":135}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[200,400]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"rc","bm":0,"hd":false,"nm":"Blue","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":10},"s":{"a":0,"k":[50,200]}},{"ty":"fl","bm":0,"hd":false,"nm":"Fill","c":{"a":0,"k":[0.3333,0.6863,0.9059]},"r":2,"o":{"a":0,"k":100}}],"ind":3},{"ty":4,"nm":"Red","sr":1,"st":0,"op":150,"ip":0,"hd":false,"ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,150]},"s":{"a":1,"k":[{"o":{"x":0,"y":0},"i":{"x":0.36,"y":1},"s":[100,100],"t":0},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,70],"t":30},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,25],"t":60},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,50],"t":90},{"o":{"x":0.22,"y":0.61},"i":{"x":0.36,"y":1},"s":[100,10],"t":120},{"s":[100,99],"t":149}]},"sk":{"a":0,"k":0},"p":{"a":0,"k":[130,400]},"r":{"a":0,"k":0},"sa":{"a":0,"k":0},"o":{"a":0,"k":100}},"shapes":[{"ty":"rc","bm":0,"hd":false,"nm":"Red","d":1,"p":{"a":0,"k":[0,0]},"r":{"a":0,"k":10},"s":{"a":0,"k":[50,300]}},{"ty":"fl","bm":0,"hd":false,"nm":"Fill","c":{"a":0,"k":[1,0.4,0.4]},"r":2,"o":{"a":0,"k":100}}],"ind":4}],"v":"5.7.0","fr":30,"op":150,"ip":0,"assets":[]}
37 changes: 37 additions & 0 deletions client-app/lib/backend/models/timetable.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import 'package:plan_sync/backend/models/timetable_meta.dart';
import 'package:plan_sync/backend/models/timetable_schedule_entry.dart';
import 'dart:convert';

class Timetable {
final TimetableMeta meta;
final Map<String, List<ScheduleEntry>> data;

Timetable({required this.meta, required this.data});

factory Timetable.fromJson(Map<String, dynamic> json) {
return Timetable(
meta: TimetableMeta.fromJson(json['meta']),
data: (json['data'] as Map<String, dynamic>).map(
(key, value) => MapEntry(
key,
(value as List<dynamic>)
.map((e) => ScheduleEntry.fromJson(e))
.toList(),
),
),
);
}

Map<String, dynamic> toJson() {
return {
'meta': meta.toJson(),
'data': data.map((key, value) =>
MapEntry(key, value.map((entry) => entry.toJson()).toList())),
};
}

static Timetable parse(String jsonString) {
final Map<String, dynamic> jsonMap = json.decode(jsonString);
return Timetable.fromJson(jsonMap);
}
}
43 changes: 43 additions & 0 deletions client-app/lib/backend/models/timetable_meta.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
class TimetableMeta {
final String? section;
final String? type;
final String? revision;
final String? effectiveDate;
final String? contributor;
final String? name;
final bool? isTimetableUpdating;

TimetableMeta({
this.section,
this.type,
this.revision,
this.effectiveDate,
this.contributor,
this.isTimetableUpdating,
this.name,
});

factory TimetableMeta.fromJson(Map<String, dynamic> json) {
return TimetableMeta(
section: json['section'],
type: json['type'],
revision: json['revision'],
effectiveDate: json['effective-date'],
contributor: json['contributor'],
isTimetableUpdating: json['isTimetableUpdating'],
name: json['name'],
);
}

Map<String, dynamic> toJson() {
return {
'section': section,
'type': type,
'revision': revision,
'effective-date': effectiveDate,
'contributor': contributor,
'isTimetableUpdating': isTimetableUpdating,
'name': name,
};
}
}
27 changes: 27 additions & 0 deletions client-app/lib/backend/models/timetable_schedule_entry.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class ScheduleEntry {
final String? subject;
final String? room;
final String? time;

ScheduleEntry({
this.subject,
this.room,
this.time,
});

factory ScheduleEntry.fromJson(Map<String, dynamic> json) {
return ScheduleEntry(
subject: json['subject'],
room: json['room'],
time: json['time'],
);
}

Map<String, dynamic> toJson() {
return {
'subject': subject,
'room': room,
'time': time,
};
}
}
6 changes: 6 additions & 0 deletions client-app/lib/controllers/app_preferences_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ class AppPreferencesController extends GetxController {

Future<bool> savePrimaryElectiveYearPreference(String data) async =>
await perfs.setString('elective-primary-year', data);

Future<bool> saveIsAppBelowMinVersion(bool status) async =>
await perfs.setBool('is-app-below-minVersion', status);

bool isAppBelowMinVersion() =>
perfs.getBool('is-app-below-minVersion') ?? false;
}
11 changes: 10 additions & 1 deletion client-app/lib/controllers/filter_controller.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:get/get.dart';
import 'package:plan_sync/controllers/app_preferences_controller.dart';
import 'package:plan_sync/controllers/git_service.dart';
import 'package:plan_sync/util/enums.dart';
import 'package:plan_sync/util/logger.dart';
import 'package:plan_sync/util/snackbar.dart';
import 'package:collection/collection.dart';
Expand Down Expand Up @@ -71,13 +72,21 @@ class FilterController extends GetxController {
update();
}

late Weekday _weekday;
Weekday get weekday => _weekday;
set weekday(Weekday newWeekday) {
_weekday = newWeekday;
update();
}

late GitService service;
late AppPreferencesController preferences;

@override
onInit() async {
service = Get.find();
preferences = Get.find();
_weekday = Weekday.today();
super.onInit();
}

Expand Down Expand Up @@ -357,7 +366,7 @@ class FilterController extends GetxController {

if (service.electiveYears?.contains(primaryElectiveYear) != false &&
primaryElectiveYear != null) {
service.selectedElectiveYear = int.parse(primaryElectiveYear!);
service.selectedElectiveYear = primaryElectiveYear!;
}
}
}
47 changes: 40 additions & 7 deletions client-app/lib/controllers/git_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:dio/dio.dart';
import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import 'package:plan_sync/backend/models/timetable.dart';
import 'package:plan_sync/controllers/filter_controller.dart';
import 'package:plan_sync/util/logger.dart';
import 'package:plan_sync/util/snackbar.dart';
Expand Down Expand Up @@ -32,9 +33,9 @@ class GitService extends GetxController {
// elective year
List<String>? electiveYears;

RxInt? _selectedElectiveYear;
int? get selectedElectiveYear => _selectedElectiveYear?.value;
set selectedElectiveYear(int? newYear) {
RxString? _selectedElectiveYear;
String? get selectedElectiveYear => _selectedElectiveYear?.value;
set selectedElectiveYear(String? newYear) {
if (newYear == null || selectedElectiveYear == newYear) {
return;
}
Expand Down Expand Up @@ -276,7 +277,7 @@ class GitService extends GetxController {
}

/// Gets concurrent timetable for unique semester and section.
Future<Map<String, dynamic>?> getTimeTable() async {
Future<Timetable?> getTimeTable() async {
FilterController filterController = Get.find();
final section = filterController.activeSectionCode;
final semester = filterController.activeSemester;
Expand All @@ -296,7 +297,7 @@ class GitService extends GetxController {
}

!isWorking.value ? null : isWorking.toggle();
return jsonDecode(response.data) as Map<String, dynamic>;
return Timetable.fromJson(jsonDecode(response.data));
} on DioException catch (e) {
errorDetails = {
'error': 'DioException',
Expand Down Expand Up @@ -470,7 +471,7 @@ class GitService extends GetxController {
}

/// Gets concurrent elective timetable for unique semester and section.
Future<Map<String, dynamic>?> getElectives() async {
Future<Timetable?> getElectives() async {
isWorking.value ? null : isWorking.toggle();

if (filterController.activeElectiveSchemeCode == null ||
Expand All @@ -492,7 +493,7 @@ class GitService extends GetxController {

!isWorking.value ? null : isWorking.toggle();

return jsonDecode(response.data);
return Timetable.fromJson(jsonDecode(response.data));
} on DioException catch (e) {
errorDetails = {
'error': 'DioException',
Expand All @@ -516,4 +517,36 @@ class GitService extends GetxController {
return Future.error(Exception(errorDetails));
}
}

/// Fetches the min.version file from remote.
Future<String?> fetchMininumVersion() async {
final url =
"https://gitlab.com/delwinn/plan-sync/-/raw/$branch/min.version";
try {
final response = await dio.get(url);

if (response.statusCode! >= 400) {
return Future.error(response);
}
if (response.data == "") {
return null;
}
return response.data;
} on DioException catch (e) {
errorDetails = {
'error': 'DioException',
'type': e.type.toString(),
'code': e.response?.statusCode.toString(),
'message':
'We couldn\'t fetch requested version. Please try again later.',
};
return Future.error(Exception(errorDetails));
} catch (e) {
errorDetails = {
"type": "CatchException",
"message": "Some unknown error occoured.",
};
return Future.error(Exception(errorDetails));
}
}
}
Loading

0 comments on commit 1791c3b

Please sign in to comment.