LLM Frontend Code Generation in Practice: What It Can Do and What It Still Lacks

    This article reports an end-to-end test of generating an enterprise frontend project from a requirements document with large language models. It examines delivery format and latency, login, list, and form pages, UI quality and engineering trade-offs, model comparison methods, open-source deployment, and human-AI collaboration. The findings are observations from this test, not general claims about all models.

    Large language models have made rapid progress in code generation, but benchmark scores do not directly represent engineering outcomes. To judge whether a model’s frontend capability is mature, it is not enough to check whether it can write syntactically correct code. It must also be able to understand complex business logic and long requirements documents and deliver a project that can run.

    This article describes an end-to-end generation test for an enterprise frontend requirements document. The conclusions here come from observations in this test, not from a general judgment about all models.

    1. Test Scope and Evaluation Criteria

    In the test, the model was given a requirements document containing interaction logic, page structure, and field definitions. No frontend framework was prescribed, so the model could choose the technology stack and scaffold the project on its own.

    When evaluating this type of tool, it is advisable to record the following information: model name and version, prompt content, length of the requirements document, runtime environment, generation rounds, success and failure criteria, and the number of lines changed manually. Without this information, conclusions are difficult for others to reproduce. This article does not publish the complete model list or timing data. The judgments are presented as observations from this test.

    2. Delivery Format and Wait Cost

    Compared with earlier models that only output code snippets, current models can directly generate a project directory with dependency configuration. Developers can start it locally or deploy it to an online environment for access. This clearly shortens the path from requirements to a demonstrable prototype.

    However, the generation process involves a long wait. During periods of tight compute capacity or concentrated requests, generation occasionally queues, and complex projects have also been interrupted midway. For developers who need immediate feedback, this affects the experience. A better approach is to place generation tasks in a background workflow while retaining a step to resubmit after an interruption.

    3. Performance Across Three Page Types

    1. Login Page

    The login page has a relatively fixed structure, including form inputs, validation, and submit logic. In this test, the model accurately understood the requirements, generated a basic form layout, and implemented the background carousel mentioned in the document. The page functions were largely complete. Under the scope of this test, this code can be used as a starting point. Before release, the following checks are still needed: whether inputs and labels are correctly associated, whether the password is submitted through a secure method, whether the number of failed login attempts is limited, and whether the page meets browser compatibility and accessibility requirements.

    2. List Page

    The list page is usually the most complex part of a mid-office or back-office system. It involves data requests, pagination, filter conditions, and multiple state transitions. In this test, the requirements document explicitly specified the types of filter items, default values, and how they should interact with list data. However, the generated result was mainly a static table and search bar. Changing filter conditions did not trigger a data request, and no loading-state transition was visible.

    The core issue is that the visual structure was not bound to the data flow. The model could recognize that a table and a search bar were needed, but it struggled to connect these elements with state management and API parameter assembly. A reasonable implementation should reset the page number to the first page when filter conditions change, send the request, update the data source, and toggle the loading state before and after the request.

    3. Form Page

    Complex business forms usually include field linkage validation, asynchronous validation, and dynamic show-hide rules. In this test, the generated form could complete the basic submission flow, but field validation and interaction details deviated from the document. For example, the document required that when type A is selected, field B is required and must match a specific regular expression. Most generated code only performed a non-empty check or omitted this rule entirely.

    This suggests that the model still has limited ability to extract scattered conditional constraints from long text. The longer the document and the more dispersed the conditions, the more likely key details are to be lost.

    4. UI Style and Engineering Trade-offs

    The visual style of the generated code leans practical. The DOM structure is basically reasonable, and the layout is usable, but visual details and design quality are average and do not reach a finely polished level. If a project has visual requirements, it is advisable to specify a component library in the prompt and include browser compatibility, responsive layout, and accessibility checks in the acceptance criteria.

    5. How to Compare Models

    This test also gave the same requirements to a mainstream closed-source model for generation. On the login page, the two were close in completeness. On the list page and form page, the closed-source model achieved higher completeness in field association and validation logic and could more fully implement the conditional rules in the document.

    A single comparison is not enough to reach a stable conclusion. A more useful approach is to build a comparison matrix and consistently record the following metrics: requirements coverage, completeness of validation logic, generation time under a unified protocol, and the number of lines changed manually. The value of the matrix is that it makes results from different models directly comparable and makes later repeated tests easier.

    6. Implications for Open Source and Human-AI Collaboration

    First, open-source models lower the barrier to private deployment. Small and medium-sized teams can build research and development assistance tools in their own environments, keeping code assets internal. In practice, a stable workflow usually requires combining container platforms, object storage, and CI/CD pipelines.

    Second, the failure points exposed in the test, such as filter linkage and conditional validation, provide concrete directions for model optimization. Stress testing with real projects is an important means of validating model capability, but it is not the only means. It should also be combined with code review, unit tests, and user acceptance to make a comprehensive judgment.

    Third, the division of labor between humans and machines may adjust accordingly. Business rules can be described in natural language, with the model generating the basic implementation, while developers spend time on state design, interface contracts, and code review. This change shifts the focus of work; it does not mean developers will be replaced.

    7. FAQ

    Can large language models directly generate runnable frontend projects? They can generate a basic project structure and pages, but business logic needs manual review, especially linkage, validation, and exception branches.

    How should the frontend code capability of large language models be evaluated? It is advisable to fix the requirements document, prompt, and runtime environment, check each requirement point one by one, and record the number of changed lines and time.

    What should be checked most in generated frontend code? Focus on three categories: whether data requests are actually sent and loading and error states are handled, whether validation covers conditional rules rather than only non-empty checks, and whether the page meets security, compatibility, and accessibility requirements.

    Overall, large language models can already provide a usable starting point for generating standardized pages, but complex business logic still requires human review. Users should measure continuously with a consistent protocol before deciding which parts to hand to the model and which parts to keep with developers.