LLM-Assisted Development: From Code Generation to System Design
Teams often begin by using large language models (LLMs) to generate isolated code snippets, but that approach becomes fragile once an application spans multiple pages, data sources, uploads, permissions, and AI capabilities. This article explains how to move LLM collaboration into the full engineering workflow—requirements decomposition, layered architecture, data and permission modeling, frontend state control, secure uploads, recoverable asynchronous AI tasks, module-by-module implementation, code review, and testing—using a wallpaper and image-processing app as the running example. It also examines where LLM assistance is most effective and what remains the developer’s responsibility.
In many development workflows, a large language model initially behaves more like a code snippet generator: a developer describes a button, list, or modal, the model quickly returns an implementation, and the developer then assembles it, debugs it, and fills in edge cases. This approach is useful for solving local problems, but it becomes difficult to control once a project involves multiple pages, multiple data sources, file uploads, access control, and AI capabilities. Fragmented code generation can quickly turn into a maintenance problem.
A more valuable approach is to bring the model into the complete software engineering process, letting it participate in requirements analysis, architecture design, data modeling, module decomposition, implementation, and testing. A small application with wallpaper browsing, user uploads, image analysis, and intelligent generation provides a useful example for examining both the strengths and limitations of this development model.
1. The Real Shift: From Generating Code to Building Systems
A complete application is not simply a collection of pages. It must address several categories of problems:
- How pages are organized and whether user flows are clear
- How image data is stored and how lists are paginated
- How uploaded files are compressed and how failures are retried
- How user data and public content are isolated
- How image analysis, prompt editing, and generation tasks are connected
- How pages display status while asynchronous tasks are running
- Whether users receive clear feedback when errors occur
If a developer asks, “Write a wallpaper masonry layout for me,” the model will usually return component code directly. It will not proactively consider pagination, empty states, duplicate loading, differences in image dimensions, or network errors. A more mature collaboration pattern is to provide the complete business objective first, then ask the model to produce a technical plan, module boundaries, and an implementation sequence.
For a wallpaper and image-processing application, a reasonable baseline architecture can be divided into four layers:
The first layer is the client, including the home page, category pages, detail pages, image-processing pages, and user center. The client handles interaction, state display, image previews, and basic validation.
The second layer is the business service layer. Cloud functions or backend APIs handle user authentication, content queries, upload records, task creation, and result persistence. Core business logic should not live entirely on the client; otherwise, permission leaks and data tampering become more likely.
The third layer is the data and file layer. Structured data is stored in a database, while original images and generated results are placed in object storage. The database stores only metadata such as file identifiers, access URLs, dimensions, categories, creation times, and ownership.
The fourth layer is the intelligent processing layer, which handles image understanding, prompt optimization, image generation, or image editing. This layer should be wrapped in a unified service so page code does not depend directly on a specific model or API.
The purpose of this layered design is to avoid extensive client-side changes if the model, storage method, or administrative backend needs to be replaced later.
2. Requirement Decomposition: Define Flows Before Requesting Implementation
Before writing code, it is useful to break requirements into four dimensions: pages, data, actions, and states.
2.1 Pages
Start by defining pages such as:
- Home: recommended wallpapers, category entries, and a paginated list
- Detail: a large image, author information, favorite and save actions
- Intelligent processing: upload, analysis, editing, and generation
- User center: upload records, generation history, and saved content
- Admin page: content moderation, category maintenance, and handling abnormal data
2.2 Data
A wallpaper record should contain at least:
idtitlecoverFileIdoriginalFileIdcategoryIdauthorIdwidthheightstatusdownloadCountcreatedAtupdatedAt
A user generation task can be designed as:
taskIduserIdsourceFileIdpromptoperationTypestatusresultFileIderrorMessagecreatedAtfinishedAt
The status field should not be limited to “success” and “failure.” More appropriate states include pending, processing, completed, failed, and canceled. Only then can the UI accurately reflect the progress of an asynchronous task.
2.3 Actions
Break user operations into explicit actions, such as:
- Load home page data
- Filter by category
- Load the next page when the user reaches the bottom
- Upload an image
- Delete an upload record
- Analyze an image
- Modify a prompt
- Create a generation task
- Query task results
- Save a generated image
2.4 States
Every action should have loading, success, failure, and retry states. If these states are not explicitly required, an LLM will often implement only the happy path, causing the interface to freeze or provide unclear feedback in real use.
3. Frontend Implementation: The Goal Is Controllable State, Not Just a Page That Opens
A wallpaper masonry layout looks simple, but it must handle different image aspect ratios, repeated pagination results, fast scrolling, and loading races.
Pagination can use either cursor-based requests or page numbers. In either case, the client should maintain state such as:
const state = {list: [],loading: false,finished: false,page: 1}
Before loading more data at the bottom of the list, the application must check both loading and finished to prevent repeated requests when the user scrolls continuously. When merging new data, it should also deduplicate by unique identifier so network retries do not introduce duplicate list items.
Image display also requires attention to:
- Separating thumbnails from full-size images
- Prioritizing first-screen loading
- Showing a placeholder when an image fails to load
- Avoiding loading too many resources at once in large-image previews
- Compressing dimensions and quality before upload
- Calculating a reasonable display height based on screen width
Developers do not necessarily need to write every detail line by line, but these engineering constraints should be stated clearly during the requirements phase so the model incorporates them into the implementation.
4. File Upload: Convenient on the Client, Trusted on the Server
Image upload usually consists of five steps: selecting a file, compressing it, obtaining temporary authorization, uploading it, and saving metadata.
A recommended flow is:
- The user selects an image.
- The client checks the format and size.
- The image is moderately compressed.
- The client requests temporary upload credentials from the server.
- The file is uploaded to object storage.
- The server writes the image record.
- The page refreshes the list or proceeds to the next processing step.
File type and size must not be validated only on the client. Client-side validation mainly improves the user experience. The server should still verify file type, size, user identity, and upload frequency.
It is also best to store original images and display images separately. The original is used for subsequent image processing, while the display image is used for lists and previews. This reduces page loading pressure and makes it easier to generate thumbnails in different sizes later.
5. Intelligent Image Workflow: Design a Recoverable Task Instead of a Single Call
Image analysis and generation are usually not instantaneous synchronous operations. They are better designed as tasks.
A complete flow can be:
Upload image↓Create analysis task↓Return task identifier↓Query or receive task status↓Obtain analysis result↓User edits prompt↓Create generation task↓Wait for processing to complete↓Save result and display
Analysis results can be divided into dimensions such as subject, style, color, composition, background, and atmosphere. Instead of returning an uneditable description, it is better to structure the result so users can adjust individual parts. For example, a user may want to change only the clothing without changing the person’s pose, or keep the subject while replacing the background. This requires the prompt editing process to offer a reasonable degree of control.
For generation tasks, the page must clearly show the processing state and provide retry, cancel, and history options. Do not leave users without feedback for a long time after they click a button. Also, do not immediately mark a task as failed after a request timeout, because the backend task may still be running.
6. How to Make the LLM a True Engineering Teammate
How much value an LLM provides depends heavily on how it is given input. A phased collaboration approach is recommended.
Phase 1: Solution Design Only
Ask the model to produce the page structure, data tables, interface list, permission boundaries, and exception scenarios, without generating large amounts of code yet. At this stage, developers can review whether the design is sound and avoid spreading a flawed approach throughout the project.
Phase 2: Implement by Module
Implement one module at a time. For example, complete the database access layer first, then the home page list, and finally connect uploads and intelligent tasks. After each module, ask the model to summarize changed files, dependencies, and testing methods.
Phase 3: Conduct Code Review
Ask the model to focus on checks such as:
- Whether duplicate requests exist
- Whether permission validation is missing
- Whether asynchronous tasks have race conditions
- Whether error messages leak internal details
- Whether file deletion produces orphaned data
- Whether state is still updated after a page is unmounted
- Whether database queries lack pagination and sorting
Phase 4: Add Tests
Tests should cover more than the happy path. They should also cover empty lists, network interruptions, repeated clicks, upload failures, task timeouts, user logout, and insufficient permissions.
7. Benefits and Limitations in Practice
The most obvious advantage of LLM-assisted development is the ability to establish a project skeleton quickly and connect logic across pages and services. For individual developers or small teams, it can significantly reduce repetitive work, especially for building basic pages, data models, API wrappers, and common state management.
However, an LLM is not equivalent to a truly senior engineer. It may generate code that appears complete but lacks edge-case handling. It may misunderstand business rules, or create inconsistencies across files, including naming mismatches, parameter mismatches, and missing exception handling.
Developers therefore cannot verify only whether the code runs. They must also check:
- Whether the design matches the business goal
- Whether data permissions are secure
- Whether resource costs are controllable
- Whether the system can recover from task failures
- Whether the code is maintainable over time
- Whether key logic has test coverage
8. Conclusion: From Prompting Well to Managing the Engineering Process
The real change brought by LLMs is not that developers stop writing code. It is that the focus of development shifts. In the past, more time went into repetitive coding. Now, developers need to invest more effort in requirement clarification, architectural judgment, risk control, and acceptance of results.
For an application such as a wallpaper library with intelligent image processing, a practical and reliable path is:
- Break down requirements and flows first.
- Choose a layered architecture.
- Define data models and permission boundaries.
- Generate and validate code module by module.
- Focus testing on asynchronous tasks, file uploads, and exception scenarios.
- Finish with performance, security, and maintainability checks.
When an LLM is treated as an engineering collaborator that can participate in design, implementation, and review—rather than simply as a code search tool—its value becomes much more apparent. Developers also do not need to chase every model update. More importantly, they need to establish stable engineering methods and integrate model capabilities into their own development workflow.
