# Methodology

## User flow

<figure><img src="https://papers.21n.org/~gitbook/image?url=https%3A%2F%2F2100995886-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fa0vowDqinUbipjmyTujs%252Fuploads%252FWITm48Ym2xtkahMkAHL9%252F01_02%2520%285%29.jpg%3Falt%3Dmedia%26token%3D0e8e83ad-09e2-4469-bad3-8eec7493a05d&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=860536ad&#x26;sv=2" alt=""><figcaption><p>User flow diagram</p></figcaption></figure>

1. When user visits [#software-provider](../terminology#software-provider "mention")'s (SP) website and prompts to sign up, user will enter their [#recloud-id](../terminology#recloud-id "mention"). For example: `id.kate.com`&#x20;
2. The software provider redirects the user to their lD URL or login URL.
3. User enters their credentials. [#recloud-provider](../terminology#recloud-provider "mention") performs authentication, checks user's access grants against the software provider and redirects to the software provider with access token or a prompt to user to grant access as per [OAuth 2.0](https://www.rfc-editor.org/rfc/rfc6749) specification.
4. Once the user is authenticated, software provider can choose to provide a trail version of the software served from their own server or let the user install the software on their own cloud.
5. If the user chooses to install the software on their cloud, software provider redirects to [#recloud-installation-url](../terminology#recloud-installation-url "mention") identified from access token.
6. Recloud provider checks access grant to install software and performs authorization if required.
7. Recloud provider installs software on user's cloud by running a background job to fetch the software from software provider's public repository URL or [#recloud-public-registry](../terminology#recloud-public-registry "mention") and run the code to create cloud resources and deploy the application.



## Software development life cycle

1.  The developer of the application writes code using the stack of their choice that supports serverless. Developer also writes infrastructure as code. Infrastructure like serverless functions or docker containers or serverless databases that the app requires can be used.&#x20;

    _Infra as Code examples: AWS CDK, Pulumi_
2. Developer adds support to recloud by using recloud SDKs which takes care of OAuth flow and app installation when users chooses to install their app.
3. Developer pushes code to their cloud repository like Github or Gitlab.
4. Developer signups on [#recloud-public-registry](../terminology#recloud-public-registry "mention") as a developer and establishes pipeline to push newest code from developer's cloud repository to recloud sandbox registry.
5. Developer can then test their applications by signing up with any recloud provider and installing their application from recloud sandbox registry.
6. Once the development is complete, the developer pushes the stable version of their app to recloud public registry.
7. Once published, any user can install the app either visiting developer's website or visiting recloud registry and completing the login.

<figure><img src="https://3190438665-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOu1WlJjUjJC0TWIDoymh%2Fuploads%2FEdvAQmngL7bxU10SoisJ%2F2023_04_05%20(2).jpg?alt=media&#x26;token=4dc37d83-a946-48d1-bd93-45bfb3854300" alt=""><figcaption><p>App development life cycle using Recloud</p></figcaption></figure>

## Recloud provider - implementation

A recloud provider is just another [#software-provider](../terminology#software-provider "mention").&#x20;

1. Once a [#client](../terminology#client "mention") signs up to use recloud, recloud provider will create and allocate a default private cloud or shared public cloud for the client and installs authentication module, installation module in it.&#x20;
2. Clients can choose to link their existing private cloud and virtual network from providers like AWS, Azure, GCP etc.
3. The authentication module exposes a URL which client can customize and use as their [#recloud-id](../terminology#recloud-id "mention"). Authentication module is just another application installed on client's cloud which takes care of authentication for client, for all of their applications.
4. The installation module takes care of installing a new application on client's cloud.
5. During installation, recoud provider will create and allocate a [#recloud-application-url](../terminology#recloud-application-url "mention")for each application so that client can access their applications.

