Skip to Content
DocsCreate an app

Create an app

create-quickben writes a Next.js app with the REST routes, the admin UI and a database adapter. It installs the dependencies and creates a git repository.

pnpm create quickben my-app npm create quickben@latest my-app yarn create quickben my-app bun create quickben my-app

The CLI asks for the options you did not pass. With --yes, or without a terminal, it uses the defaults.

pnpm create quickben my-app --db postgres --example blog --yes npm create quickben@latest my-app -- --db postgres --example blog --yes

With npm, put -- before the options.

Options

OptionValuesDefault
[directory]Path of the new appquickben-app
--dbpglite, postgres, sqlite, memorypglite
--exampleblank, blogblank
--pmpnpm, npm, yarn, bunThe one running the command
--no-installDo not install dependencies
--no-gitDo not create a git repository
-y, --yesUse defaults, no prompts
-h, -vHelp, version

The directory must be new or empty. The git repository is skipped inside an existing work tree.

Starters

--exampleCollectionsHome page
blanknotesThe latest notes.
blogauthors, posts, one seeded postThe latest published posts.

Generated files

FilePurpose
quickben.config.tsCollections, database and auth.
lib/db.tsDatabase adapter for the chosen --db.
lib/auth.tsdevAuth() in development, anonymous in production.
app/api/[...quickben]/route.tsREST route handlers.
app/admin/[[...segments]]/page.tsxAdmin page with its server function.
app/admin/layout.tsxAdmin styles and page title.
app/page.tsxHome page that reads with the local API.
next.config.tsCache Components on. PGlite is not bundled.
.env.example, .env.localDev user and database settings. .env.local is ignored.

Databases

--dbAdapterDriver
pglite@quickben/db-drizzle/pglite, data in PGLITE_DATA_DIR (default .pglite)@electric-sql/pglite
postgres@quickben/db-drizzle/postgres, DATABASE_URLpg
sqlite@quickben/db-drizzle/sqlite, DATABASE_URL (default file:./app.db), DATABASE_AUTH_TOKEN for Turso@libsql/client
memory@quickben/db-memory, resets on restart

The Drizzle adapters create missing tables on start (push: true). Use migrations once the database holds real data.

Dev user and auth

In development, devAuth() signs you in as the user in QUICKBEN_DEV_USER in .env.local. Remove the variable to browse as an anonymous visitor.

In production every visitor is anonymous. Replace lib/auth.ts with an auth adapter before you deploy.

The @quickben/* versions in the app are the versions released with the CLI.

Last updated on