Building a Complex E-commerce Site with AI Coding Tools: Practices and Challenges
As large language models advance rapidly, AI coding tools are becoming key infrastructure for boosting software development productivity. However, moving from single-file code completion to building a full-stack business project from scratch poses serious challenges to a tool's context understanding, architectural planning, and code consistency. Using the task of building a React e-commerce site with ten core pages as a case study, this article examines the technical practices and potential pitfalls of AI coding tools in complex business scenarios, and offers practical optimization advice for developers.
Background and Task Breakdown
The core task of this exercise was to use an AI coding tool to build a frontend shopping site from zero to one. The tech stack was React, and the site required ten closely related core pages:
- Home page (product listing)
- Product detail page
- Product purchase page
- Purchase success page
- Login page
- Registration page
- User center – Dashboard
- User center – Orders
- User center – Wallet (coupons)
- User center – Settings
The real difficulty of this task lies not in implementing individual pages, but in the completeness and overall consistency of the site. This requires the AI tool to handle not just local component construction, but also holistic concerns such as routing design, state management, UI style consistency, and business flow logic.
Interaction Modes and Task Execution
Current AI coding tools vary widely in how they interact with developers, roughly falling into two categories: fully automated execution and multi-step guided collaboration.
In our testing, the fully automated mode offered by some tools can in theory reduce manual intervention, but the lack of intermediate confirmation steps often causes misunderstandings of the task to accumulate, resulting in a generated project that cannot even run. On the other hand, some tools offer multiple Agent modes for developers to choose from (e.g., different build modes or task decomposition modes). While this adds flexibility, it also increases cognitive load, making developers face “choice paralysis” when launching complex tasks.
An ideal tool should be able to decompose tasks sensibly under a single, clear prompt, and be capable of understanding the requirements end-to-end and generating a runnable project skeleton in one pass. Minimizing the frequency of manual debugging is a core metric for evaluating a tool’s execution efficiency.
Frontend UI Generation and Visual Adaptation
AI coding tools often produce frontend UIs that “run but look bad” or “have features but a poor experience.” Analyzing the generated output, we identified these typical pain points:
- Responsive layout defects: Generated code tends to be optimized for a specific device (usually mobile by default) but falls short on basic responsive adaptation. For example, the login and registration pages deform at different screen resolutions, and button color logic can be wrong (e.g., white text on a white background, rendering buttons invisible).
- Missing static asset management: Images in generated pages are almost all placeholders, with no connection to real business data. In real-world engineering, frontend images should be managed and served through a stable object storage service, but generated code rarely integrates with such cloud services automatically.
- Style separation and engineering standards: In terms of code quality, some tools achieve basic separation of styles from logic, but often lack standalone style file management, or simply inline styles within components. This hurts readability and makes future theme customization and maintenance harder.
Code Architecture and Business Logic
High-quality code needs more than visual presentation—it must be maintainable and extensible. In e-commerce scenarios, the rigor of business logic is critical.
- Data and view layer coupling: Generated code often hard-codes mock data directly inside business components, with no independent data layer or API request encapsulation. This may get the project running quickly at first, but it seriously violates engineering standards and requires large-scale refactoring later when connecting to a real backend.
- Architectural placeholders and empty shells: Some tools do scaffold directories for Hooks, Context, and other state management structures, showing some understanding of modern React architecture. However, closer inspection reveals these directories are often empty—no actual cross-component state sharing is implemented—making them purely decorative.
- Basic structural errors: During complex code generation, tools can even make elementary mistakes such as creating a folder with the same name inside another folder, which breaks the build tool’s path resolution and prevents the project from starting. This exposes weaknesses in file system operations and path handling.
- Form validation and flow logic: Basic form validation is essential in login, registration, and purchase flows. Some tools generate fairly complete validation logic (required fields, format checks), but the overall shopping flow remains crude—product detail pages lack sufficient information dimensions to meet real commercial needs.
Compute Stability and Response Speed
In day-to-day interaction, model inference speed and compute stability directly affect the developer experience. Some tools respond slowly when handling complex pages or long contexts, badly interrupting the developer’s flow. Moreover, when generated code throws errors, the tools’ auto-fix capabilities vary widely: some get stuck in a “fix–error–fix again” loop, and after multiple failed attempts, the developer still has to step in and debug manually.
Best Practices and Recommendations
Based on the practices and challenges above, developers building complex projects with AI coding tools should adopt the following strategies:
- Write detailed system prompts: Don’t just state high-level requirements. Explicitly define UI design standards (primary colors, spacing rules), data structures, and project directory conventions to reduce the model’s interpretation errors.
- Review architecture and refactor proactively: Treat the AI as a “junior developer assistant” and subject its output to strict architectural review. Focus on data coupling issues: manually extract mock data and fill in the actual logic for Hooks and Context.
- Leverage general-purpose cloud services: After the frontend is built, use cloud providers’ object storage, cloud databases, and API gateways to quickly fill in backend services and static asset hosting, closing the full-stack loop.
- Build and verify incrementally: Avoid asking the tool to generate all pages at once. Use incremental development—generate one core page, run and verify it, and only then layer on new features, keeping the project foundation solid.
In summary, AI coding tools demonstrate impressive speed in getting a complex e-commerce site off the ground from zero to one, but they still show significant weaknesses in engineering standards, architectural rigor, and UI consistency. Developers need to combine these tools with their own solid technical expertise—through well-crafted prompt engineering and strict code review—to truly unlock their potential and deliver high-quality software.
