Skip to content

Commit

Permalink
GitBook: [akash-network#238] Hyperlink edits in stoppable web 2.0 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Carruthers authored and gitbook-bot committed Dec 8, 2021
1 parent e077e2e commit 346c94d
Showing 1 changed file with 18 additions and 23 deletions.
41 changes: 18 additions & 23 deletions deploy/unstoppable-web-2.0.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Unstoppable Web 2.0

**Repository:** [https://github.com/coffeeroaster/unstoppable-web2.0/ ](https://github.com/coffeeroaster/unstoppable-web2.0/)
Repository repository is located [here](unstoppable-web-2.0.md#decentralized-infrastructure).

This repository serves as a general guide and proof of concept for **deploying a full-stack web application onto blockchain-based decentralized infrastructure**.
This repository serves as a general guide and proof of concept for deploying a full-stack web application onto blockchain-based decentralized infrastructure.

The repository is structured as a **monorepo** - with **infrastructure configuration**, **application frontend code**, and **application backend code** all in one repository. This is done so that anyone can clone or fork this one repository and begin to experiment with deploying a decentralized web application.
The repository is structured as a monorepo - with infrastructure configuration, application frontend code, and application backend code all in one repository. This is done so that anyone can clone or fork this one repository and begin to experiment with deploying a decentralized web application.

### Decentralized infrastructure

| DNS | Frontend | Backend | Redundant Database |
| DNS | Frontend | Backend | <p>Redundant </p><p>Database</p> |
| ---------------------------------- | ---------------------------- | ------------------------------ | ----------------------------------- |
| | | | |
| [Handshake](https://handshake.org) | [Skynet](https://siasky.net) | [Akash](https://akash.network) | [Postgresql](http://postgresql.org) |
Expand All @@ -21,42 +21,38 @@ The demo application deployed in this guide is a note app - with create, read, d
| ---------------------------- | ---------------------------------------------- | ---------------------------------------- |
| [React](https://reactjs.org) | [Python FastAPI](https://fastapi.tiangolo.com) | [PostgreSQL](https://www.postgresql.org) |

The application structure is bootstrapped using this **cookiecutter** template [https://github.com/Buuntu/fastapi-react](https://github.com/Buuntu/fastapi-react). The **docker** image is based on [tiangolo/uvicorn-gunicorn-fastapi-docker](https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker).
The application structure is bootstrapped using this [cookiecutter](https://github.com/Buuntu/fastapi-react) template. The **docker** image is based on this [image](https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker).

The application code, technology choices, and configuration used in this repository should provide a general enough base to fork and adapt, or just reference, for future decentralized web application development.

### Deployed Demo

A deployed **live demo** was deployed using the steps in this guide. Link below:

| Frontend URL | Backend URL |
| ---------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| [**Skynet URL**](https://0000ac8v9uf92otn28omnuqfan0qd05f3gjrsfoonjpjl3m3ir7qds8.siasky.net/#) | [https://unstoppablestack.coffeeroaster.me/](https://unstoppablestack.coffeeroaster.me) |
A deployed [live demo](https://0000ac8v9uf92otn28omnuqfan0qd05f3gjrsfoonjpjl3m3ir7qds8.siasky.net/#) was deployed using the steps in this guide.&#x20;

## Guide

### Step 1 - Buy Handshake domain

There are a few simple options for registering a **Handshake** domain name:

1. Use a platform like **Namebase** [https://www.namebase.io/](https://www.namebase.io) or a tool like **Bob Wallet** [https://github.com/kyokan/bob-wallet](https://github.com/kyokan/bob-wallet) to purchase a top-level Handshake domain.
1. Use a platform like [Namebase](https://www.namebase.io) or a tool like [Bob Wallet](https://github.com/kyokan/bob-wallet) to purchase a top-level Handshake domain.

Domain purchases using Handshake are achieved through an [auction process](https://www.namebase.io/blog/tutorial-3-basics-of-handshake-auction-and-bidding). It will take **10 days** for your auction to finalize. and a winning bid, before you can make use of the domain.
2. Use **gateway.io** [https://gateway.io/](https://gateway.io) to purchase a domain under one of gateway's existing top-level Handshake domains, like **.c** or **.api**. Domains purchased in this way are **usable immediately**.
2. Use [**gateway.io**](https://gateway.io) to purchase a domain under one of gateway's existing top-level Handshake domains, like **.c** or **.api**. Domains purchased in this way are **usable immediately**.

### Step 2 - Push Docker image

1. Make sure **Docker** [https://www.docker.com/](https://www.docker.com) is installed.
1. Make sure [Docker](https://www.docker.com) is installed.
2. **CD** to the directory where your `Dockerfile` is. For this repository, it is in `application/backend/Dockerfile`.
3. **Build** and **tag** docker image `docker build -t/: .`
4. **Login** to dockerhub `docker login --username=`. You will be prompted for a password.
5. **Push** your docker image to dockerhub `docker push`. Paste this yaml into the tool.

### Step 3 - Deploy back-end to Akash

If you haven't already, take the time to read through the **Akash deployment documentation** and familiarize yourself with the concepts and steps involved [https://docs.akash.network/guides/deploy](https://docs.akash.network/guides/deploy).
If you haven't already, take the time to read through the [Akash deployment documentation](https://docs.akash.network/guides/deploy) and familiarize yourself with the concepts and steps involved.

You can deploy to Akash using the **standard Akash CLI** directly [https://docs.akash.network/guides/install](https://docs.akash.network/guides/install) but for the purpose of this guide, I am using **tombeynon's Akash Deploy UI** [https://github.com/tombeynon/akash-deploy](https://github.com/tombeynon/akash-deploy) which is a great tool built on top of the standard CLI. Steps for deploying to Akash using this tool are below.
You can deploy to Akash using the [standard Akash CLI ](https://docs.akash.network/guides/cli)directly but for the purpose of this guide, I am using [Tom Beynon's Akash Deploy UI](https://github.com/tombeynon/akash-deploy) which is a great tool built on top of the standard CLI. Steps for deploying to Akash using this tool are below.

1. Start the **Akash Deploy UI** tool by running the following:

Expand All @@ -77,7 +73,7 @@ You can deploy to Akash using the **standard Akash CLI** directly [https://docs.

Deployment of the front-end to Skynet is **handled automatically** in this repository, using **GitHub Actions**. When any update to the `application/frontend/` directory is pushed to the _master_ branch, the Action workflow will be run automatically by GitHub. This [workflow](https://github.com/bcfus/unstoppable-stack/blob/master/.github/workflows/frontend.yml) tests, builds, and deploys the static files to **Skynet**.

This GitHub workflow is based on the excellent write-up by **Karol Wypchło** [https://blog.sia.tech/automated-deployments-on-skynet-28d2f32f6ca1](https://blog.sia.tech/automated-deployments-on-skynet-28d2f32f6ca1) and uses his pre-built Skynet deploy Action.
This GitHub workflow is based on the excellent [write-up by Karol Wypchło ](https://blog.sia.tech/automated-deployments-on-skynet-28d2f32f6ca1)and uses his pre-built Skynet deploy Action.

The result of this GitHub Action is a **Skynet registry entry** that provides a constant point of reference for your DNS record. The **Skylink** itself changes with each deployment to Skynet and would require you to constantly update your DNS record if referencing it directly.

Expand All @@ -91,7 +87,7 @@ If using **Namebase**, you can now configure your Handshake domain to point to y

This **initial DNS configuration can take up to \~6 hours to be synced**. For all future code changes pushed to the _master_ branch, the _Deploy to Skynet_ Action will automatically update your Skynet Registry data and you should see the changes reflected very quickly.

**Once the DNS change takes effect**, your site will be accessible at `https://.hns.siasky.net`. For example, the demo application for this guide is accessible at [https://unstoppable-stack.hns.siasky.net/](https://unstoppable-stack.hns.siasky.net)
**Once the DNS change takes effect**, your site will be accessible at `https://.hns.siasky.net`. For example, the demo application for this guide is accessible [here](https://unstoppable-stack.hns.siasky.net).

### Step 6 - Setup HTTPS URL for API

Expand Down Expand Up @@ -238,12 +234,11 @@ You can now **visit** [**http://localhost:3000**](http://localhost:3000) in the

**Akash**

* Akash deployment documentation [https://docs.akash.network/guides/deploy](https://docs.akash.network/guides/deploy)
* Akash multi-tier SDL guide [https://github.com/ovrclk/docs/blob/master/guides/multi-tier-app.md](../guides/multi-tier-app.md)
* SDL examples [https://github.com/ovrclk/awesome-akash](https://github.com/ovrclk/awesome-akash)
* In-depth walkthrough guide [https://medium.com/coinmonks/guide-to-deploying-applications-to-akash-decloud-b35dc97e5ca4](https://medium.com/coinmonks/guide-to-deploying-applications-to-akash-decloud-b35dc97e5ca4)
* Akash Discord [http://discord.akash.network/](http://discord.akash.network)
* [Akash deployment documentation](https://docs.akash.network/guides/deploy)
* [SDL examples](https://github.com/ovrclk/awesome-akash)
* [In-depth walkthrough guide](https://medium.com/coinmonks/guide-to-deploying-applications-to-akash-decloud-b35dc97e5ca4)
* [Akash Discord](https://discord.com/invite/DxftX67)

**Skynet**

* Detailed Skynet deployment guide [https://blog.sia.tech/automated-deployments-on-skynet-28d2f32f6ca1](https://blog.sia.tech/automated-deployments-on-skynet-28d2f32f6ca1)
* [Detailed Skynet deployment guide](https://blog.sia.tech/automated-deployments-on-skynet-28d2f32f6ca1)

0 comments on commit 346c94d

Please sign in to comment.