CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/nextjs-api-patterns

Next.js App Router API patterns — Route Handlers, Server Actions, middleware, validation, caching, error handling

92

1.58x
Quality

90%

Does it follow best practices?

Impact

95%

1.58x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Build a Contact Form with Server Action

Problem/Feature Description

Build a Next.js App Router page with a contact form. When submitted, the form should save the message to an in-memory store and show a success message.

Form fields:

  • Name (required, min 2 characters)
  • Email (required, must be valid email format)
  • Subject (required)
  • Message (required, min 10 characters)

The page should:

  • Show the form at /contact
  • Display validation errors inline next to each field
  • Show a success message after submission
  • Show a loading state while submitting
  • Also list previously submitted messages at /contact/messages (admin page)

Output Specification

Produce:

  • app/contact/page.tsx -- the contact form page
  • app/contact/messages/page.tsx -- page listing submitted messages
  • Server Action for handling the form submission
  • package.json with dependencies

You may create additional files as needed.

evals

tile.json