Repository inventory

cameronapak/bknd-skills

Skills indexed from this repository, with install-style signals scoped to the repo.
26 skills52 GitHub stars0 weekly installsGitHubOwner profile

Overview

This skill helps you define relationships between Bknd entities: many-to-one, one-to-one, many-to-many, and self-referencing hierarchies. It covers both UI and code workflows, junction table options, mappedBy/inversedBy naming, and patterns for querying and updating relations. Use it to create reliable foreign keys, inverse navigation, and join-ready schemas.

How this skill works

In UI mode you add a Relation field on the child entity, pick the target entity and relationship type, name the field, then save and sync the database. In code mode you declare relations in the second argument to em(), using relation(entity).manyToOne/oneToOne/manyToMany and options like mappedBy, inversedBy, connectionTable, and extra junction fields. The skill also shows direct foreign-key .references() for simple FKs and common query/update patterns (with/join, $attach/$detach/$set).

When to use it

  • Creating parent/child links (posts → users) or exclusive pairings (user → profile)
  • Modeling many-to-many sets with optional extra fields (posts ↔ tags, order_items)
  • Building hierarchical self-references (categories → parent/children)
  • Prototyping quickly via the UI or keeping reproducible schemas in code
  • When you need custom FK names or junction table names (mappedBy, connectionTable)

Best practices

  • Use plural entity names (users, posts) to avoid "Entity not found" errors
  • Define relations inside the second argument to em() for code-mode schemas
  • Prefer mappedBy for semantic FK fields (author → author_id) and inversedBy for navigation backrefs
  • Use UI for quick prototyping and code mode for version control and team workflows
  • Avoid manually creating FK fields when using relation(); use .references() only for simple FKs without navigation

Example use cases

  • Blog: posts many-to-one users (author) and many-to-many tags with auto junction table
  • E-commerce: orders many-to-one customers and many-to-many products using order_items with quantity/unit_price
  • Nested categories: categories many-to-one categories with mappedBy parent and inversedBy children
  • Auth/profile: users one-to-one profiles for exclusive user data
  • Data migrations: switch to code mode to keep relations in version control and apply consistent schema changes

FAQ

Use .references() on a number field when you only need a foreign key column without inverse navigation or many-to-many support. Use relation() when you want model navigation, joins, or junction tables.

How do I avoid FK name conflicts like users_id already exists?

Set mappedBy to a different name (e.g., mappedBy: "author") so the generated FK becomes author_id instead of users_id.

26 skills

bknd-define-relationship
Api

This skill helps you define and configure entity relationships in BKND, supporting many-to-one, one-to-one, many-to-many, and self-referencing links.

BackendCode ReviewDataDatabase
bknd-seed-data
Automation

This skill helps you seed a Bknd database with initial, test, and dev data using code-first, idempotent patterns.

BackendDataDatabaseScripting+1
bknd-api-discovery
Api

This skill helps you discover and map Bknd's auto-generated REST endpoints, routes, and SDK methods for faster integration.

BackendDataDebuggingDocs
bknd-deploy-hosting
Api

This skill guides deploying a Bknd app to Cloudflare, Vercel, Docker, Node, and serverless platforms with production-ready defaults.

AutomationBackendCi CdCloud+1
bknd-env-config
Backend

This skill helps you manage environment variables for Bknd projects, guiding .env creation, secrets handling, and platform-specific configuration across dev

CloudDevopsSecurity
bknd-crud-create
Api

This skill helps you create records in Bknd using SDK or REST, including relations, responses, errors, and bulk operations.

BackendDataDatabaseDebugging
bknd-create-entity
Backend

This skill helps you create new entities in Bknd, offering UI and code-mode workflows with type-safe definitions.

CliCode ReviewDataDatabase+1
bknd-storage-config
Backend

This skill helps configure storage backends for Bknd's media module across s3, cloudinary, local, and r2 adapters, with environment-aware setups.

CloudDevopsDocsPerformance+1
bknd-session-handling
Api

This skill helps manage user sessions in Bknd apps by coordinating JWT lifecycles, storage, renewal, and invalidation.

BackendDevopsPerformanceSecurity
bknd-troubleshoot
Api

This skill helps you diagnose and fix bknd errors quickly by error code, symptom, or common pattern.

BackendDataDebuggingSecurity
bknd-crud-read
Api

This skill helps you query and retrieve data from Bknd entities using readOne, readMany, and readOneBy with filtering, sorting, and relation loading.

BackendDataDatabasePerformance
bknd-add-field
Backend

This skill helps you add fields to Bknd entities via UI or code, ensuring type safety, validation, and consistent schema evolution.

Code ReviewDatabaseDocsTesting
bknd-production-config
Api

This skill helps you prepare a BKND app for production by configuring production mode, JWT security, guards, CORS, media storage, and deployment readiness.

AutomationBackendCloudDevops+1
bknd-setup-auth
Api

This skill helps you initialize and configure Bknd authentication, including JWT, cookies, and roles for secure production-ready apps.

BackendSecurity
bknd-pagination
Api

This skill helps you implement robust offset-based pagination with page calculations, metadata, and React integration patterns for BKND data.

BackendDataDebuggingFrontend+1
bknd-create-user
Api

This skill helps you create new Bknd user accounts programmatically or via UI, handling seed, registration, and role assignment.

BackendDataDatabaseSecurity
bknd-crud-update
Api

This skill streamlines updating Bknd records via SDK or REST, supporting single, bulk, and relational updates with safe, structured responses.

BackendDataDatabase
bknd-assign-permissions
Api

This skill helps you configure fine-grained permissions for roles in Bknd, including simple strings, extended formats, policies, and entity-specific rules.

BackendDataDatabaseSecurity
bknd-file-upload
Api

This skill helps you upload files to Bknd storage using SDK or REST, with entity attachments and progress tracking.

BackendCloudFrontendTesting
bknd-registration
Api

This skill guides configuring and validating user self-registration in Bknd apps, simplifying forms, validation, roles, and error handling for smooth

BackendDocsFrontendSecurity
bknd-modify-schema
Backend

This skill helps you manage Bknd schema changes safely by guiding non-destructive edits, migrations, and synced deployment strategies.

CliDatabaseDevopsMigration
bknd-oauth-setup
Api

This skill helps you configure and integrate OAuth providers (Google, GitHub, and custom) in Bknd by guiding setup, env vars, and frontend flow.

BackendFrontendSecurity
bknd-create-role
Api

This skill helps you define and manage Bknd authorization roles, including permissions, defaults, and hierarchies, for secure, scalable access control.

BackendDataDocsSecurity+1
bknd-database-provision
Backend

This skill helps you provision and configure a production database for your Bknd app across SQLite, LibSQL, Cloudflare D1, PostgreSQL, Neon, Supabase, and Xata.

CloudDatabaseMigrationSql
bknd-local-setup
Backend

This skill guides you through setting up a local bknd project, including CLI, config, runtime, and dev server options.

CliDevops
bknd-testing
Backend

This skill helps you write and run unit and integration tests for Bknd apps using in-memory databases, test helpers, and mocks.

Ci CdIntegration TestsTestingUnit Tests
More from this maintainer
Other repositories and skills published under the same GitHub owner.
Skills library
Jump back to the full directory or explore grouped topics.
Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational