Skip to content

Commit

Permalink
Merge pull request #173 from COS301-SE-2023/dev
Browse files Browse the repository at this point in the history
Merge Dev into Main
  • Loading branch information
MrME-CodeSmith authored Oct 25, 2023
2 parents fb83168 + 027efdc commit 204d48c
Show file tree
Hide file tree
Showing 73 changed files with 853 additions and 575 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ jobs:
run: flutter test
working-directory: client

- name: Decode keystore file
env:
KEYSTORE: ${{ secrets.KEYSTORE }}
run: |
echo $KEYSTORE | base64 --decode > /home/runner/work/Koja/Koja/client/android/app/mykey.jks
- name: Build Flutter app
run: flutter build apk
working-directory: client
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,39 @@
[![Repo Size](https://img.shields.io/github/repo-size/COS301-SE-2023/Koja.svg)](https://github.com/COS301-SE-2023/Koja)
[![Koja Build Status](https://github.com/COS301-SE-2023/Koja/actions/workflows/main2.yml/badge.svg)](https://github.com/COS301-SE-2023/Koja/actions/workflows/main2.yml)


<p align="center">
<img src="client/assets/icons/koja.png" alt="Koja Icon" style="height: 200px;">
</p>

## Project Description:
Koja is a system that enables more efficient time utilisation through dynamic and fixed time allocation for specific tasks a user wants to complete. Koja's aim is to minimise solve the burden of schedule management while requiring minimal effort from the user.

# Advertisement
https://github.com/COS301-SE-2023/Koja/assets/105129419/1d39ca2c-c081-4534-94d4-7558d399c484

# Documentation
* [SRSv4](https://www.canva.com/design/DAFm6EdVuUo/d1PDPN7l5k5e_cx3V7UT1A/edit?utm_content=DAFm6EdVuUo&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton)
* [Project Board](https://github.com/orgs/COS301-SE-2023/projects/37)

## Demo Videos
* [Team Caffeine-Demo1](https://drive.google.com/file/d/165ckgDKdO0YbYHQ_8qtw9sJ56FZ6jSGC/view?usp=sharing)
## Demo Slide & Video
* [Team Caffeine - Demo Slide](https://www.canva.com/design/DAFuI_vIphg/Ux_tSd2K-evrvKIDnCR8PA/edit?utm_content=DAFuI_vIphg&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton)

* [Team Caffeine-Demo2](https://www.canva.com/design/DAFmn-ECx6w/1bhJhvtIjHPHMSG7kXUJhA/edit?utmcontent=DAFmn-ECx6w&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton)
* [Team Caffeine - Demo Video](https://drive.google.com/file/d/1HWAUgzdQUKvIi33rHqagadPkk6OxEqA-/view?usp=drive_link)

* [Team Caffeine-Demo3](https://www.canva.com/design/DAFoP47g3sw/_QjN9Yd8liAkDbpPl9SBhg/edit?utm_content=DAFoP47g3sw&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton)

* [Team Caffeine-Demo4](https://www.canva.com/design/DAFuI_vIphg/Ux_tSd2K-evrvKIDnCR8PA/edit?utm_content=DAFuI_vIphg&utm_campaign=designshare&utm_medium=link2&utm_source=sharebutton)

## Additional Documentations
* [Technical Installation Manual](https://docs.google.com/document/d/1pdzUM2YM_lkqxtvTfs2MToCcu3zSB6QwQbP5pfhyjHk/edit?usp=sharing)

* [User Manual](https://docs.google.com/presentation/d/1cPbn8JxNLQUwRQt_2Euw9KsLvmQ2d15Y-28ukS4Yh1A/edit?usp=drive_link)

* [Contributions](https://docs.google.com/document/d/1OVnDnd-1888-pUsX0dXAO_8Iy7R1oDDPmhMQqGZD8TI/edit?usp=sharing)

* [Coding Standards](https://docs.google.com/document/d/1jZFns50dd7gQlAGJpq--38faijdhuxrOiWK_JtvKXQI/edit?usp=sharing)

* [Architectural Design](https://docs.google.com/document/d/1hVQcrOcnCRzHyd9Y-aXYuAfyRZxVVZTiJyluJbr_0RY/edit?usp=sharing)

* [Testing Policy Document](https://docs.google.com/document/d/10JTOApaAbRHdl4zoTkm39UPMgZYwPrVCrqgX5lBN5EA/edit?usp=sharing)
# Technologies
* Flutter, SpringBoot, Kotlin, Amazon RDS, Amazon DynamoDB
# Team
📧 Team email: [[email protected]](mailto:[email protected])

Expand Down
3 changes: 0 additions & 3 deletions client/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@

include: package:lints/recommended.yaml

linter:
rules:
avoid_print: true
4 changes: 2 additions & 2 deletions client/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ android {

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.client"
applicationId "com.teamcaffeine.koja"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdkVersion 21
Expand All @@ -67,7 +67,7 @@ android {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
// signingConfig signingConfigs.debug
signingConfig signingConfigs.debug
}

debug{
Expand Down
9 changes: 7 additions & 2 deletions client/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="client"
android:label="Koja"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand All @@ -23,13 +23,18 @@
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter android:label="flutter_web_auth_2 ">
</activity>
<activity
android:name="com.linusu.flutter_web_auth_2.CallbackActivity"
android:exported="true">
<intent-filter android:label="flutter_web_auth_2">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="koja-login-callback" />
</intent-filter>
</activity>


<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified client/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions client/android/app/src/main/res/values/colors.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#6B1DE2</color>
</resources>
Binary file removed client/assets/icons/coffee.png
Binary file not shown.
Binary file removed client/assets/icons/google.png
Binary file not shown.
Binary file removed client/assets/icons/google1.png
Binary file not shown.
Binary file removed client/assets/icons/koja1.png
Binary file not shown.
Binary file added client/assets/icons/koja_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions client/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Client</string>
<string>Koja</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>client</string>
<string>Koja</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
Expand Down
21 changes: 3 additions & 18 deletions client/lib/Utils/environment_variable_constants.dart
Original file line number Diff line number Diff line change
@@ -1,20 +1,5 @@
class EnvironmentVariableConstant {
static const String kojaAwsRdsDatabaseUrl = "KOJA_AWS_RDS_DATABASE_URL";
static const String kojaAwsRdsDatabaseAdminUsername = "KOJA_AWS_RDS_DATABASE_ADMIN_USERNAME";
static const String kojaAwsRdsDatabaseAdminPassword = "KOJA_AWS_RDS_DATABASE_ADMIN_PASSWORD";
static const String kojaAwsDynamodbAccessKeyId = "KOJA_AWS_DYNAMODB_ACCESS_KEY_ID";
static const String kojaAwsDynamodbAccessKeySecret = "KOJA_AWS_DYNAMODB_ACCESS_KEY_SECRET";
static const String googleClientId = "GOOGLE_CLIENT_ID";
static const String googleClientSecret = "GOOGLE_CLIENT_SECRET";
static const String googleMapsApiKey = "GOOGLE_MAPS_API_KEY";
static const String kojaJwtSecret = "KOJA_JWT_SECRET";
static const String openaiApiKey = "OPENAI_API_KEY";
static const String kojaIdSecret = "KOJA_ID_SECRET";
static const String coverallsRepoToken = "COVERALLS_REPO_TOKEN";
static const String kojaPrivateKeyPass = "KOJA_PRIVATE_KEY_PASS";
static const String kojaPrivateKeySalt = "KOJA_PRIVATE_KEY_SALT";
static const String aiPrivateKeyPass = "AI_PRIVATE_KEY_PASS";
static const String aiPrivateKeySalt = "AI_PRIVATE_KEY_SALT";
static const String serverAddress = "SERVER_ADDRESS";
static const String serverPort = "SERVER_PORT";
static const String googleMapsApiKey = "koja_google_maps_api_key";
static const String serverAddress = "koja_server_address";
static const String serverPort = "koja_server_port";
}
Binary file removed client/lib/assets/icons/artificial-intelligence.png
Diff not rendered.
Binary file removed client/lib/assets/icons/computer.png
Diff not rendered.
Binary file removed client/lib/assets/icons/destination.png
Diff not rendered.
Binary file removed client/lib/assets/icons/google-calendar.png
Diff not rendered.
Binary file removed client/lib/assets/icons/home.png
Diff not rendered.
Binary file removed client/lib/assets/icons/schedule-time.png
Diff not rendered.
Binary file removed client/lib/assets/icons/schedule.png
Diff not rendered.
Binary file removed client/lib/assets/icons/stress.png
Diff not rendered.
Binary file removed client/lib/assets/icons/user.png
Diff not rendered.
15 changes: 10 additions & 5 deletions client/lib/providers/service_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class ServiceProvider with ChangeNotifier {
}

/// This function will attempt to add another email using UserAccountController
Future<bool> addEmail({required ContextProvider eventProvider}) async {
Future<bool?> addEmail({required ContextProvider eventProvider}) async {
final String authUrl =
'$_serverAddress:$_serverPort/api/v1/user/auth/add-email/google?token=$_accessToken';

Expand All @@ -169,11 +169,16 @@ class ServiceProvider with ChangeNotifier {
callbackUrlScheme: callbackUrlScheme,
);

response = Uri.parse(response).queryParameters['token'];
final parsedResponse = Uri.parse(response).queryParameters;

setAccessToken(response, eventProvider);

return accessToken != null;
if(parsedResponse.containsKey("token")) {
setAccessToken(parsedResponse["token"], eventProvider);
return true;
}
else if(parsedResponse.containsKey("error"))
{
return null;
} else return false;
}

/// This function will attempt to delete an email from the user's account
Expand Down
29 changes: 28 additions & 1 deletion client/lib/screens/suggestions_screens.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:koja/Utils/event_util.dart';
import 'package:koja/providers/context_provider.dart';
import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import 'package:lottie/lottie.dart';

import '../providers/service_provider.dart';
import '../widgets/calendar_widget.dart';
Expand Down Expand Up @@ -125,8 +126,34 @@ class _SuggestionsTasksScreenState extends State<SuggestionsTasksScreen> {
}
else
{
// return Center(
// child: Text('Koja\'s suggestion engine is still learning.\nPlease try again soon.'),
// );
return Center(
child: Text('Koja\'s suggestion engine is still learning.\nPlease try again soon.'),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
alignment: Alignment.center,
child: Lottie.asset(
'assets/animations/ai.json',
height: 200,
width: 300,
repeat: false,
),
),
Center(
child: Text(
'Koja\'s suggestion engine is still learning.\nPlease try again soon.',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
fontFamily: 'Raleway'),
textAlign: TextAlign.center,
),
),
],
),
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion client/lib/widgets/about_us_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AboutUsWidget extends StatelessWidget {
],
),
),
Text("Version 0.0.4",
Text("Version 1.0.0",
style: GoogleFonts.ubuntu(
fontSize: 14,
fontWeight: FontWeight.w400,
Expand Down
17 changes: 14 additions & 3 deletions client/lib/widgets/add_email_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,33 @@ class _AddEmailModalState extends State<AddEmailModal> {
children: [
ElevatedButton(
onPressed: () async {
if (await serviceProvider.addEmail(
eventProvider: eventProvider)) {
final addResult = await serviceProvider.addEmail(
eventProvider: eventProvider
);
if (addResult != null && addResult) {
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Email was added'),
),
);
} else {
} else if(addResult != null && !addResult) {
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Email was not added'),
),
);
}
else
{
Navigator.pop(context);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Not added - User email already added'),
),
);
}
},
child: const SizedBox(
height: 30,
Expand Down
2 changes: 1 addition & 1 deletion client/lib/widgets/event_editing_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ class EventEditingState extends State<EventEditing> {
final date = await showDatePicker(
context: context,
initialDate: initialDate,
firstDate: DateTime(initialDate.year - 5),
firstDate: DateTime.now(),
lastDate: DateTime(initialDate.year + 10),
);

Expand Down
1 change: 1 addition & 0 deletions client/lib/widgets/tasks_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class TasksWidgetState extends State<TasksWidget> {
'assets/animations/empty.json',
height: 200,
width: 300,
repeat: false,
),
),
],
Expand Down
Loading

0 comments on commit 204d48c

Please sign in to comment.