CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/prisma-best-practices

Prisma ORM patterns — schema design, migrations, type-safe queries, testing, error handling, and performance

96

1.28x
Quality

95%

Does it follow best practices?

Impact

100%

1.28x

Average score across 3 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-1/

Café Ordering System — Database Schema

Problem/Feature Description

A small café chain is launching an online ordering platform. Customers will be able to browse a menu of products (drinks and pastries), place orders with multiple items, and track their order status through a fulfillment workflow. The team is starting fresh with Prisma and PostgreSQL.

The backend team has sketched out the domain: there are products (with a category and price), orders (each belonging to a customer, with a lifecycle status), and order line items linking orders to products with a quantity and per-item price captured at the time of purchase. Products can be listed and filtered by category frequently. Orders are frequently filtered by their status and by when they were placed.

Your task is to design and write the complete Prisma schema for this system. The schema must be production-ready: suitable for a real PostgreSQL database, with proper types for all fields, and correctly modeling the relationships between entities.

Output Specification

Produce a single file prisma/schema.prisma containing the complete Prisma schema. The schema should:

  • Define all three models: Product, Order, and OrderItem
  • Include all fields needed to track prices, quantities, status, and timestamps
  • Configure the database connection for PostgreSQL
  • Be syntactically valid Prisma schema syntax

Do not include any application code — only the schema file.

evals

scenario-1

criteria.json

task.md

tile.json