CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl-labs/springboot-project-structure

Spring Boot project structure — package-by-feature, record DTOs, Flyway migrations, multi-profile config, actuator, proper test structure

84

4.04x
Quality

76%

Does it follow best practices?

Impact

97%

4.04x

Average score across 5 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-2/

Build a Blog Platform Backend

Problem/Feature Description

Build the backend API for a simple blog platform using Spring Boot 3 and Java 17+.

Domain concepts:

  • Author: id, name, email, bio
  • Post: id, authorId, title, content, slug (unique, URL-friendly), status (DRAFT/PUBLISHED/ARCHIVED), publishedAt, createdAt, updatedAt
  • Comment: id, postId, commenterName, commenterEmail, body, createdAt, approved (boolean)

Endpoints:

  • POST /api/authors -- create an author
  • GET /api/authors/:id -- get author with their published post count
  • POST /api/posts -- create a post (starts as DRAFT, slug auto-generated from title)
  • GET /api/posts -- list published posts with pagination (page, size params), ordered by publishedAt desc
  • GET /api/posts/:slug -- get a single published post by slug, including author info and approved comments
  • PATCH /api/posts/:id/publish -- change post status to PUBLISHED and set publishedAt
  • POST /api/posts/:id/comments -- add a comment (commenterName and body required, starts as approved=false)
  • PATCH /api/comments/:id/approve -- approve a comment

Business rules:

  • Slugs are generated from titles (lowercase, hyphens, no special characters) and must be unique
  • Only DRAFT posts can be published
  • The public post listing only shows PUBLISHED posts
  • Comments start unapproved and must be explicitly approved
  • Author email must be unique

Use PostgreSQL for the database.

Output Specification

Produce a complete Spring Boot project with:

  • Main application class
  • All Java source files
  • Configuration files
  • Database schema
  • Test classes for post creation, slug generation, and comment approval flow
  • pom.xml with dependencies

You may create additional files as needed.

evals

tile.json