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-5/

Build a User Registration and Profile API

Problem/Feature Description

Build a Spring Boot REST API for user registration and profile management. Use Spring Boot 3 and Java 17+.

Domain concepts:

  • User: id, email (unique), displayName, passwordHash, role (USER/ADMIN), createdAt, lastLoginAt
  • Profile: id, userId, bio, avatarUrl, location, website

Endpoints:

  • POST /api/auth/register -- register a new user (email, displayName, password). Email must be unique. Password must be at least 8 characters.
  • POST /api/auth/login -- authenticate user (email, password), return a success response
  • GET /api/users/:id/profile -- get user profile (public info only: displayName, bio, avatarUrl, location)
  • PUT /api/users/:id/profile -- update profile (bio, avatarUrl, location, website)
  • GET /api/admin/users -- list all users (admin only, includes email and role but not passwordHash)

Business rules:

  • Email must be unique and valid format
  • Password is stored hashed (use BCrypt)
  • Profile is created automatically when a user registers
  • Public profile endpoint must never expose email or passwordHash
  • Admin endpoint returns different fields than public profile

Use PostgreSQL for the database.

Output Specification

Produce a complete Spring Boot project with:

  • Main application class
  • All Java source files
  • Spring Security configuration for the auth endpoints
  • Configuration files
  • Database schema
  • Test classes for registration validation and profile retrieval
  • pom.xml with dependencies

You may create additional files as needed.

evals

tile.json