bknd logo

Introduction

bknd is in beta

We're making great progress towards v1, but don't recommend production use yet. Follow along for updates on GitHub Releases and in our Discord community

Welcome! bknd is the instant backend for your frontend with full REST API's, admin dashboard, auth and user management, file upload management, type-safe SDK, React hooks, and plugins to extend the bknd (like our resend plugin for sending emails). bknd can be hosted with your server-side rendered (SSR) web app or hosted as a standalone app.

bknd is incredibly lightweight and built upon Web Standards, so that you can bring bknd anywhere JavaScript runs.

Bring your favorite frontend and favorite SQL database, and we'll bring the backend bknd.

Quickstart: bknd server and admin dashboard demo

This demo bknd instance is for playing and learning

Don't worry about messing anything up in this stage since you're learning the ropes of bknd. If you want to start over, please delete the generated data.db database file and follow this tutorial again.

Enter the following command to spin up a bknd instance via the bknd CLI:

npx bknd run
bunx bknd run

This will create a local data.db SQLite database file in the folder you ran the command and start the bknd web server at http://localhost:1337.

By default, access to the admin dashboard is open and not guarded. This is intentional because bknd uses an opt-in philosophy model to allow for quick prototyping and intentional configuration. To restrict access and prevent unauthorized use, let's enable authentication and guard the dashboard.

We will create a user and an admin role. We will then apply the admin role to the user. Then, we can lock down the admin dashboard by enabling the guard, securing access to your bknd app. Let's begin.

  1. Visit http://localhost:1337/auth/settings. Toggle "Authentication Enabled" to enable auth. Select "Update" to save.
  2. Visit http://localhost:1337/data/entity/users. Create a user by selecting "New User" and entering an email and password.
  3. Visit http://localhost:1337/auth/roles. Create an admin role by selecting "Create new". Name it "Admin" and select "Create". Then, scroll to the bottom of the page and enable "Implicit allow missing permissions?". Select "Update" to save.
  4. Visit http://localhost:1337/data/entity/users. Select on your newly created user, select the "Admin" role, and select "Update".
  5. It's time to guard your admin dashboard. Visit http://localhost:1337/settings/auth. Select "Edit". Scroll to "Guard" and enable it. Then, select "Save". (This should log you out!)
  6. Now, log in to your secured admin dashboard at http://localhost:1337/auth/login.

You did it! 🥳 You've successfully started the bknd server and admin dashboard, created an admin user, and protected your bknd app by enabling the guard.

What you've just experienced is called UI-only mode, where the bknd data and configuration is managed via the admin dashboard UI. Some may prefer the UI-only mode, while others may prefer the code-only mode.

bknd modes

bknd supports multiple modes to suit your needs.

Demo bknd in the browser

Here is a preview of bknd in StackBlitz:

If you’re having issues viewing it inline, try in a new tab.

Start with a Framework/Runtime

Start by using the integration guide for these popular frameworks/runtimes. There will be more in the future, so stay tuned!

Use your favorite SQL Database

The following databases are currently supported. Request a new integration if your favorite is missing.