惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threatpost
Project Zero
Project Zero
Know Your Adversary
Know Your Adversary
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
T
Tenable Blog
Scott Helme
Scott Helme
T
Tor Project blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
NISL@THU
NISL@THU
Cisco Talos Blog
Cisco Talos Blog
Security Latest
Security Latest
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
Help Net Security
Help Net Security
Google DeepMind News
Google DeepMind News
Cloudbric
Cloudbric
C
Check Point Blog
Jina AI
Jina AI
Webroot Blog
Webroot Blog
量子位
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
H
Heimdal Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
人人都是产品经理
人人都是产品经理
N
News and Events Feed by Topic
www.infosecurity-magazine.com
www.infosecurity-magazine.com
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
L
LINUX DO - 热门话题
The GitHub Blog
The GitHub Blog
T
Troy Hunt's Blog
PCI Perspectives
PCI Perspectives
Vercel News
Vercel News
N
News | PayPal Newsroom
A
Arctic Wolf
T
The Blog of Author Tim Ferriss
博客园 - 司徒正美
博客园 - 叶小钗
Y
Y Combinator Blog
V
V2EX
美团技术团队
O
OpenAI News
Microsoft Security Blog
Microsoft Security Blog
AWS News Blog
AWS News Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Stop Rebuilding Your Backend: A Better AI-Assisted Development Workflow
buildbasekit · 2026-06-13 · via DEV Community

AI can generate backend code quickly. That does not automatically mean it helps you ship quickly.

When every new project begins with prompts for authentication, JWT configuration, refresh tokens, role checks, validation, exception handling, and file uploads, much of the promised speed is consumed by rebuilding infrastructure you have already solved.

The higher-leverage approach is straightforward:

Start with a stable backend foundation, then use AI to implement the product-specific behavior on top of it.

That shift gives the AI stronger context, keeps the architecture consistent, reduces prompt size, and moves engineering time toward the features users actually care about.

TL;DR

A productive AI backend workflow should look like this:

  1. Start with a reusable, production-oriented backend foundation.
  2. Run and verify the existing authentication, authorization, storage, and test flows.
  3. Give the AI clear architectural boundaries and repository context.
  4. Ask for small, product-specific changes instead of complete infrastructure rewrites.
  5. Review and test the new behavior, especially security-sensitive changes.

AI is most effective when it extends a known system. It is far less predictable when it must invent the entire system while implementing a feature.

The hidden cost of generating every backend from scratch

Most backend applications need the same baseline capabilities before meaningful product development begins:

  • registration and login
  • access and refresh tokens
  • role-based access control
  • protected routes
  • request validation
  • consistent exception handling
  • file upload and download APIs
  • security configuration
  • testable controller, service, and repository layers

These capabilities are essential, but they are usually not your product's differentiator.

Your users are not paying for another custom JWT filter. They are paying for the workflow, automation, data model, collaboration feature, or operational improvement your product delivers.

When AI repeatedly regenerates the foundation, your team still has to review it. That means checking security rules, package structure, token behavior, naming conventions, validation, persistence logic, and test coverage before product work can safely continue.

The output may be generated quickly. The review burden is not.

Why AI-generated backend setup starts to drift

Backend infrastructure is a connected system. Authentication affects authorization. Authorization affects routes. Routes depend on DTOs, services, repositories, validation, and exception handling. File access may depend on both authentication and ownership rules.

When each concern is generated in a separate conversation or prompt, the code can drift:

  • package structures change between iterations
  • DTOs and entities take on inconsistent naming
  • security rules conflict with previously generated endpoints
  • controllers absorb logic that belongs in services
  • repositories are used directly from unrelated layers
  • exception responses change across features
  • tests become harder to maintain because the architecture keeps moving
  • every correction requires more context and more tokens

The problem is not that AI is incapable of backend development.

The problem is assigning AI the wrong job. Recreating cross-cutting infrastructure is a poor use of a coding agent when a reviewed implementation can be reused. Extending an established codebase is a much better fit.

What a reusable backend foundation should already solve

A useful boilerplate should remove repetitive setup without locking your product into a rigid design.

At minimum, the foundation should provide clear solutions for:

Authentication and token lifecycle

Registration, login, password handling, access tokens, refresh tokens, logout behavior, and authentication errors should follow one consistent flow.

Authorization

Roles and permissions should be enforced through predictable route or method-level rules rather than scattered conditional checks.

File handling

