Corresponding tutorial 🔗.
This is a sample app demonstrating how to use Bytebase API to create and rollout a database change.
Say your organization already has a DevOps platform and you want to integrate the database change into the development workflow. This app is for you.
The app is built with Next.js and TailwindCSS.
- Node >= 18
- Check out Self-host Bytebase via docker for more information.
- Create a service account.
Choose the
DBA
role which is sufficient for this sample.
- Record the service account key.
-
Clone this repository.
-
Copy
env-template.local
to.env.local
.cp env-template.local .env.local
-
Update the env file with the created service account.
NEXT_PUBLIC_BB_HOST
. The host where Bytebase is running. This usually is the external url.NEXT_PUBLIC_BB_SERVICE_ACCOUNT
. The service account created in step 1.NEXT_PUBLIC_BB_SERVICE_KEY
. The service key created in step 1.
-
Run the following commands:
pnpm i && pnpm dev
Open the host with your browser to see the running app.
API Doc: https://github.com/bytebase/bytebase/blob/main/proto/gen/grpc-doc/v1/README.md
In src/app/page.tsx
:
-
List all projects
/v1/projects
-
List all databases
/v1/instances/-/databases
In src/app/components/add-issue-form.tsx
and src/app/api/xxxx/route.ts
:
In order to create an issue, you need to create resources in the following order:
In src/app/components/add-issue-form.tsx
:
- Get issue by id
/v1/projects/{project}/issues/{issue}
added 2024/8/15, which is not included in the tutorial