跳转到正文

入门指南

GitHub

本教程将涵盖哪些内容?

本教程涵盖的内容

本教程将演示如何从零开始启动 supabase 以及启动 edge functions

  1. 已克隆 capgo
  2. supabase

开始之前,请运行

终端窗口
supabase start

接下来你会看到类似这样的内容:

Started supabase local development setup.
API URL: http://localhost:54321
GraphQL URL: http://localhost:54321/graphql/v1
DB URL: postgresql://postgres:postgres@localhost:54322/postgres
Studio URL: http://localhost:54323
Inbucket URL: http://localhost:54324
JWT secret: [truncated]
anon key: supa_key_anon
service_role key: supa_key_admin

接下来打开 configs.json 并设置以下值:

{
"base_domain": {
"prod": "console.capgo.app",
"development": "development.console.capgo.app",
"local": "localhost:3332"
},
"supa_anon": {
"prod": "supa_key_anon",
"development": "supa_key_anon",
"local": "supa_key_anon"
},
"supa_url": {
"prod": "http://localhost:54321",
"development": "http://localhost:54321",
"local": "http://localhost:54321"
}
}

其中 supa_key_anon 是上一步获取的值。

接下来,确认你可以访问 localhost:54323 并检查该表 users 是否如下所示

Supabase dashboard 显示的 users 表

如果确认无误,请运行以下命令启动 edge functions:

终端窗口
supabase functions serve

并运行以下命令启动 frontend:

终端窗口
bun run serve

如果你正在使用 入门指南 要规划原生插件工作,请将其与 使用 @capgo/capacitor-updater 用于“使用 @capgo/capacitor-updater”中的原生能力, Capgo 插件目录 查看 Capgo 插件目录中的产品工作流, Capgo 提供的 Capacitor 插件 查看由 Capgo 提供的 Capacitor 插件中的实现细节, 添加或更新插件 关于“添加或更新插件”中的实现细节,以及 Ionic Enterprise 插件替代方案 关于“Ionic Enterprise 插件替代方案”中的产品工作流。