Practices and Insights on Using LLMs in Full-Stack Application Development
This article explores how large language models (LLMs) are transforming full-stack development from basic code generation to system planning and architectural design. Using a smart image application as a case study, it details practical steps including requirement breakdown, layered architecture, database schema design, phased implementation, and prompt engineering. It also emphasizes the ongoing necessity of human review for security, reliability, and maintainability in AI-assisted software engineering.
In recent years, the role of large language models (LLMs) in software development has been shifting. Early code models were primarily good at generating functions, components, or local code snippets based on instructions, leaving developers to manually handle requirement decomposition, module integration, data design, and exception handling. However, with a new generation of models featuring stronger reasoning and context understanding capabilities, the development paradigm is gradually shifting towards a “plan first, implement later” approach. Models are no longer just completing code; they can actively participate in system design, task decomposition, and engineering collaboration.
To illustrate this change, consider a mobile application that includes wallpaper browsing, user uploads, and AI-powered image processing. It is important to note that this article discusses the performance of general LLMs in real-world development workflows. The actual results will depend on factors such as the model version, prompt quality, project complexity, development tools, and the degree of human review. It should not be misunderstood as models completely replacing developers.
1. From Code Generator to System Planning Assistant
The traditional approach to code generation usually involves a developer presenting a local requirement, such as “implement an image carousel component” or “write a paginated query function,” and the model returning a relatively isolated piece of code. This method is suitable for rapid idea validation, but when a project involves multiple pages, database tables, cloud functions, file storage, and third-party AI capabilities, generating only local code can easily lead to modules that fail to integrate properly.
A more reasonable workflow is to let the model understand the complete business context first, then ask it to output a technical solution. Taking the wallpaper application as an example, the requirements can be broken down into the following parts:
1. Content Browsing Module
The homepage can provide category navigation, trending content, latest uploads, and a masonry grid layout. After entering the detail page, users can view the full-size image, favorite it, download it, or proceed with smart editing. This involves not only UI layout but also paginated queries, thumbnail generation, loading states, and empty data handling.
2. User Content Management Module
When a user uploads an image, the system needs to handle file selection, size compression, format validation, upload progress display, and metadata saving. The server side also needs to record image ownership, moderation status, category information, creation time, and access permissions to avoid situations where files are uploaded without complete data records.
3. Smart Image Processing Module
This module can include image analysis, description generation, prompt editing, style adjustment, and regeneration. The complete process is not simply “upload image and return result,” but requires clear task states, exception retries, result saving, and user operation logging.
4. Management and Operations Module
If the application is meant for long-term operation, you should also consider content moderation, handling of policy-violating images, category maintenance, user feedback, and data analytics. Even if the first version of the product does not implement a complete backend, room for expansion should be reserved in the data structure and API design.
At this stage, the value of the LLM is mainly reflected in “establishing a global perspective.” It can output page structures, module boundaries, data flows, service responsibilities, and development sequences based on requirements, helping developers avoid getting bogged down in specific button styling or isolated code snippets right from the start.
2. Reasonable Technical Architecture Should Precede Implementation
For small to medium-sized applications, a common solution is to use a native client, cloud database, cloud functions, and object storage as the foundational architecture. The client handles page display and interaction, cloud functions handle business logic, the database stores structured data, and object storage stores unstructured files like images.
A clear layering approach is as follows:
- Presentation Layer: Handles pages, components, forms, loading states, and user interactions.
- Business Layer: Handles permission checks, parameter validation, task orchestration, and exception handling.
- Data Layer: Handles content queries, user information, favorite relationships, and task statuses.
- File Layer: Handles image uploads, compression, access URLs, and lifecycle management.
- Smart Capability Layer: Handles asynchronous tasks like image understanding, text processing, and image generation.
This layering reduces coupling between page code and backend logic. For example, the homepage should not directly depend on all the details of a specific database field, but should retrieve paginated results through a unified data access method. If the database table structure is adjusted in the future, typically only the business layer or data access layer needs modification, without extensive changes to the page code.
3. Data Structure Design Determines Scalability
A wallpaper application might seem simple, but if the data structure is designed too casually, you will quickly encounter query difficulties and rising maintenance costs. Basic data can be divided into the following categories:
1. User Table
Stores user ID, nickname, avatar, registration time, and status. Fields involving permissions should be controlled by the server and should not entirely trust the roles or statuses submitted by the client.
2. Image Content Table
Records fields like image title, description, category, original image URL, thumbnail URL, author ID, moderation status, publish time, and access statistics. Saving the original image and thumbnail separately helps reduce the loading cost of list pages.
3. Collection Relation Table
The relationship between users and images is typically many-to-many. Relationship data should be stored in a separate table rather than embedding large arrays of user IDs directly in the image records. This is better suited for paginated queries, unfavoriting, and statistical analysis.
4. Smart Processing Task Table
Records task type, input image, processing parameters, current status, result URL, error message, creation time, and completion time. Task statuses can be abstracted into pending, processing, success, failed, and canceled, making it easy for the client to display progress.
5. Operation Log Table
For key operations like uploading, deleting, moderating, and smart generation, it is recommended to keep necessary logs. Logs are not only useful for troubleshooting but also help identify abnormal calls and control resource consumption.
LLMs can help developers generate an initial table structure, but they cannot replace data modeling judgment. Developers still need to check whether field naming is consistent, indexes are reasonable, sensitive information is mistakenly saved, and whether files are synchronously cleaned up after data deletion.
4. Full-Stack Collaboration: From Page Development to Service Orchestration
In actual development, tasks can be split into multiple verifiable stages rather than asking the model to generate the entire project at once.
Phase 1: Establish the project skeleton, including page directories, common components, request wrappers, state management, and base styles. The focus here is not on feature completeness, but ensuring the project starts normally and pages can navigate between each other.
Phase 2: Implement content browsing. The model can assist in generating masonry layouts, paginated loading, category filtering, and image preview logic. However, developers need to closely inspect the following issues:
- Are there duplicate requests?
- Does fast scrolling trigger too many loads?
- Is there a placeholder state for failed image loads?
- Does the request stop when pagination ends?
- Is data incorrectly re-initialized when returning to a page?
Phase 3: Implement the upload flow. The client can perform size compression and format checks before uploading, while the cloud side is responsible for authentication, file saving, and record insertion. A successful upload does not mean the business is complete; consistency between the file record and the database record must be guaranteed. If the file uploads successfully but the database write fails, a compensation or cleanup mechanism should be designed to avoid orphaned files.
Phase 4: Integrate smart image processing. It is recommended to design the process as an asynchronous task:
- The client uploads the original image.
- The server creates a processing task.
- The backend calls the respective AI capability.
- The processing result or error information is saved.
- The client polls for the task status or receives a status notification.
- The user confirms and saves the final result.
This approach is more stable than directly chaining multiple calls on the client side. It also makes it easier to control permissions, hide API keys, record logs, and implement failure retries.
5. Prompt and Context Management Impact Output Quality
Whether an LLM can stably complete a task largely depends on whether the developer has provided clear context. An effective development instruction should typically include:
- Project goals
- Current existing files and directories
- The scope allowed to be modified in this session
- Input and output data structures
- Error handling requirements
- Compatibility constraints
- Acceptance criteria
For example, instead of broadly asking to “implement an image generation page,” it is better to explicitly state that the page needs to include image selection, analysis result display, prompt editing, task submission, processing status, failure retry, and result saving. Ask the model to list the files to be modified first, then implement them one by one. This reduces the chance of the model arbitrarily modifying unrelated code.
For larger projects, you should proactively manage the context size. Feeding all files to the model at once may not yield better results. A more effective method is to provide necessary files by module and, after each round, ask the model to summarize current changes, outstanding issues, and the next steps.
6. Model-Generated Code Still Requires Strict Review
Even if the generated result runs successfully, it cannot be directly treated as production-grade code. At a minimum, it needs to be checked from the following aspects:
Security: Do not expose access keys, admin permissions, or internal service addresses in client code. All logic involving user identity, file permissions, and administrative operations must be re-validated on the server side.
Reliability: Check for network timeouts, duplicate submissions, task failures, interrupted file uploads, and database write failures. Smart processing often takes a long time; you cannot assume all requests will succeed immediately.
Performance: Pay attention to image sizes, list pagination, caching strategies, and concurrent request limits. Original images should not be used directly for list displays, and masonry layouts should not load large amounts of high-resolution resources in a short period.
Maintainability: Avoid writing all business logic within page event handlers. Common requests, format validations, error prompts, and task state transitions should be appropriately abstracted for easier future modifications.
Compatibility: Test across different devices, network conditions, and OS versions, especially verifying scenarios like image selection, file upload, page return, and background recovery.
7. The Role of Human Developers Has Not Disappeared
LLMs are best suited for highly repetitive, strongly structured, and rapid trial-and-error tasks, such as generating base pages, filling in API calls, writing data transformation logic, organizing documentation, and analyzing error logs. However, requirement trade-offs, risk assessment, architectural boundaries, and deployment responsibilities still need to be handled by developers.
A relatively robust collaboration model is:
- Human is responsible for goals, constraints, and acceptance criteria.
- Model is responsible for solution drafting, code implementation, and localized troubleshooting.
- Human is responsible for reviewing security, maintainability, and business correctness.
- Model makes targeted modifications based on feedback.
- Final verification is done through testing, code review, and real device validation.
From this perspective, the biggest change brought by the new generation of LLMs is not that “coding is no longer needed,” but that developers can focus more energy on product design, system boundaries, and quality control. For individual developers and small teams, this collaboration method significantly lowers the barrier from idea to prototype; for enterprise R&D teams, it helps improve the efficiency of boilerplate code generation, documentation organization, and problem localization.
Overall, the value of LLMs in full-stack application development has gradually expanded from local code completion to requirement analysis, architectural planning, and module collaboration. However, it remains an engineering tool that needs to be constrained, verified, and reviewed. Only by establishing clear task decomposition methods, reasonable system architectures, complete testing processes, and strict security boundaries can the capabilities of models truly be transformed into stable, maintainable, and deployable software products.
