- star 数
- 3
- watcher 数
- 0
- fork 数
- 4
- issue 数
- 0
- 最終更新
- 2026/05/06
Nitro + Prisma + Zod codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.
This codebase was created to demonstrate a fully fledged fullstack application built with Nitro, Prisma, and Zod including CRUD operations, authentication, routing, pagination, and more.
For more information on how this works with other frontends/backends, head over to the RealWorld repo.
The RealWorld Demo App includes many implementations of the same project (a Medium clone), for which all frontends and backends are supposed to be switchable from one another as they all follow the same API.
It is supposed to reflect something similar to an early-stage startup's MVP, contrarily to some demo apps that are either too little or too much complex, and provide a good way to assert differences between frameworks.
| Layer | Technology |
|---|---|
| Runtime | Bun |
| Framework | Nitro (file-based routing) |
| Database | SQLite via libsql |
| ORM | Prisma |
| Validation | Zod |
| Auth | JWT (jsonwebtoken) + bcryptjs |
Nitro is a lightweight meta-framework for building server-side applications with file-based routing, auto-imports, and zero-config TypeScript support. Prisma provides type-safe database access, and Zod handles runtime schema validation.
As this repository only covers the API part, you may then connect a frontend to it after running the server.
git clone --recurse-submodules https://github.com/c4ffein/nitro-prisma-zod-realworld-example-app.git
cd nitro-prisma-zod-realworld-example-appIf you already cloned without --recurse-submodules, run make submodule to fetch the test specs.
curl -fsSL https://bun.sh/install | bashmake setup
# Run in development mode with hot reload make run # OR JWT_SECRET=your-secret-here bun run dev
The API is then available at http://localhost:3000/api.
make unit-test: Bun unit tests.make test-with-hurl: API integration tests using Hurl (manages the server automatically).make test-with-hurl-and-already-launched-server: Same, but expects the server to be already running.make test-with-bruno: API tests using Bruno (manages the server automatically).| Variable | Description | Default |
|---|---|---|
JWT_SECRET |
Secret key for JWT token signing | required |
DATABASE_URL |
Database connection URL | file:./dev.db |
BCRYPT_SALT_ROUNDS |
Number of bcrypt salt rounds | 10 |
Choose a frontend from codebase.show and configure it to point to http://localhost:3000.
If you would like to contribute to the project, please follow these guidelines:
This project is released under the MIT License.