Skip to content

Project Structure

pnpm create bight generates an opinionated src/ layout. The directory names stay consistent as the app grows, so learning them once pays off across the entire documentation.

  • Directorysrc/
    • bight.ts Framework entry
    • Directorycommands/ Slash command definitions
    • Directoryconfig/ Static configuration
    • Directoryevents/ Discord client event listeners
    • Directoryfeatures/ Feature modules
    • Directoryinteractions/ Button, modal, and select menu handlers
    • Directoryplugins/ Lifecycle hooks
    • Directorypreconditions/ Reusable access-control rules
    • Directoryservices/ App-owned integrations
    • Directorystorage/ Storage adapter configuration

Depending on CLI selections, you may also see i18n/, message-commands/, prefix-commands/, or db/.

The surfaces users touch. commands/ holds slash command definitions; interactions/ holds component handlers (buttons, modals, selects). For logic shared across multiple commands, extract it into services/ or features/.

Your app’s external integrations: database clients, cache layers, error reporters, localization. Services are explicitly defined and passed through the context object. See Services.

Code that hooks into the app lifecycle without being called directly. Startup checks, persistent schedulers, devtools, and global preconditions live here. See Plugins.

When a flat commands/ + interactions/ layout stops scaling, group related logic by domain using Feature Modules.

The adapter configuration for Bight’s internal key-value store (framework settings, plugin state). Not a replacement for your application database. See Settings & Data Strategy.

This file is the single point where client options, gateway intents, filesystem discovery, plugins, and runtime policies come together. You’ll rarely need to modify it beyond the initial setup, but understanding its shape is important. It defines the boundary between your code and the framework.

Bight Registry