Skip to content

Commit b2fe2dd

Browse files
Aarush-Acharyavrundraval24chandansgowda
authored
Brought Resonate to Stable State (AOSSIE-Org#329)
* feat: added feature to change user email address * refactor: ui changes. * fix: error caused by check server status PR merge * refactor: ui changes. * feat: added functionality to change email for OAuth users. * feat: added functionality to change email for OAuth users. * fix: brought app to stable state * refactor: removed print statements * refactor: removed depricated code * feat: made changes to adjust the set up script * cleaned code a little * Update README.md * feat: added onboarding guide * Update README.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * feat: made requested changes * Update ONBOARDING.md * feat: made the Oauth work * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md: removed caddy from dependancy * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md * Update ONBOARDING.md --------- Co-authored-by: Vrund <[email protected]> Co-authored-by: Chandan Gowda <[email protected]>
1 parent 0aa5412 commit b2fe2dd

33 files changed

+1055
-294
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,5 @@ app.*.map.json
4444
/android/app/profile
4545
/android/app/release
4646

47-
.vscode/
47+
.vscode/
48+
appwrite

ONBOARDING.md

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
## Onboarding Guide
2+
3+
Client side set up is straight forward and standard, i.e clone the repo [Resonte Client Side Repo](https://github.com/AOSSIE-Org/Resonate), do `flutter pub get` in the root of the project etc so this guide would focus on the backend env set up.
4+
5+
### Prerequisits (must be installed) for Backend Env Set-Up
6+
7+
- Docker
8+
- [Livekit](https://github.com/livekit/livekit#windows) (needed only for Windows, make sure to add it to your path var)
9+
10+
### Starting Off (Clone Repo, Run Script, Script Install Appwrite locally)
11+
12+
Clone the [Resonate Backend Repo](https://github.com/Aarush-Acharya/Resonate-Backend)
13+
<br/>
14+
15+
> #### **Very Important Info**
16+
> The backend initialisation script installs Appwrite locally with additional custom flags to the install command available in the appwrite documentation so if you already have Installed Appwrite locally please delete the image and the container and start fresh
17+
<br/>
18+
19+
Navigate to the root directory of the project in your terminal (for windows power shell), and run the command
20+
21+
##### Linux
22+
23+
```bash
24+
sudo ./init.sh
25+
```
26+
27+
##### Mac OS
28+
29+
```bash
30+
./init.sh
31+
```
32+
33+
##### Windows
34+
35+
```bash
36+
./init.ps1
37+
```
38+
39+
The script will identify your Operating System, will start installing the dependencies for the script to execute
40+
- Appwrite CLI
41+
- Livekit Server CLI
42+
- Livekit CLI
43+
44+
This will ask for sudo access, give it
45+
46+
![Screenshot 2024-07-09 at 3 38 32 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/bd3235a5-2ab9-47b5-94a9-e2f9d61deb14)
47+
48+
49+
After installing the dependancies it will start the backend initialisation script thus start pulling Appwrite's docker image, this may take some time but after a few minutes it will ask you for some inputs let everything be the default and just press enter for it to take the default value, once all inputs are taken your it will compose the image into a container this might take a few minutes as well but after that appwrite will be successfully installed, started and up for action.
50+
51+
<br/>
52+
53+
Once your appwrite is intalled and running, you will be prompted with login credentials to login to appwrite but first you must go to [appwrite localhost](http://localhost:80) and create your account, account creation will ask to create a team as well please do so and proceed to the home page of the console, then provide the created accounts credentials to prompted messages
54+
55+
![Screenshot 2024-06-28 at 2 52 28 AM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/802d96c1-0ad5-4922-b49a-56eb56e39904)
56+
57+
After entering your email, password you will be asked for Endpoint of Appwrite Server let it be the default (hence press enter to move forward)
58+
<br/>
59+
60+
61+
62+
### Ngrok Set Up
63+
64+
You will be prompted for a ngrok auth token, sign up to [ngrok](https://ngrok.com/), to get your self an auth token and give it in the terminal
65+
66+
![Screenshot 2024-07-09 at 3 41 23 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/8b5dc583-c6f7-4a3c-a74a-9d50cb6a398e)
67+
68+
After successful Ngrok set up you will be given an ngrok domain as a result please copy it and save it with you, though for ease of use whenever it is required it will be given to you again during the initialization process via the script
69+
70+
### Resonate Project Set Up in Appwrite
71+
72+
#### Project Creation
73+
74+
After Ngrok set Up you will be asked for a team ID
75+
76+
![Screenshot 2024-07-09 at 4 16 17 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/29ad09a2-d8e8-4c95-bcb3-98e583c46f3e)
77+
78+
For the team Id, while the creation of an appwrite account you must be asked of a team name for your default team. Head over to your [appwrite console](http://localhost:80) i.e. Localhost Port 80, and observe the URl in the end of the url, you will see your teamId
79+
80+
![Screenshot 2024-06-28 at 3 05 06 AM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/9717d9e5-41ad-4fd8-8f71-bac79e73cea7)
81+
82+
Thus my Team Id is `666ce18b003caf6274b6`, enter your team id in the terminal, once this is done the script will set up some stuff for you and then it will ask for auth credentials
83+
84+
85+
![Screenshot 2024-07-09 at 4 17 02 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/6de9cd8d-508b-4b06-8c23-632015dab97e)
86+
87+
88+
#### Oauth Set Up
89+
90+
- #### *Google Oauth Creds*
91+
92+
To create your Google Oauth credentials visit [Google Oauth Credential Guide](https://www.balbooa.com/help/gridbox-documentation/integrations/other/google-client-id) before that please read the few lines below
93+
94+
While creating the Oauth credentials for Google add the following urls as
95+
you will be able to see a ngrok tunnel url that is required in these steps
96+
97+
Authorized JavaScript origins: `http://{your ngrok tunnel domain name}`
98+
so for me it is http://bb58-49-36-144-88.ngrok-free.app
99+
100+
> ##### **Very Important Info**
101+
> The url should start with `http://` not `https://` please make sure that you striclty follow the instructions listed in this guide assuming every step to be case sensitive
102+
<br/>
103+
104+
Authorized redirect URIs: `http://{your ngrok tunnel domain name}/v1/account/sessions/oauth2/callback/google/resonate`
105+
so for me it is http://bb58-49-36-144-88.ngrok-free.app/v1/account/sessions/oauth2/callback/google/resonate
106+
107+
After successful creation of Oauth credentials provide the App/Client Id and Secret in the Terminal
108+
109+
110+
- #### *Github Oauth Creds*
111+
112+
Get yourself your Github Oauth credentials via following [Github Oauth Credential Guide](https://support.heateor.com/get-github-client-id-client-secret/)
113+
114+
While creating the Oauth credentials for Github add the following urls as
115+
116+
Homepage URL: `http://{your ngrok tunnel domain name}`
117+
so for me it is http://bb58-49-36-144-88.ngrok-free.app
118+
119+
Authorization callback URL: `http://{your ngrok tunnel domain name}/v1/account/sessions/oauth2/callback/github/resonate`
120+
so for me it is http://bb58-49-36-144-88.ngrok-free.app/v1/account/sessions/oauth2/callback/github/resonate
121+
122+
123+
Oauth set up is complete 🚀
124+
125+
#### Core Project Services Set Up
126+
127+
Now you will be prompted for `Collection` Set Up
128+
129+
![Screenshot 2024-07-06 at 5 14 46 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/5155b124-07e4-4769-a9f1-ac574816f85e)
130+
131+
Press "a" to select all and press enter, same goes for `Functions` and `Buckets` set up comming after this
132+
133+
This completes the Appwrite Set Up 🚀🍀
134+
135+
### Livekit Set Up
136+
137+
now you will be asked to choose between Livekit Cloud or Livekit Self hosted if you have a have an old laptop that is most likely not able to take up much processing load then opt for cloud else having it locally i.e self hosted is recommended
138+
139+
![Screenshot 2024-07-06 at 5 20 00 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/348dc245-165e-490c-ba50-f699cd05bbee)
140+
141+
142+
### Caddy Web Server Set Up
143+
144+
After livekit set up the script will start the caddy web server, and this would complete the script execution, printing out your ngrok tunnel Domain for you in the end. This tunnel domain needs to be entered in the constants.dart in the client side flutter project, copy the tunnel domain and save it with your self as well
145+
146+
147+
![Screenshot 2024-07-09 at 4 22 36 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/92e6b877-a650-4aa3-b0e1-9b7534e3145a)
148+
149+
150+
![Screenshot 2024-07-07 at 8 49 29 AM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/42fa4370-50b9-43b9-a356-444380ce5141)
151+
152+
Make sure on the client side you keep everything as it is just swap the baseDomain with you ngrok tunnel domain, even if accidently you make the appwrite end point from "https://$baseDomain/v1" to "http://$baseDomain/v1" appwrite will throw an error
153+
154+
`[log] AppwriteException: general_unauthorized_scope, User (role: guests) missing scope (account) (401)`
155+
156+
Hence make sure to keep things as it is and just swap the baseDomain.
157+
158+
159+
### Debugging
160+
161+
The logs for the ngrok service could be viewed at http://localhost:4040/inspect/http, apart from ngrok all the other service's logs i.e
162+
livekit, caddy can be seen in the .log files generated during the execution of the script.
163+
164+
![Screenshot 2024-07-06 at 5 37 30 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/4aa9a6b7-5035-4bfa-81c7-fb9f814d018e)
165+
166+
why two caddy log files?
167+
168+
caddy.log: captures the server's operational logs, including startup and error messages.
169+
caddy_access.log: captures the access logs, detailing each HTTP request handled by the server.
170+
171+
### How to Stop the Backend Env Services
172+
173+
Services that backend Env uses
174+
175+
- Appwrite
176+
- caddy
177+
- livekit
178+
- ngrok
179+
180+
are running in the background, to stop
181+
182+
#### Appwrite
183+
184+
Just stop the appwrite's docker container
185+
186+
187+
#### Cady
188+
189+
Just stop the Caddy container
190+
191+
#### Livekit
192+
193+
```bash
194+
ps aux | grep livekit-server
195+
```
196+
197+
now copy its Process Id and kill it using the kill command
198+
199+
```bash
200+
kill <Pid>
201+
```
202+
203+
![Screenshot 2024-07-06 at 5 49 17 PM](https://github.com/Aarush-Acharya/Resonate/assets/92685647/602af879-3038-4d72-b91f-6fb33a535399)
204+
205+
206+
#### Ngrok
207+
208+
Just stop the ngrok's docker container
209+
210+
211+

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,13 @@ With the rising popularity of social voice platforms such as Clubhouse and Twitt
5656
1. [Resonate Flutter App](https://github.com/AOSSIE-Org/Resonate)
5757
2. [Resonate Backend](https://github.com/AOSSIE-Org/Resonate-Backend)
5858

59+
60+
## :four_leaf_clover: Getting Started
61+
Resonate is a wide project taking use of other software solutions like Appwrite and Livekit, starting up can be a little challenging
62+
63+
We offer a guide for walking you through setting up the entire project, including a script that automates the set up of the backend environment for you.
64+
Please go through and strictly follow the [Onboarding Guide](https://github.com/Aarush-Acharya/Resonate/blob/master/ONBOARDING.md) for setting up the project for development and further contribution
65+
5966
## :movie_camera: App Screenshots
6067
<div align="center">
6168

android/app/src/main/AndroidManifest.xml

+4-1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
android:theme="@style/LaunchTheme"
3131
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
3232
android:hardwareAccelerated="true"
33+
android:enableOnBackInvokedCallback="true"
3334
android:windowSoftInputMode="adjustResize">
3435

3536
<!-- App Link-->
@@ -57,10 +58,12 @@
5758
<action android:name="android.intent.action.VIEW" />
5859
<category android:name="android.intent.category.DEFAULT" />
5960
<category android:name="android.intent.category.BROWSABLE" />
60-
<data android:scheme="appwrite-callback-64a12ff22a44f02f0545" />
61+
<data android:scheme="appwrite-callback-resonate" />
6162
</intent-filter>
6263
</activity>
6364

65+
66+
6467
<!-- Don't delete the meta-data below.
6568
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
6669
<meta-data

devtools_options.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
description: This file stores settings for Dart & Flutter DevTools.
2+
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3+
extensions:

ios/Flutter/AppFrameworkInfo.plist

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>11.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

0 commit comments

Comments
 (0)