1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

[FlutterFlow] Supabase Edge FunctionsをDartで書くための手順

Posted at

背景&目的

以前はFirebase × FlutterFlowでアプリ開発を行っており、バックエンドインフラは主にGCP(Firebase・Cloud Run・CloudScheduler等)を使っていました。

しかし、NoSQLだとサービス規模の肥大化に伴い、使われていないフィールドが溜まってしまうことや、マーケターがSQLでの分析を行いづらいことからFirebase→Supabaseへの移行を検討しています。

そこで、今回はSupabaseでCloud Runのようなバックエンド構築を行う手順をまとめました。

今回はSupabase CLIをPCのローカル環境にインストールするまでの手順を解説します。

1.ローカル開発環境の構築

Supabase CLIをPCにインストール→開発→デプロイの流れで解説します。

Supabase CLIをPCにインストール

現在(2024/6月時点)Supabase CLIにはインストーラーが存在しないため、PowerShell(Windows)もしくはターミナル(Mac)を使用してインストールを行います。また、Windowsの場合はScoopというパッケージ管理ツールを経由してインストールを行う必要があります。

また、Windowsの場合はMacのhome brewのように最初からパッケージ管理ツールがインストールされているわけではないので、scoopのインストールが必要になります。

1.Scoopをインストールする(Windowsのみ) - Macの方はスキップしてください

まず、以下のコマンドを実行する。

Set-ExecutionPolicy RemoteSigned -scope CurrentUser

上記を実行すると以下の様に聞かれるので、yと入力してEnter

Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose you to the security risks described in the
about_Execution_Policies help topic at https:/go.microsoft.com/fwlink/?LinkID=135170.
Do you want to change the execution policy?
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y

次に以下のコマンドを実行する

invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

以上でScoopのインストールが完了します。

'scoop' は、内部コマンドまたは外部コマンド、
操作可能なプログラムまたはバッチ ファイルとして認識されていません。

上記のようなエラーが出てしまった方は【コントロールパネル】→右上のサーチバーに"環境変数"と入力し、【システム環境変数の編集】→【詳細設定タブの環境変数をタップ】→ユーザーの環境変数のPATHに「C:\Windows\system32」を追加しましょう。

スクリーンショット 2024-06-10 020320.png

2.Supabase CLIをインストールする

Supabase公式ドキュメント(https://supabase.com/docs/guides/cli/getting-started?queryGroups=platform&platform=windows) に従い、Supabase CLiをインストールしましょう。

・Windowsの場合

まず、以下のコマンドを実行します

scoop bucket add supabase https://github.com/supabase/scoop-bucket.git

次に、以下のコマンドを実行します。

scoop install supabase
・Macの場合

まず、以下のコマンドを実行します

brew install supabase/tap/supabase

次に、以下のコマンドを実行します。

brew upgrade supabase

以上でSupabase CLIのインストールが完了します。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?