Skip to content

Instantly share code, notes, and snippets.

@linux-china
Created October 23, 2025 14:53
Show Gist options
  • Select an option

  • Save linux-china/ac314b1206bf764da593f72bc98af40e to your computer and use it in GitHub Desktop.

Select an option

Save linux-china/ac314b1206bf764da593f72bc98af40e to your computer and use it in GitHub Desktop.
AGENTS.md for Spring Boot application

Spring Boot application demo

This is a demo application with Spring Boot with DDD architecture, MySQL 8, Spring Data JDBC, Flyway for database migration.

Tech Stack

  • Java 25
  • Apache Maven 3.9.11
  • Spring Boot 4.0 with Spring MVC
  • Junit 5.13
  • AssertJ: Fluent assertions, please use it instead of JUnit assertions.

Project structure

  • base package: org.mvnsearch
  • RESTful API controller package: org.mvnsearch.web.rest
  • project base test: org.mvnsearch.ProjectBaseTest,new test class should extend org.mvnsearch.ProjectBaseTest

The project adopts Domain Driven Design architecture, and the domain model is in org.mvnsearch.domain package.

  • model package: org.mvnsearch.domain.model
  • service package: org.mvnsearch.domain.service
  • repository package: org.mvnsearch.domain.repository
  • infrastructure package: org.mvnsearch.domain.infra
  • implementation package for domain: org.mvnsearch.domain.impl, and interface and implementation mapping as below:
    • service(repository or infra) interface: org.mvnsearch.domain.service.XxxxService
    • service(repository or infra) implementation: org.mvnsearch.domain.impl.service.XxxxServiceImpl

Database

  • Main database: MySQL 8
  • Database migration: Flyway 11 and migration script directory: src/main/resources/db/migration
  • Database test: DbUnit with xml dataset, and dataset directory: src/main/resources/db/dataset
  • Spring Data JDBC: ORM for database access with JPA annotations

API Conventions

  • RESTful API controller base package: org.mvnsearch.web.rest
  • Base URL: /api/v1

Build and run

  • Build: mvn -DskipTests package
  • Run: mvn spring-boot:run

Java Guide line

  • Use jspecify to annotate nullable and non-nullable types: org.jspecify.annotations.NonNull and org.jspecify.annotations.Nullable
  • Use slf4j for logging

Configuration

The project uses src/main/resources/application.properties as configuration file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment