Skip to content

Latest commit

 

History

History
121 lines (65 loc) · 6.79 KB

ONBOARDING.md

File metadata and controls

121 lines (65 loc) · 6.79 KB

Onboarding Guide

Client-side set-up is straightforward and standard, i.e., clone the repo Resonate Client Side Repo, do flutter pub get in the root of the project, etc. This guide would focus on the backend env setup.

Please strictly stick to the guide; do not go off installing stuff on your own.

Push notifications

Push runs on Appwrite Messaging over MQTT, so there is nothing extra to set up: no Firebase project, no service account and no google-services.json. The app subscribes to the signed-in user's own topic, so no device token is stored anywhere. To receive anything locally, your Appwrite instance needs an enabled push provider (appwrite messaging create-appwrite-provider) and its MQTT port reachable from the device.


Prerequisits (must be installed) for Backend Env Set-Up

  • Docker

Installing Appwrite and Appwrite CLI

Clone the Resonate Backend Repo

Very Important Info

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


Navigate to the root directory of the project in your terminal (for Windows PowerShell), and run the command

Linux and MacOS
sudo ./init.sh
Windows
./init.ps1

The script will identify your Operating System, will start installing the appwrite-cli (will even install brew if not there for macOS)

Screenshot 2024-10-11 at 3 21 21 AM

After installing the appwrite-cli it will start pulling Appwrite's docker image, this may take some time

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 it will compose the image into a container this might take a few minutes as well

Now appwrite will be successfully installed locally as a container and will be up for action.

Resonate Project Set Up in Appwrite

Login

Next you will be asked for login credentials. Go to appwrite localhost, create your account, you will be asked to create a team please do so. Once done fill in the created account creds to the script

Screenshot 2024-06-28 at 2 52 28 AM

Project Creation

After logging in you will be asked for a team ID

Screenshot 2024-10-11 at 3 24 47 AM

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 i.e. Localhost Port 80, and observe the URl in the end of the url, you will see your teamId

Screenshot 2024-06-28 at 3 05 06 AM

Thus my Team Id is 666ce18b003caf6274b6, enter your team id in the terminal, once this is done the script will create a new project named Resonate in your instace with its id being 'resonate'.

Auth Set Up

The auth set up is intentionally skipped as google Oauth did not allow private IP as allowed redirect URl's so we had to make the script open tunnels and once tunneling was introduced. It brought more complexities and conditions of working which degraded the scripts robustness

So we have decided to create a dedicated script for the rare case of testing the Oauth login buttons ('google', 'github') this script is work in progress and will be out soon. But for now email password signIn should work perfectly fine enabling you to explore full capabilities of the project with a robust script

Core Project Services Set Up

Now you will be prompted for Collection Set Up

Screenshot 2024-07-06 at 5 14 46 PM

Press "a" to select all and press enter, same goes for Buckets set up coming after this. The Functions will be pushed at the end of the script after the Livekit env vars are pushed as the Functions need redeployment after a new env var is pushed in order to read the var.

This completes the Resonate project Set Up (functions will be pushed in the end) in your local Appwrite Instance 🚀🍀

Meilisearch Set Up

Now you will be asked to choose between Meilisearch Cloud and Meilisearch Self Hosted. Please choose whatever option suits you. Image for Meilisearch

This would run Meilisearch locally for you as a container (if you went with self hosted). You can proceed to the next section.

If you want to use Meilisearch in Resonate, please enable the isUsingMeilisearch flag in constants.dart either by changing the default value or passing true as an environment variable via the --dart-define argument.

Livekit Set Up

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

Screenshot 2024-10-11 at 5 15 53 AM

This would run Livekit locally for you as a container (if you went with self hosted) Now appwrite function pushing will start and just press 'a' char on keyboard to select all and push all functions

Screenshot 2024-10-11 at 5 16 10 AM

Connecting Frontend and Backend

Now, on client side, based on how you are running the client side app you need to update the default value of the baseDomain variable in constants.dart or you can pass it in as an argument with flutter run using --dart-define=APPWRITE_BASE_DOMAIN=<Your baseDomain>

Platform Base Domain
Android Simulator 10.0.2.2
iOS Simulator localhost
Physical Device Ensure laptop and phone are on the same Wi-Fi, then use the laptop's IP address provided by the Wi-Fi