Prisma Next is in early access.Read the docs
NextFrameworks

Elysia

Build an Elysia API on Prisma Next with the elysia template.

Introduction

In this guide, you scaffold an Elysia API backed by Prisma Next, initialize and seed a PostgreSQL database, and serve data over HTTP. The elysia template generates the server, so most of the work is understanding the pieces.

Every command and response below was run end to end against a live Prisma Postgres database.

Prerequisites

  • Bun 1.1 or later (Elysia is Bun-first)
  • A PostgreSQL connection string, or nothing at all: the scaffold can create a Prisma Postgres database for you

1. Scaffold the project

bunx create-prisma@next create my-elysia-api --provider postgres --template elysia

Pick your database at the prompt. The template generates an Elysia server in src/index.ts with GET / and GET /users routes, the Prisma Next setup in src/prisma/, and package scripts for the database steps.

cd my-elysia-api

2. Initialize and seed the database

bun run db:init
bun run db:seed
"summary": "Applied 5 operation(s) across 1 space(s), database signed"
Seeded 3 users.

3. Run the server

bun run dev

The server starts on port 3000 (set PORT to change it):

curl http://localhost:3000/users
[
  { "id": "1", "email": "alice@prisma.io", "username": "alice", "name": "Alice", "createdAt": "2026-07-07T08:51:14.054Z" },
  { "id": "2", "email": "bob@prisma.io", "username": "bob", "name": "Bob", "createdAt": "2026-07-07T08:51:14.089Z" },
  { "id": "3", "email": "carol@prisma.io", "username": "carol", "name": "Carol", "createdAt": "2026-07-07T08:51:14.122Z" }
]

The route handler is ordinary Elysia code calling an ordinary Prisma Next query; there is no framework adapter in between. To add write routes, follow the same pattern as the Hono guide's POST route; the query code is identical.

Common gotchas

Prompt your coding agent

The scaffold installs Prisma Next skills for your coding agent. Prompts that map to this guide:

  • "Using the prisma-next-queries skill, add GET /users/
    that returns one user or a 404."
  • "Add a POST /users route that creates a user from the request body."

Next steps

On this page