> For the complete documentation index, see [llms.txt](https://syncloud-softech.gitbook.io/muly/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://syncloud-softech.gitbook.io/muly/prepare.md).

# Prepare

This documents contains instructions for setting up the required configuration of various things such as Facebook app, Firebase project & more before you actually proceed with installation.

Before starting with either of server side or **Android** configuration, you will need a few things set up.

### Prerequisites

On development machine, you must have at least below tools available:

1. Latest [Android Studio](https://developer.android.com/studio) with latest [Command-line Tools](https://developer.android.com/studio#cmdline-tools).
2. Oracle's [JDK](https://www.oracle.com/in/java/technologies/javase/javase-jdk8-downloads.html) 1.8 or newer.
3. Have a **Privacy Policy** and **Terms of Use** for your app hosted elsewhere e.g., [Google Sites](https://sites.google.com/new).

### Signing keystore

You need to have a keystore to setup a Facebook app and a Firebase project before anything else. There's a [YouTube](https://bit.ly/muly-youtube) video on <https://bit.ly/muly-keystore-hash> which you can follow to do this easily.

If you want to do that without the video instructions, please navigate to JDK's *bin* directory (typically `C:\Program Files\Java\jdk-xxx\bin`), open a command prompt there and run below command. Make sure to replace `yourapp` with your application short name (with no symbols and spaces).

```bash
# make a note of the password you enter below
keytool -genkey -v -keystore "%USERPROFILE%/Desktop/release.jks" -deststoretype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias muly

# make note of the SHA-1/256 from release & debug certificate

# password for release is what you chose above
keytool -list -v -alias muly -keystore "%USERPROFILE%/Desktop/release.jks"

# password for debug keystore is: android
keytool -list -v -alias androiddebugkey -keystore "%USERPROFILE%/.android/debug.keystore"

```

This above create a keystore named `release.jks` on your Desktop and show you the SHA-1/256 hashes for your debug & release keystores. Now open <https://bit.ly/vpz-keyhash> in your browser and use the form on the right to generate Base64 version of the SHA-1 hash required for Facebook setup.

### Facebook setup

1. Go to <https://developers.facebook.com/> and login with your Facebook account.
2. Click the **Create App** button.
3. Choose **Something Else** and click **Continue**.
4. Enter the **App Display Name** e.g., *Your app* and click **Create App**.
5. In the side menu, click on the "+" sign besides **Products**.
6. Click on **Set Up** button under *Facebook Login*.
7. Click on **Android**.
8. Click **Next** until 3rd step, then enter `com.yourapp.android` in **Package Name** and `com.yourapp.android.activities.MainActivity` in **Default Activity Class Name** fields, then click **Save** (replace package name as desired).
9. Click **Continue** to go to 4th step and enter the value of **SHA-1 + Base64** obtained above from your debug & release keystores (both) in the **Key Hashes** field and click **Save**.
10. Click **Continue** to go to 5th step and turn on **Single Sign On**. Then click **Save** and **Next** until the wizard finishes.
11. Now go to **Settings** > **Basic** from the side menu.
12. Fill in the **Privacy Policy URL** and **Terms of Service URL** in respective fields.
13. Choose `Yourself or your own business` under **App Purpose**.
14. Choose `Social Networks & Dating` under **Category**.
15. Turn on the checkbox before **In development** to enable live mode.
16. Make note of **App ID** and **App Secret**, you will need those later.
17. Now go to **Settings** > **Advanced** from the side menu.
18. Make note of the **Client token** shown under **Security**, you will need it later.

### Firebase setup

1. Go to <https://console.firebase.google.com/> and login with your Google account.
2. Click on **Add project** button.
3. Enter your desired project name e.g., **Your app** and click **Continue**.
4. Click **Continue** again with default *Analytics* settings.
5. In **Choose or create a Google Analytics account** dropdown, select `Create a new account` and enter your project name again e.g., **Your app** and click **Save**.
6. Choose your country e.g., `India` in **Analytics location** dropdown, *read and accept the terms* and click on **Create project** button.
7. Click **Continue** after project has been created to move to console.
8. Click on the `Android` button under **Get started by adding Firebase to your app** heading.
9. Enter your app's package name e.g., `com.yourapp.android` in the **Android package name** field.
10. Enter your app's display name e.g., `Your app` in the **App nickname** field.
11. Keep clicking on **Next** until the **Continue to console** button shows up and finally click on it.
12. In the side menu, click on **Gear** icon besides **Project overview** and click **Project settings**.
13. In *General* tab, choose a **Support email** under *Public settings*.
14. Below on the same page under *SHA certificate fingerprints*, click on **Add fingerprint**.
15. Enter the **SHA-1** and **SHA-256** (one by one) obtained above from the your debug & release keystores (both), then click **Save**.
16. From side menu, click on **Authentication**, then click on **Get started** and finally go to *Sign-in methods* tab.
17. Enable **Phone** and **Google** options there.
18. From side menu again, click on **Dynamic Links** and then click on **Get started**.
19. Enter your app's short, URL friendly name e.g., `yourapp` with `page.link` e.g., `yourapp.page.link` in the **Domain** field and click **Continue**, then **Finish**.
20. Now go back to settings using **Gear** icon besides **Project overview** and clicking on **Project settings**.
21. In *General* tab, scroll down and click on `google-services.json` button to download the configuration file you will need later.
22. Now open the `google-services.json` file in a text editor and make not of the client ID for client with type `3`, you will also need this later.
23. Then go to *Service accounts* tab and click the **Generate new private key** button at the bottom, then click **Generate key**.
24. Go to <https://console.cloud.google.com/> and select the same project associated with Firebase.
25. From the side menu, go to **APIs & Services** > **Library**.
26. Search for `Android Device Verification` and click on it.
27. Click on the **Enable** button.

### Files on S3 (AWS)

1. Go to <https://console.aws.amazon.com/> and login with your Amazon account.
2. Click on **Services**, then search for **IAM** and click on it.
3. From the side menu, click on **Users** and then click **Add user**.
4. In **User name** field, enter `Muly`.
5. In **Access type** options, enable `Programmatic access` .
6. Click on the **Next: Permissions** button.
7. Click on the **Attach existing policies directly** button.
8. Search for `AmazonS3FullAccess` policy and *select* it.
9. Click on the **Next: Tags** button, then click **Next: Review** and lastly **Create user**.
10. Make a note of **Access key ID** and **Secret access key**, you will need those later.
11. Now, from **Services** menu again, search for and click on **S3**.
12. Click on **Create bucket** button.
13. Enter a URL friendly bucket name e.g., `yourapp-files` and select your nearest **Region**.
14. Please also make note of *bucket name* and *region code* e.g., `us-east-1` that you select, you will need it later.
15. *Uncheck* the **Block all public access** checkbox.
16. Scroll to bottom and click **Create bucket**.

### Files on Spaces (DigitalOcean)

1. Go to <https://cloud.digitalocean.com/> and login with your DigitalOcean account.
2. Click on **Create** and then click on **Spaces**.
3. Choose the closed region and click on **Enable CDN**.
4. Scroll down and enter a URL friendly, short name for your *Space* e.g., `yourapp-files`.
5. Click on **Create space** button.
6. Once created, under your *Space* name you will see a URL e.g., `https://yourapp-files.xxx0.digitaloceanspaces.com` where *xxx0* is your region code.
7. Make a note of your created Space name and region code, you will need those later.
8. Now from the side menu, click on **Account** and then **API**.
9. Scroll down and click on **Generate new key** under *Spaces access keys*.
10. In the name field, enter `Muly` and click the tick mark.
11. Make a note of the *key ID* and *secret* shown, you will need it later.

### Files on B2 (Backblaze)

1. Go to <https://www.backblaze.com/index.html> and sign in to your Backblaze account.
2. From the side menu, click on **Buckets** and then click on **Create a Bucket**.
3. Enter a URL friendly, short name for your bucket e.g., `yourapp-files` in **Bucket Unique Name** field.
4. From **Files in Bucket are** options, select `Public`.
5. Click on the **Create a Bucket** button.
6. From bucket information shown, make note of bucket *Name* and *Endpoint*, you will need those later.
7. In the side menu, click on **App Keys**.
8. Scroll down and click on **Add a New Application Key**.
9. In **Name of Key** field, enter `Muly` and click on **Create New Key**.
10. Make a note of *keyID* and *applicationKey*, you will need these later.

### Files on Cloud Storage (GCP)

1. Go to <https://console.cloud.google.com/> and login with your Google account.
2. Select the project associated with Firebase console (recommended) or create a new project.
3. In the side menu, click on **IAM & Admin** > **Service Accounts**.
4. Click on **Create Service Account** button.
5. In the **Service account name** field, enter `Muly` and click **Create**.
6. From **Roles** options, choose *Cloud Storage* > *Storage Admin* and click **Continue** and then **Done**.
7. From the list of *Service accounts*, locate *Muly* and click the menu button (3 vertical dots) then click **Create key**.
8. Choose `JSON` as **Key type** and click on **Create**.
9. From the side menu, click on **Storage** and then click on **Create bucket**.
10. Enter a URL friendly bucket name e.g., `yourapp-files` and click **Continue**.
11. From **Location type** options, select `Region`.
12. From **Location** options, choose your nearest region.
13. Make a note of the *bucket name* and *region code* you selected e.g., `us-east-1` as you will need it later.
14. Finally, click on **Create**.

### Screening with Sightengine

1. Go to <https://dashboard.sightengine.com/> and login to your Sightengine account.
2. From the side menu, go to **API keys**.
3. Make a note of **API user** and **API secret** shown, you will need them later.

### Screening with Rekognition (AWS)

No specific credentials are needed.

### Screening with Cloud Video Intelligence (GCP)

No specific credentials are needed.

### Billing with Play Store

1. Go to <https://play.google.com/apps/publish> and login with your Play Console account.
2. From the side menu, go to *Settings* > *Developer account* > *API access*.
3. From options under **Linked Google Cloud project**, choose `Create new project` and click **Link Project** button.
4. Scroll down to *Service accounts*, click on **Create new service account**.
5. Click on the **Google Cloud Platform** link.
6. Click on the **Create service account** button.
7. In the **Service account name** field, enter `Muly` and click **Create**.
8. In **Role** field, choose *Project* > *Viewer* and click **Continue** and then click **Done**.
9. From the list of *Service accounts*, locate *Muly* and click the menu button (3 vertical dots) then click **Create key**.
10. Choose `JSON` as **Key type** and click on **Create** to download the key file you will need later.
11. Go back to *Settings* > *Developer account* > *API access* in Play Console.
12. Click on **Refresh accounts** in *Service accounts* section.
13. Click on **Grant access** in your newly created service account e.g., `muly-xxx@pc-api-xxx-xx.iam.gserviceaccount.com` row.
14. In the *Account permissions* tab, turn on **View financial data, orders and cancellation survey responses** and **Manage orders and subscriptions** in *Financial data* section.
15. Click on **Invite user** and then lastly, **Send invitation**.

### Billing with Stripe

1. Go to <https://dashboard.stripe.com/> and login with your Stripe account.
2. From side menu, go to *Developers* > *API keys*.
3. Make note of your **Publishable key** and **Secret key**, you will need it later.

### Billing with PayPal

1. Go to <https://developer.paypal.com/developer/applications> and login with your PayPal account.
2. Go to *Live* tab and click on **Create App**.
3. Enter `Muly` in **App Name** field and click **Create App**.
4. Make note of the **Client ID** and **Secret**, you will need those later.

### Billing with Instamojo

1. Go to <https://www.instamojo.com/> and login to your Instamojo account.
2. In the side menu, click on **API & Plugins**.
3. Scroll down and click on **Create new Credentials** button.
4. Choose anything e.g., `WooCommerce/WordPress` and click **Generate Credentials** button.
5. Make note of the shown *Client ID* and *Client Secret*, you will need those later.

### Billing with Razorpay

1. Go to <https://dashboard.razorpay.com/> and login with your Razorpay account.
2. From side menu, click on **Settings** at the bottom.
3. Go to *API Keys* tab and generate a live key.
4. Make note of the **Key Id** and **Key Secret** as you will need them later.

### OTPs with Firebase

No specific credentials are needed.

### OTPs with MSG91

1. Go to [https://control.msg91.com/](https://control.msg91.com) and login to your MSG91 account.
2. From side menu, click on **Authkey** under *Configuration*.
3. **Create New** or copy your *Default* key, you will need it later.

### OTPs with Twilio

1. Go to <https://www.twilio.com/console> and login to your Twilio account.
2. Make note of the *account SID* and *auth token* for use later.
3. From side menu, click on **Verfiy** under *Engagement Cloud*.
4. In *Services* tab, click on **Create new service**.
5. Enter `Muly` in the **Friendly name** field and **Create**.
6. Copy the **Service ID** as you will need it later.

### Live streaming (using Agora)

1. Go to <https://console.agora.io/> and login to your Agora account.
2. From the sidebar, go to **Project management**.
3. Click on **Create** button.
4. Enter a **Project name** e.g., `Muly`.
5. Select any **Use case** e.g., `Social / Live stream`.
6. in **ID authentication** type, choose `Secured mode: APP ID + Token`.
7. Click on **Submit** button.
8. Click edit (pencil) icon on the right of your newly created project.
9. Copy **App ID** and **App certificate**, you'll need them later.

### Location with Google Maps

1. Go to [https://console.cloud.google.com/](https://console.cloud.google.com/billing) and login with your Google account.
2. From the side menu, click on **Billing** and then click on **Create Account** button.
3. In the **Name** field, enter your `Muly` and choose `Google Maps Platform` in the **Business the billing account will pay for** field.
4. Click on **Create**, complete your *Payments profile* and create **Submit and Enable Billing** button.
5. Now go to <https://console.cloud.google.com/projectselector2> and click on **Create Project** button.
6. In the **Project name** field, enter `Muly`.
7. In the **Billing account** field, choose the billing account we just created i.e., `Muly`.
8. Click **Create** button and wait for project creation to finish.
9. Not go again to <https://console.cloud.google.com/projectselector2> and click the **Select Project** button.
10. From the side menu, go to **APIs & Services** > **Library**.
11. Click on **Places API**, then click on **Enable**.
12. From the side menu, go to **APIs & Services** > **Credentials**.
13. Click on the **Create Credentials** button and choose `API key`, then click on **Restrict** button.
14. Under *Application restrictions*, choose `Android apps` and then click on **Add an Item** button.
15. Enter your package name e.g., `com.yourapp.android` in the **Package name** field.
16. Paste the SHA-1 key hash (obtained earlier) from generated keystore in **SHA-1 certificate fingerprint** field.
17. Click on **Done** button and lastly, click on **Save**.
18. Copy and make note of the value under **Key** column, you will need this later.