Uploads, downloads, streaming, metadata, ownership, validation, and storage boundaries should be explicit. The implementation may use local storage, S3, or another provider, but product code should not depend directly on storage details.

Validation and error handling

Requests should be validated consistently, and API errors should follow a stable response format.

Layer boundaries

Controllers should manage HTTP concerns. Services should own business behavior. Repositories should handle persistence. Security and storage integrations should remain isolated.

Testing structure

The codebase should make it practical to test services and endpoint behavior without bootstrapping unrelated infrastructure for every test.

Once those decisions are stable, AI can follow existing patterns rather than inventing new ones for each task.

A better workflow for AI-assisted backend development

1. Start with a backend foundation

Do not begin with an empty repository unless learning the setup is the objective.

For product delivery, start with a codebase that already implements the common infrastructure. For example, BuildBaseKit provides:

  • AuthKit-Lite for Spring Boot JWT authentication, refresh tokens, and role-based access
  • FiloraFS-Lite for lightweight local file storage APIs
  • FiloraFS-Pro for authentication, S3 integration, file management, streaming, and production-oriented storage workflows

The objective is not to avoid understanding the code. The objective is to avoid paying the setup cost repeatedly.

2. Verify the foundation before asking AI to extend it

Run the project and test the baseline flows first.

Confirm that the following work as expected:

  • registration and login
  • access-token authentication
  • refresh-token behavior
  • protected endpoints
  • role checks
  • file upload and retrieval
  • validation failures
  • exception responses
  • existing automated tests

This step establishes a known-good baseline. Without it, you cannot reliably tell whether a later failure came from the foundation, the generated change, or the interaction between them.

3. Give the AI explicit project context

A codebase provides useful constraints only when those constraints are visible.

Document the architecture, conventions, commands, and boundaries that a coding agent should follow. Useful repository files include:

  • AGENTS.md for agent-specific working instructions
  • ARCHITECTURE.md for package responsibilities and system design
  • AI_RULES.md for non-negotiable conventions and prohibited changes
  • AGENT_CONTRIBUTING.md for implementation and verification steps

BuildBaseKit's AI-ready Spring Boot foundations use this type of documentation to help coding agents understand the repository before changing it.

Good context should answer questions such as:

  • Where does business logic belong?
  • Which security flows must remain unchanged?
  • How are errors represented?
  • Which commands run the tests?
  • What naming conventions are already in use?
  • Which modules may a feature modify?
  • What must be verified before a change is considered complete?

The goal is to reduce guesswork.

4. Ask for product behavior, not solved infrastructure

Avoid broad prompts such as:

Build JWT authentication in Spring Boot with refresh tokens, role permissions, validation, exception handling, and file upload integration.

That prompt forces the model to make too many architectural decisions at once.

Prefer focused requests tied to the existing application:

Add an organization invitation endpoint using the existing authentication and email patterns.

Create a billing service that follows the current controller and service structure.

Add admin-only file approval using the existing role checks and file metadata model.

Add tests for the team-invite flow without changing the current security configuration.

These prompts define a smaller change surface. They are easier to implement, easier to review, and less likely to destabilize unrelated code.

5. Test the feature instead of debugging the entire platform

When authentication, storage, validation, and exception handling are already stable, tests can focus on the new behavior.

For an organization invitation feature, for example, the relevant questions become:

  • Can an authorized user create an invitation?
  • Is the invitation scoped to the correct organization?
  • Are duplicate or expired invitations handled correctly?
  • Are unauthorized roles rejected?
  • Does the API return the established error format?

That is a cleaner engineering loop than debugging token parsing, security filters, storage paths, and invitation logic at the same time.

Security-sensitive generated code still requires human review. A boilerplate reduces repeated work; it does not remove engineering accountability.

Smaller prompts reduce token usage and review cost

Large prompts repeatedly restate architecture, security requirements, authentication behavior, validation rules, file storage expectations, and response formats.

Compare these two requests:

Build secure JWT authentication with refresh tokens, role permissions, validation, exception handling, and file upload integration.

and:

Add a team invitation endpoint using the existing authentication and validation patterns.

The second prompt is smaller because the repository already contains the decisions. It also produces a smaller patch, which generally means:

  • fewer generated files
  • fewer unrelated architectural changes
  • less prompt context
  • faster code review
  • easier rollback
  • more targeted tests

The real optimization is not merely lower token consumption. It is a reduced change surface.

Context beats a blank repository

