Adopting AI Coding Tools for an E-commerce Site: Capability Assessment and Practice
This article explains how teams in restricted-network and compliance-sensitive environments can evaluate AI coding tools by their ability to deliver a working application, not just produce plausible code. Using a from-scratch e-commerce site as the test case, it covers seven evaluation dimensions, common failure modes and their root causes, a layered engineering workflow, and a weighted scoring model for proof-of-concept testing.
1. Background: Replacing a Tool Means Rebuilding the Delivery Loop
Many teams work under restricted networks, data compliance rules, and Chinese-language development conditions. These teams want AI coding tools that do not require special network access, which reduces their dependence on external services. However, a replacement tool should not be judged by how fluent its conversation is or how friendly its interface looks. The real question is whether it can complete the full delivery loop: requirement understanding, architecture design, code generation, integration and debugging, and quality verification.
The original practice set a goal of building an e-commerce site from zero to one. The site required ten pages: home product list, product details, purchase, purchase success, login, registration, user center overview, orders, wallet and coupons, and settings. These pages cover typical business areas such as product display, transactions, account systems, and personal centers. Together, they expose how well an AI coding tool handles routing, state management, data contracts, form validation, responsive layout, style consistency, and error handling.
Generating a single page can easily overstate a tool’s delivery capability. Only when the ten pages form a complete flow, measured against consistent acceptance criteria, can you judge whether the output is maintainable, extensible, and testable.
This article does not compare specific tools through hands-on experience. Instead, it addresses a broader question: in a compliant and controllable R&D environment, how do you choose and use an AI coding tool to build a small or mid-sized e-commerce site from zero to one?
2. Evaluation Dimensions: From “Can Generate” to “Can Deliver”
When you evaluate an AI coding tool, cover at least seven dimensions.
Interaction and explainability. A clear interface, trackable task status, and an explainable generation process directly affect how quickly developers can debug problems. A friendly interface is more than decoration. It should show developers which files the tool is changing, why it changes them, and how to verify the result.
Task orchestration model. Common models include one-shot fully automated task generation, conversational incremental editing, and multi-agent collaboration. Fully automated generation works well for quickly building a skeleton, but the structure can easily get out of control. Incremental editing keeps scope under control but requires developers to break down tasks well. Multi-agent collaboration can handle different modules in parallel, but it needs stricter interface contracts and merge strategies.
Generation completeness. The core checks are whether all pages exist, whether routes are reachable, whether the main flow works end to end, and whether empty states and error states are handled. For an e-commerce site, pay special attention to the transaction loop from product list to product detail, purchase, purchase success, and orders.
Code quality and architecture. Check component decomposition, separation of styles from logic, whether the data access layer is independent, whether mock data is decoupled from business code, and whether the directory structure follows conventions. If a tool creates placeholders for state management, context, or composable logic but leaves them empty, the architecture is only a shell.
Verifiability. Check whether the output passes static analysis, unit tests, end-to-end flow tests, and accessibility checks. Do not judge success only because a page opens.
Response speed and stability. Generation speed, edit response time, and recovery after a long task is interrupted all shape the experience. A slow tool is not necessarily unusable, but it significantly increases the cost of iteration.
Security and compliance. This includes keeping data within the organization’s boundary, permissions and audit logs, dependency license scanning, traceability of generated code, and redaction of sensitive information. For enterprise teams, these factors often matter more than the quality of any single generation.
3. Experiment Design: Run a Proof of Concept with Fixed Requirements and Unified Acceptance
Use the same requirements, the same constraints, and the same acceptance checklist to test candidate tools blind. A prompt can include a role, goals, constraints, output format, and self-check requirements. For example, it can ask the tool to act as a senior frontend and full-stack engineer and generate a runnable e-commerce site. The prompt should require all ten pages, a component-based frontend framework, and separation of routing, state management, data access layer, mock data, style variables, form validation, and responsive layout. It should also require that no blocking errors remain and that the output include a directory tree, key code, run instructions, and an acceptance self-check table.
The acceptance checklist should include at least the following:
- The project starts and can be accessed in a browser.
- All ten page routes exist.
- The main flow works from product browsing to successful purchase.
- Login, registration, and purchase forms have basic validation.
- Mobile and desktop layouts adapt reasonably.
- Product, order, and wallet data come through an independent data access layer.
- Mock data is not hard-coded into page logic.
- Styles are separated from logic, and button text has readable contrast against its background.
- The directory structure is clear, with no nested folders that have the same name.
- Error, empty, and loading states have basic handling.
- Dependencies and sensitive information have been checked.
Run the experiment in stages. First, have the tool generate the architecture skeleton and data contracts. Next, generate pages and components. Then fix integration issues, and finally run code review and quality gates. Generating all ten pages at once looks efficient, but it tends to postpone architecture, data coupling, and style problems until the end, when they are more expensive to fix.
4. Common Failure Modes and Root Causes
First, messy structure and nested directories. Some outputs create a folder with the same name inside the project folder. This breaks entry points and causes build failures. The root cause is that the tool lacks strict constraints on the project root and output paths. Specify the directory tree in the prompt, and after generation, check the entry file and routing configuration first.
Second, mock data coupling. Product, order, and coupon data is written directly into page components. This works in the short term but becomes hard to maintain. Require all data to be retrieved through repository interfaces so that mock and real API implementations can be swapped.
Third, weak responsive design and accessibility. Outputs that look like mobile layouts on desktop, distorted login and registration pages, or white text on white buttons show that the tool does not systematically check breakpoints, layout constraints, or color contrast. Add responsive breakpoints, minimum tap target sizes, and text contrast to the acceptance criteria.
Fourth, incomplete form validation. Login, registration, and purchase pages need checks for required fields, formats, boundaries, and submission state. If the forms only look correct visually, the transaction flow cannot be trusted.
Fifth, architecture shells. Directories may exist for state management, context, or composable logic, but their contents are empty. This means the generation stopped at the surface. Require each key module to have a minimal working implementation, not just an empty directory.
Sixth, inefficient repair loops. When generated code runs but throws errors, repeated fixes often fail to converge. This usually happens because the tool lacks error logs, reproduction steps, and a limited change scope. Developers should ask the tool to identify the root cause first, then make a targeted change instead of rewriting the code repeatedly.
Seventh, slow generation disrupts iteration. Long waits break a developer’s focus. Split large tasks into five smaller ones: skeleton, data layer, pages, integration, and testing. Verify each step before moving on.
5. Engineering Approach
First, define the contract before the pages. Define the domain models and data access interfaces before generating any pages. Here is a simplified pseudocode example:
interface Product {id: string;title: string;price: number;images: string[];}interface ProductRepository {list(query: ProductQuery): Promise<Page<Product>>;get(id: string): Promise<Product>;}class MockProductRepository implements ProductRepository {async list(query: ProductQuery): Promise<Page<Product>> {// Read from a separate mock data file and paginate}async get(id: string): Promise<Product> {// Return product details}}class ApiProductRepository implements ProductRepository {async list(query: ProductQuery): Promise<Page<Product>> {// Call the real API}async get(id: string): Promise<Product> {// Call the real API}}
With this structure, pages depend only on the interface. Mock data and real API implementations can be switched without major page changes when the backend is replaced later.
Second, fix the directory structure. One option is to organize by domain:
src/app: entry point and routingsrc/pages: pagessrc/components: shared componentssrc/features: modules split by product, cart, orders, and accountsrc/services: data access and API implementationssrc/mocks: mock datasrc/styles: design variables and global stylessrc/tests: tests
Once the structure is set, state in the prompt that the tool must not create nested folders with the same name.
Third, use staged prompts. Stage 1 generates only the directory tree, routing table, domain models, and data interfaces. Stage 2 generates shared components and design variables. Stage 3 generates pages one at a time. Stage 4 integrates the main flow. Stage 5 adds form validation, empty states, error states, and responsive behavior. Stage 6 runs static checks, unit tests, and end-to-end flow tests. Each stage should require a self-check report.
Fourth, set up quality gates. Gates should include type checking, static analysis, dependency license scanning, sensitive information scanning, unit tests, end-to-end main-flow tests, accessibility checks, and a code review checklist. The review should confirm that data goes through the independent access layer, styles are separated from logic, forms are validated, button contrast meets the standard, the directory structure follows conventions, and no exception branches are left unhandled.
6. Proof of Concept and Scoring Model
Use a weighted scorecard: functional coverage 30 points, code quality 25 points, maintainability 20 points, security and compliance 15 points, and response speed and stability 10 points. Every dimension needs verifiable evidence rather than subjective impressions. During the proof of concept, keep the requirements, prompts, and acceptance checklist fixed. Record the number of repair rounds, the number of blocking errors, the main-flow pass rate, and the number of code review issues.
Cost evaluation should cover more than subscription fees. Include compute consumption, private deployment, training, migration, and maintenance costs. For compliance, check whether data leaves the organization, whether permissions are auditable, whether generated code is traceable, and whether third-party dependencies can be scanned.
For cloud-based R&D environments, Baidu AI Cloud offers general compute, object storage, logging, and monitoring services. These can host code repositories, build pipelines, and preview environments. If an organization adopts Baidu AI Cloud’s related intelligent R&D services, include them in the unified permission, audit, and data governance processes.
7. Conclusion
Choosing an AI coding tool is ultimately a decision about engineering delivery capability. The e-commerce site practice shows that the outcome depends less on generation speed than on whether the tool can consistently produce code that has a clear structure, decoupled data, complete forms, usable responsive layouts, and testable, maintainable logic under shared constraints. Teams should start with a small proof of concept to build a scorecard and acceptance checklist. Then they can use staged generation, a data layer abstraction, directory conventions, and quality gates to turn tool capability into a repeatable development process. Only when generation is paired with verification can an AI coding tool become a controllable productivity gain.
