What You Will Build
A production-ready Spring Boot codebase for an enterprise B2B application, generated from a paragraph. The generated app includes:
@SpringBootApplicationbootstrap with profiles- JPA
@Entityclasses and Spring Data repositories @RestControllerendpoints with method-level security (@PreAuthorize)- JWT authentication with Spring Security
- An audit-trail entity (who changed what, when) — table stakes for enterprise
- Organisation-scoped multi-tenancy
- Maven build,
application.properties, and a workingdocker-compose.yml
Spring Boot is the right pick for enterprise Java shops where audit trails, method security, and a mature ecosystem are requirements, not nice-to-haves.
Prerequisites
- An Archiet account (free at archiet.com/register)
- Docker installed locally
- 10 minutes
Step 1: Write a Minimal PRD
Procure is an enterprise B2B app for procurement teams. Organisations onboard
buyers. Buyers create purchase requests with a title, amount, cost centre, and
status (draft / submitted / approved / rejected), and approvers act on them.
Only members of an organisation see that organisation's requests. We need
login, password reset, and a full audit trail of who approved what and when.
Archiet extracts Organisation, User, PurchaseRequest, and the explicit audit-trail requirement — which it generates as a first-class entity.
Step 2: Open the Blueprint Wizard
Log in at archiet.com/login, click New Blueprint, paste the PRD, click Analyse, review the model.
Step 3: Choose Java Spring Boot
On the Generate screen, select Java Spring Boot, optionally add the SOC 2 overlay (which reinforces the audit trail), and click Generate.
Step 4: What You Get
procure/
├── src/main/java/com/procure/
│ ├── ProcureApplication.java
│ ├── purchaserequest/
│ │ ├── PurchaseRequest.java # @Entity
│ │ ├── PurchaseRequestRepository.java
│ │ ├── PurchaseRequestController.java
│ │ └── PurchaseRequestService.java
│ ├── security/ # JWT filter, SecurityConfig
│ └── audit/ # AuditLog entity + aspect
├── src/main/resources/application.properties
├── pom.xml
└── docker-compose.yml
The controller and entity are idiomatic Spring:
// PurchaseRequestController.java
@RestController
@RequestMapping("/api/purchase-requests")
public class PurchaseRequestController {
@GetMapping
@PreAuthorize("hasRole('BUYER')")
public List<PurchaseRequestDto> list(@AuthenticationPrincipal AppUser user) {
return service.findByOrg(user.getOrgId());
}
}
// PurchaseRequest.java
@Entity
@Table(name = "purchase_requests")
public class PurchaseRequest {
@Id @GeneratedValue(strategy = GenerationType.UUID)
private String id;
@Column(nullable = false)
private String orgId;
private BigDecimal amount;
@Enumerated(EnumType.STRING)
private RequestStatus status;
}
@PreAuthorize enforces role-based access at the method level, and findByOrg(user.getOrgId()) scopes every query to the caller's organisation.
Step 5: Run It Locally
cd procure
cp .env.example .env
docker compose up -d
# or, against a local Postgres:
./mvnw spring-boot:run
The API is at http://localhost:8080/api/. Every approve/reject action writes an AuditLog row — the evidence your enterprise compliance team will ask for.
What to Do Next
Lean on the ecosystem: the generated structure is standard Spring, so Spring Security, Spring Data, and Actuator integrations all apply.
Wire the audit trail to reporting: the AuditLog entity is queryable — build the compliance report your auditors need.
Other enterprise stacks: .NET offers an equivalent structure on the Microsoft stack; Go if you want a smaller, faster binary.
The generated ARCHITECTURE.md documents the security model, the audit-trail design, and the persistence decisions — consulting-grade documentation for an enterprise review.