Building a Complete E-commerce Frontend from Scratch with AI Coding Tools: A Practical Evaluation

    This article presents a unified practical task: using AI coding tools available in the Chinese market to build an e-commerce frontend with a basic shopping flow from scratch. It outlines the test pages and evaluation criteria, summarizes typical performance and common issues such as broken business flows, missing responsive design, placeholder data, and poor code reuse, and offers recommendations for tool selection, prompt design, and iterative development. Readers will learn how to assess AI coding assistants for real-world frontend work and how to structure prompts and workflows to get more reliable results.

    As large language models continue to improve, AI coding tools have evolved from simply completing a few lines of code to development assistants that can understand requirements, create files, write pages, run debugging, and make continuous modifications. For developers, the real value is not whether a tool can generate a visually appealing page, but whether it can maintain project integrity under complex requirements, produce maintainable code, deliver usable interaction flows, and allow humans to take over quickly.

    This article designs a unified practical task: using AI coding tools available in the Chinese market to build an e-commerce frontend with a basic shopping flow from scratch. This task provides a relatively comprehensive view of the real capabilities of AI coding tools.

    1. Testing Task and Evaluation Criteria

    This task is not about simply making a display page. It requires generating a frontend project with a complete user path, including the following pages:

    1. Product home page, displaying product lists, categories, and a search entry;
    2. Product detail page, displaying images, price, specifications, and stock information;
    3. Checkout page, where users fill in shipping information and confirm the order;
    4. Purchase success page, showing the order result and subsequent action entries;
    5. User login page;
    6. User registration page;
    7. User center home page;
    8. User orders page;
    9. User wallet or coupon package page;
    10. User settings page.

    To avoid the problem of having many pages that are not connected to each other, the following flows also need to be verified:

    • Whether clicking a product on the home page navigates to the detail page;
    • Whether selecting specifications on the detail page allows adding to cart or buying immediately;
    • Whether the checkout page can perform basic form validation;
    • Whether submitting an order leads to the success page;
    • Whether there are reasonable navigation relationships among login, registration, and user center;
    • Whether the pages have basic adaptation for desktop and mobile;
    • Whether mock data is managed centrally rather than scattered inside individual components.

    The evaluation dimensions can be summarized into five aspects:

    1. Requirement Understanding

    Whether the tool can accurately identify the number of pages, page responsibilities, business flows, and interaction relationships. Many problems in generated results are not syntax errors, but missing pages, broken navigation, or simply stitching multiple pages together.

    2. Project Runnability

    Whether the generated code can be installed, started, and built normally. Common issues include incorrect file paths, incorrect component references, missing dependencies, incomplete routing configuration, and inconsistent variable naming.

    3. Interface Completeness

    Whether the pages have the basic structure of a real product, such as navigation bars, product cards, status prompts, empty states, form feedback, order information, and user action entries, rather than just a title and a few buttons.

    4. Code Organization

    Observe whether the tool can reasonably split components, extract shared styles, manage data centrally, and leave room for future integration with real APIs.

    5. Repair and Iteration

    The first generation does not represent final quality. More importantly, can the tool locate problems based on error messages, and can it complete local modifications according to additional developer requirements without breaking pages that already work?

    2. Typical Performance of AI Coding Tools in a Single-Generation Task

    From actual usage, current AI coding tools available in the Chinese market can generally generate a basic e-commerce prototype in a relatively short time, but different tools show clear differences in stability and engineering quality.

    Some tools have the advantage of a simple interactive interface and a clear task mode, suitable for creating a project in one go through a long natural language description. Users only need to specify the tech stack, page list, and core flows, and the tool can automatically create directories, write pages, and generate styles. This approach is suitable for quickly validating ideas, especially for prototyping and internal demos.

    However, one-shot generation also carries obvious risks. Because the task scope is large, the model may prioritize completing the “visible” pages while ignoring data flow, boundary states, and exception handling. For example, the product detail page exists, but specification selection has no actual effect; the purchase button can be clicked, but no order is created; the user center page is generated, but there is no link from login state to user information.

    Another type of tool places more emphasis on phased construction. It usually analyzes requirements first, then generates the project structure, and then gradually completes pages and components. The advantage is that the process is easier to control, and developers can check results at each stage; the disadvantage is that there are more steps and higher requirements for prompts and human judgment.

    Some tools also provide multiple task modes, such as quick generation, complex task planning, and automatic repair. Different modes suit different scenarios: simple pages can use quick generation, while multi-page and shared-state scenarios should prioritize modes with stronger planning capabilities. Note that mode names do not equal actual results; generated output and repair efficiency should still be the basis for judgment.

    3. Most Common Generation Issues

    1. Pages Are Completed, but the Business Flow Is Not

    This is the most common problem. A tool can generate ten pages, but it cannot necessarily make those ten pages form a complete product. Common symptoms include:

    • Different navigation methods between pages;
    • Back buttons pointing to the wrong page;
    • No success state after order submission;
    • No connection between the login page and the user center;
    • Product data inconsistent across different pages;
    • Missing cancellation, failure, and empty-data states in the purchase flow.

    The solution is to split requirements into “page requirements” and “flow requirements.” The prompt should not only say “generate ten pages”; it should also clearly state:

    1. Please also implement the following user flows:
    2. Product list -> Product detail -> Select specifications -> Confirm order -> Submit successfully;
    3. Redirect unauthenticated users to the login page when they access the user center;
    4. All pages use the same set of mock product data;
    5. After order submission, display the newly created order on the order page.

    This description makes it easier for the tool to understand system relationships than simply listing page names.

    2. The Interface Looks Usable but Lacks Responsive Design

    Many generated results lean toward mobile card layouts. They look acceptable on phone screens, but on desktop they can have overly narrow content, excessive whitespace, or unreasonable module arrangement. Conversely, some projects are designed only for wide screens; after narrowing the window, the navigation bar overflows, product cards are squeezed, and forms become difficult to operate.

    A more reasonable approach is to specify breakpoints and layout rules clearly, for example:

    • Desktop uses a multi-column product grid;
    • Tablet reduces the number of columns and compresses spacing;
    • Mobile switches to a single-column layout;
    • Top navigation collapses into a menu on small screens;
    • Form fields are arranged vertically on mobile;
    • Images use fixed-aspect-ratio containers to avoid page jumps.

    At the same time, after generation, you must use browser developer tools to check actual effects at different widths, not just the default window.

    3. Images and Data Are All Placeholder Content

    To ensure the project runs, AI tools usually use local placeholder images or simple text. But without a unified data model, replacing real assets later becomes very troublesome.

    It is recommended to require the tool in advance to create a centralized data file with at least the following fields:

    1. {
    2. id: "product-id",
    3. name: "Product Name",
    4. price: 199,
    5. originalPrice: 249,
    6. category: "Product Category",
    7. image: "image-url",
    8. description: "Product Description",
    9. specifications: ["Spec 1", "Spec 2"],
    10. stock: 100
    11. }

    This allows the home page, detail page, and order page to share the same data and makes it easier to replace with API responses in the future. Mock data should not be written directly inside page components, and the same product should not be defined repeatedly across different pages.

    4. Code Structure Looks Complete but Lacks Reuse

    Some generated projects create component directories, state directories, and utility directories, but these directories exist only in form; pages still contain a large amount of logic in a single file. As requirements increase, changing one button may affect multiple areas.

    A relatively reasonable frontend structure could be:

    1. src/
    2. components/
    3. Header
    4. ProductCard
    5. EmptyState
    6. FormField
    7. pages/
    8. Home
    9. ProductDetail
    10. Checkout
    11. UserCenter
    12. data/
    13. products
    14. services/
    15. orderService
    16. store/
    17. cartStore
    18. userStore
    19. styles/
    20. variables
    21. global

    Directory names are not important; the key is clear responsibilities. Shared components handle display and interaction, pages compose business modules, the data layer handles mock or requested data, and the state layer handles shared cart, user, and order information.

    4. Recommendations for Using Baidu AI Coding Tools and Similar Solutions

    When making a choice, do not compare only first-generation speed. The following capabilities deserve more attention:

    1. Context Understanding

    The tool needs to understand the existing directories, components, styles, and error messages of the current project. If every modification requires re-explaining the entire project, long-term usage costs will increase significantly.

    2. Real Verification

    Generating code alone is not enough. Ideally, the tool can assist with installation, build, test, or startup processes. For frontend projects, at minimum, syntax errors, module references, and page rendering results need to be verified.

    3. Easy Human Takeover

    When automatic modifications fail, developers should be able to quickly locate the specific file and code location. The clearer the code and the more limited the change scope, the more suitable it is for team collaboration.

    4. Fit with Team Standards

    Enterprise projects usually have directory conventions, naming conventions, permission requirements, and review processes. When generating code, tools should follow existing engineering constraints as much as possible rather than introducing many uncontrollable structures just to complete tasks quickly.

    Baidu AI coding tools and other similar solutions in the Chinese market are better suited as development assistants rather than complete replacements for engineers. For prototypes, admin pages, form pages, and routine business components, automatic generation can significantly improve efficiency; for payment, permissions, order consistency, and security-related logic, developers must still design, review, and test.

    A complete prompt should usually contain six types of information:

    1. Technical requirements: which frontend framework, build method, and styling solution to use;
    2. Page list: clarify the purpose of each page;
    3. Business flows: explain how pages navigate between each other;
    4. Data requirements: specify how product, user, and order data should be organized;
    5. Visual requirements: describe layout, color scheme, responsiveness, and interaction states;
    6. Acceptance criteria: clarify that the project must start, build, and complete core flows.

    Example:

    1. Create a runnable e-commerce frontend project.
    2. Requirements:
    3. 1. Pages include a product home page, product detail page, order confirmation page, submission success page, login page, registration page, and user center-related pages;
    4. 2. Clicking a product on the home page navigates to the detail page, and the detail page supports selecting specifications and quantity;
    5. 3. After submitting an order, navigate to the success page, and display the order record on the order page;
    6. 4. Store product data centrally; pages must not hard-code it repeatedly;
    7. 5. Extract common navigation, product card, form field, and empty state components;
    8. 6. Support responsive layouts for desktop and mobile;
    9. 7. Add basic validation for login, registration, shipping information, and order submission;
    10. 8. After completion, check module references, startup flow, and major page navigation.

    6. Conclusion: Tool Selection Should Focus on Workflow, Not Marketing Claims

    AI coding tools available in the Chinese market can already handle a considerable portion of routine frontend development work, especially for quickly building prototypes, generating page skeletons, supplementing form logic, and creating internal demos. But in complex tasks, the first generated result should usually be treated as a “runnable draft” and cannot be used directly as production code.

    A more reliable workflow is:

    • First let the tool plan the project structure;
    • Then generate core pages in stages;
    • Run verification immediately after completing each flow;
    • Make small, traceable repairs to errors;
    • Finally handle styles, data, exception states, and engineering conventions uniformly.

    If the goal is to quickly obtain an interactive prototype, prioritize generation speed and interface completeness; if the goal is to enter a real project, focus on code organization, debugging capability, context understanding, and team collaboration fit.

    The real value of AI coding tools is not to let developers write no code at all, but to reduce repetitive work and allow more time to be invested in requirement analysis, architecture design, quality assurance, and business innovation.