When AI starts from an empty project, it must decide all of the following before reaching your feature:

  • package structure
  • naming conventions
  • API response shape
  • security configuration
  • token lifecycle
  • service boundaries
  • persistence patterns
  • validation strategy
  • exception handling
  • test organization

Some of those decisions may be reasonable in isolation and still conflict with one another as the project evolves.

An established codebase turns those open-ended decisions into constraints. That is an advantage.

Productive AI development is not about maximizing the volume of generated code. It is about generating the right code inside a system whose rules are already understood.

A predictable Spring Boot structure makes extension easier

A simple layered structure gives both developers and coding agents a clear map:

src/main/java/com/example/app/
├── controller/
├── service/
├── security/
├── model/
├── repository/
├── dto/
├── exception/
└── config/

The exact package names are less important than consistent ownership.

A controller should not become a second service layer. A repository should not enforce route permissions. Security classes should not contain product workflows. Storage-provider code should not leak into unrelated business logic.

When the boundaries are predictable, an AI agent can inspect a similar feature and implement the next one using the same pattern.

Common mistakes to avoid

Regenerating authentication for every product

Authentication is security-critical and highly repetitive. Reuse a reviewed implementation, then customize only what the product requires.

Asking for file uploads before defining storage rules

Clarify ownership, access control, size limits, allowed file types, metadata, retention, delivery, and storage-provider boundaries first.

Mixing product logic with security configuration

Security should establish identity and access. Product services should implement workflows. Combining them makes both harder to reason about.

Accepting generated security code without review

AI-generated security configuration can look plausible while containing unsafe defaults, incomplete route coverage, or broken token behavior. Review it manually and test negative cases.

Writing one massive implementation prompt

Large prompts create large patches. Split work into independently testable changes with explicit boundaries.

Measuring output instead of delivery

Lines of generated code are not a useful success metric. Review time, defect rate, test coverage, change safety, and time to a working feature matter more.

When building from scratch still makes sense

Reusable foundations are not the correct answer for every situation.

Build the infrastructure yourself when:

  • your primary goal is learning how authentication, storage, or Spring Security works
  • the system has unusual security or compliance requirements
  • the product requires a fundamentally different architecture
  • the existing boilerplate would require more modification than reuse

For most conventional product backends, however, rebuilding the same setup is not differentiation. It is duplicated effort.

A practical strategy is to build these systems from scratch once for understanding, then reuse a clean and reviewed implementation for future products.

For a deeper comparison, read Spring Boot Authentication Boilerplate vs Building From Scratch.

Build products, not setup

Your users do not care how many prompts were required to generate authentication or how quickly an agent produced a security configuration.

They care whether the product solves their problem reliably.

Use reusable foundations for repeated backend infrastructure. Use AI for the workflows, integrations, rules, and experiences that make your product different.

That division of responsibility creates a more scalable development model:

  • the boilerplate provides stable infrastructure
  • the repository documentation provides context
  • AI accelerates bounded implementation work
  • tests and code review protect system quality
  • developers remain accountable for architecture and security

Start with BuildBaseKit

BuildBaseKit provides Spring Boot backend foundations for authentication, file storage, and reusable application architecture.

The projects are designed to give developers—and their coding agents—a stable starting point so new work can focus on product behavior instead of repeated setup.

Explore the available Spring Boot boilerplates or read how BuildBaseKit approaches AI-ready project context.

Frequently asked questions

Does a backend boilerplate reduce flexibility?

Not necessarily. A good boilerplate standardizes common infrastructure while leaving product services, domain models, workflows, and integrations under your control. The key is choosing a foundation with clear boundaries and understandable code.

Why can this workflow reduce AI token usage?

The agent no longer needs the full authentication, authorization, storage, validation, and architecture specification in every prompt. The repository already contains those decisions, so prompts can focus on the incremental feature.

Is this approach particularly useful for Spring Boot?

Yes. Spring Boot applications benefit from predictable package boundaries, reusable Spring Security configuration, layered services, and explicit integration abstractions. Those patterns also make the codebase easier for coding agents to navigate.

Does a boilerplate make AI-generated code safe automatically?

No. It reduces the number of decisions the AI must invent, but generated changes still require review, tests, and security validation. Stable context improves the process; it does not replace engineering judgment.

Related BuildBaseKit articles


Originally published on BuildBaseKit. This DEV cross-post was adapted with AI-assisted editing and reviewed by the BuildBaseKit team before publication.