Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue - 275 (Meaningful Documentation) #286

Closed

Conversation

Ivan2001otp
Copy link

Description

This PR involves creating meaningful documentation for the codebase of Flutter app -Resonate .It provides convenient way to understand the code . Tried to explain the key functionalities , wherever it is necessary.

Fixes # (issue)
Issues-275.

Type of change

Documentation update.

  • Documentation update

Please include screenshots below if applicable.
No screenshots in documentation update.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Maintainer Checklist

@Ivan2001otp
Copy link
Author

Please provide me the feedback , whether the documentation provided meets the expectation , if not feel free to provide me constructive suggestion.Thank you.

Copy link

@opxdelwin opxdelwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Ivan2001otp,

I wanted to commend you on your exceptional work in this area. While reviewing, I noticed several documentation format issues that, if addressed, would greatly enhance the ease of understanding for new users. Kindly consider incorporating these adjustments as needed.

Thank you for your attention to this matter.

Comment on lines +39 to +43
/*
- Sets up Android notification settings.
- Registers callback to handle Notification taps(onDidRecieveNotificationResponse)
- Enables overall notification capability.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Dart documentation must be written using ///. This practice ensures that contributors can quickly understand the functionality of a function by hovering over it.

4.Make the ScrollController to get initialized to that offset.
5.Update tab Controller to switch to discussions tab.
6.Navigate user to the tabs screen.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

@@ -119,6 +138,11 @@ class AuthStateController extends GetxController {
}
}

/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

@@ -146,12 +170,27 @@ class AuthStateController extends GetxController {
}
}

/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

Future<String> getAppwriteToken() async {
Jwt authToken = await account.createJWT();
log(authToken.toString());
return authToken.jwt;
}

/*

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

Comment on lines +11 to +14
/*
This service helps to create a new room for meeting , by providing necessary parameters
and returns future.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

Comment on lines +43 to +46
/*
This service helps to join the created chat rooms,and returns the status
of task in Future.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

Comment on lines +14 to +20
/*
- Constructs a liveKitController with the given URI and roomToken
in its constructor parameters.
- Registers the controller as a permanent , singleton Instance via Get.
- Get.put() -> Its a dependency injection to register new instance.
- Returns a future that completes when this is done.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

Comment on lines +7 to +10
/*
This below Widget function provides a Widget UI, to user
that helps to choos the type of theme system default , light or dark theme.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct "choos" to "choose"

Comment on lines +25 to +29
/*
- This code retrieves the currently selected theme for the application.
- It prioritizes loading previously saved user preference,but defaults to system's default theme,
if a preference is not found.
*/

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DartDocs, as mentioned

@vrundraval24 vrundraval24 added documentation Improvements or additions to documentation attended This PR was attended by a Reviewer awaitIntra labels May 24, 2024
@Aarush-Acharya
Copy link
Contributor

Aarush-Acharya commented May 24, 2024

Hey @Ivan2001otp thank you for your contribution, Great Work 🚀✨

Please do implement the suggested changes and push again, along with solving the merge conflicts with the current state of the repository.

We await your reply as a token of acknowledgement, will merge once the requested changes are done

P.S. Make this done ASAP as these are just documentation related changes should not take much time, also resolve the conflicts carefully, I will try to get this merged by tomorrow

@Aarush-Acharya Aarush-Acharya removed the documentation Improvements or additions to documentation label May 24, 2024
Future<String> getAppwriteToken() async {
Jwt authToken = await account.createJWT();
log(authToken.toString());
return authToken.jwt;
}

/*
In the below method(isUserLoggedIn)
- all we are trying to know is whether the userProfile is successfully setup or not.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if the user is logged in or not, this goal is not highlighted make it more clear

@@ -195,6 +234,16 @@ class AuthStateController extends GetxController {
});
}

/*
1. Get the current FCM token for the user's device.
2. Fetch the list of subscribed Discussion from appwrite collection.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this,
2. Fetch the List of subscriptions made by this user
3. Loop through the subscriptions
4. Removing the FCM token of this device from the list of FCM tokens of each subscription
5. A FCM token in the list of FCM tokens of a subscription created by this user represents a device to which notification is to be sent on events related to the discussion subscription was made to as the user can login from many devices and if user is logged in through 3 different devices all of them needs to be sent notifications

This below method helps to verify the user entered otp

Purpose of imp variables used in below code:
- otpId =>Retrieves the otp from user's document, representing the actual OTP.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otpId: the ID of the otp sent, which will help fetch the actual otp from server side.

prefs: Fetch the user account prefs to get the otpId from it, the otpID gets updated into user account prefs when an otp is sent to the user. It is the Id corresponding to the otp sent to the user

verificationId: After comparison between OTP sent and user entered OTP the server side updates the status of the verification in the verification document (each verification is represented by a document in the verification collection ), status is then used to check if the verification was successful or not

static Future<void> joinLiveKitRoom(
String livekitUri, String roomToken) async {
Get.put(LiveKitController(liveKitUri: livekitUri, roomToken: roomToken),
permanent: true);
}

/*
- This below method performs the task of updating/adds the total number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a new participant as a document to the collection of all participants.

roomID: represents the room to which the particiapant belongs
userID: who the participant is

@@ -32,6 +43,11 @@ class RoomService {
Query.equal("uid", [uid]),
Query.equal('roomId', [roomId])
]);

/*
We delete the previous participants data of past meeting , so that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We delete the participant documents that have the userid as this user, and the room id as the id of the room that this user is being added to. If the documents fetched are not null that would mean that this user was in the room from the same account but from some other device so thus we need to delete that document and proceed with adding this one in order to get rid of more than one user room joining from the same account

String myDocId = await addParticipantToAppwriteCollection(
roomId: appwriteRoomDocId, uid: adminUid, isAdmin: true);
await joinLiveKitRoom(livekitSocketUrl, livekitToken);

return [appwriteRoomDocId, myDocId];
}

//This method deletes the previously created chat room whose ID is associated with 'roomId'.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deletes the room with the provided room id, this option is made accessible from the UI to only the admins of the room

@@ -126,6 +151,9 @@ class RoomService {
}
}

/*
This method fetches liveKitToken and liveKitSocketUrl,which is necessary to send user to a chat room.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method fetches liveKitToken and liveKitSocketUrl, which is necessary to join the user into the room, and have it hear the audio being transmitted in the room

@@ -137,6 +165,10 @@ class RoomService {
return myDocId;
}

/*
This method removes the leaving user's presence from the room,
checks if room is now empty, and deletes or updates total-participants accordingly.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deletes the room from collection or updates the total-participants decreasing it by one

Comment on lines +7 to +10
/*
This below Widget function provides a Widget UI, to user
that helps to choos the type of theme system default , light or dark theme.
*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

correct "choos" to "choose"

@Aarush-Acharya
Copy link
Contributor

Hey @Ivan2001otp you there please acknowledge, with a response if we do not receive a response from your side in the next 3 days we would have to close this PR

@Aarush-Acharya
Copy link
Contributor

Hey @Ivan2001otp we need a reply from your side as a token of acknowledgement, in order to prove your activeness, we will close the PR if we do not hear from you within the next 3 - 4 days

@SarthakPaandey
Copy link

@Aarush-Acharya may i work on this if @Ivan2001otp is not responding.

@Ivan2001otp Ivan2001otp closed this by deleting the head repository Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
attended This PR was attended by a Reviewer awaitIntra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC: Document the code so that newer developers are easily able to understand the code
5 participants