Database setup

Database setup

Grabbr uses the server-only @workspace/db package for MySQL and MariaDB. The setup page is protected by a short-lived, one-time access code.

Start the flow

  1. Run pnpm setup:database from the monorepo root.
  2. Wait while the command starts Next.js when it is not already running.
  3. Open the printed URL and enter the six-digit code before it expires.
  4. Keep the terminal open during setup, then press Ctrl+C when finished.

If pnpm dev is already running, the command reuses it and exits after creating setup access. The database connection and schema are configured in the protected web page.

Test connection

The test button executes SELECT 1. It never drops tables and never saves credentials.

Save and create schema

Saving validates the connection, creates every missing managed table, writes the server connection to .env.local, and marks database setup complete. The destructive reset checkbox drops all managed prefixed tables before recreating them.

Managed tables

  • <prefix>users
  • <prefix>auth_user
  • <prefix>auth_session
  • <prefix>auth_account
  • <prefix>auth_verification
  • <prefix>media
  • <prefix>playlists
  • <prefix>download_links
  • <prefix>logs

The prefix accepts letters, numbers, and underscores only.

Secrets

The SQL password and generated BETTER_AUTH_SECRET are stored only in the ignored apps/web/.env.local file. They are not copied to data/app-settings.json and are never passed to a Client Component.