Skip to content

Introduction

Beignet is an opinionated TypeScript application framework. It gives APIs, business rules, and infrastructure defined places in your app, with shared conventions and tools to check them as the application grows.

Choose your starting point

  • Create an app — run the Next.js starter with sign-in and persistent Todos, then change a validation rule across the form and API.
  • Add to an existing app — add one typed endpoint alongside your existing Next.js routes and adopt more structure as the feature needs it.
  • Learn by building — build a Projects feature through its API, ownership rules, and React UI, with a checkpoint after each chapter.
  • Complete a task — find a guide for background work, email, uploads, webhooks, testing, or deployment.

You can follow any of these paths with a coding agent. Build with an agent explains how to start a session, inspect the app, and verify the changes together.

What Beignet owns

A feature has three main responsibilities:

ResponsibilityBeignet's approach
Describe how callers use itContracts define HTTP inputs and responses. Shared schemas connect validation, typed clients, forms, and OpenAPI.
Apply the business rulesUse cases own application workflows and authorization, so routes, jobs, and scripts can call the same operation.
Connect the services it needsPorts define dependency interfaces. Adapters and providers connect the database and external services.

The CLI generates these pieces, maps their relationships, and checks dependency boundaries and wiring. Your tests verify the behavior the application needs. Read the mental model to follow a request through these responsibilities, or use App architecture to locate a change in an existing codebase.

How it fits with Next.js

Next.js owns pages, layouts, rendering, and the application host. Beignet organizes the API contracts, business workflows, and infrastructure behind those pages. Thin Next.js route handlers expose Beignet's HTTP API; React components can call it through typed clients and form adapters.

Use Beignet when you want consistent boundaries for features that grow beyond an endpoint. You can start with a contract and handler, then introduce use cases and dependency ports when you have business rules or infrastructure to separate. See Comparisons for tradeoffs and alternatives.

Other hosts can use the Web Fetch adapter. The introductory walkthroughs use Next.js and SQLite so you can follow one tested setup from installation to a working feature.

What comes with the starter

The full-stack Next.js starter includes Better Auth sign-in and sign-up, a database-backed Todos feature with ownership checks, a shadcn/Tailwind UI shell, typed client integration, and feature tests. SQLite is the default database; Drizzle manages its schema and checked-in migrations.

Add jobs, uploads, notifications, schedules, and other capabilities when a feature needs them. Generators create the relevant files and wiring; configure providers and runtime entrypoints for the services you choose. These optional capabilities are not all installed by the starter.

Find the right level of detail

  • Start gets a new or existing application running.
  • Learn follows the Projects tutorial in order.
  • Guides complete specific tasks and explain how to verify the result.
  • Architecture and capability pages explain the application model, production concerns, and available choices.
  • Reference covers CLI commands, package imports, agent tools, and API signatures.

Search for a task or an exact API name. Use Copy page or Open Markdown to share a page with your agent, and use the agent instructions to select guidance for the installed packages.

Beignet is alpha software and APIs can change between releases. Read Stability and releases before adopting it in a production app.

Start with the quickstart, or add Beignet to your existing Next.js app.