AI Coding Tools for E-commerce: Insights from a 10-Page React Project Test
This article evaluates the practical capabilities of AI coding tools by building a 10-page React e-commerce frontend. It explores testing criteria, differences in generation modes, UI and responsive design challenges, as well as code quality and architecture issues. Finally, it provides actionable strategies for integrating these tools into real-world development workflows while maintaining maintainability and security.
As Large Language Model (LLM) capabilities improve, AI coding tools have entered the daily workflows of many developers. While code completion and single-component generation usually perform well, projects involving multiple pages, shared state, and complete business workflows often fall short of expectations. To understand the practical boundaries of these tools, we designed a complex testing task: building a React e-commerce frontend shopping site from scratch.
I. Testing Task and Acceptance Criteria
The task included ten pages: Home (product list), Product Detail, Checkout, Payment Success, Login, Register, User Dashboard, User Orders, User Wallet (Coupons), and User Settings.
These ten pages presented different challenges. First, pages share global state and routing; the tool needs a global perspective to avoid disjointed styles and data structures across pages. Second, the business process must form a closed loop: from browsing products and placing orders to checking orders and coupons in the user center, data must connect seamlessly, and forms require basic validation. Third, an e-commerce site must be compatible with both PC and mobile devices, meaning the generated CSS must respond to different screen widths.
To make the conclusions verifiable, we checked each result against four criteria: whether the project could start according to the instructions; whether all pages displayed correctly on desktop and narrow screen widths; whether the directory structure was layered; and whether the business data was decoupled from the components. Readers can reuse these four criteria when testing in their own environments.
II. Differences in Generation Modes
Various tools showed significant differences in execution strategies. Early tools often used a fully automatic mode, generating all files in a single submission. Today, an increasing number of tools adopt a task-oriented building mode, such as phased planning and multi-agent collaboration.
From the results, two types of performance stood out. One type responded quickly, generating a runnable project in a single build with minimal manual correction. The other type often encountered compilation errors after the initial generation, requiring multiple rounds of conversation to get the project running.
Multi-agent solutions also involved trade-offs. Fast-generation agents developed projects quickly, but during multiple generations, they might repeatedly nest folders with the same name, causing project path confusion and startup failures. Planning agents paid more attention to structure, reducing directory confusion, but took longer to respond, and compilation errors were harder to locate and fix. Developers need to choose between speed and structural stability based on the project’s scale.
III. UI and Responsive Design Issues
Interface quality was the most intuitive difference in this test. Some generated results looked visually stiff, resembling engineering prototypes. Typical issues included button text blending into background colors, making it hard to read, and a lack of a unified color scheme. Images were almost entirely placeholders, and product detail pages lacked sufficient information, failing to resemble real product pages.
Responsive performance was equally uneven. Some results included simple mobile adaptations, but form-heavy pages like login and registration were prone to breaking on narrow screens. For example, at narrower viewport widths, input boxes and buttons might overflow their containers, causing horizontal scrolling. Other results completely lacked mobile adaptation logic. When inspecting, it is recommended to use browser developer tools to switch between various screen widths and take screenshots page by page for comparison, rather than just checking the desktop view.
IV. Code Quality and Project Architecture
Source code review reveals maintenance costs better than interface checks.
The degree of separation between styles and logic varied greatly. Better results generated independent style files, where components only handled structure and behavior. Other results recognized the need for separation but wrote styles directly inside component files, requiring developers to search through multiple components to modify a single style.
Directory structure issues were also common. Some projects had flat structures, stacking all pages and components on the same level. Others reserved directories for hooks or context, but the files inside were empty—just names without actual functionality.
The most critical issue to watch out for is data coupling. Mock data was sometimes written directly into business components without an independent API request layer or mock service. While this runs fine initially, integrating a real backend means altering data fetching methods on every page, leading to massive refactoring.
It is recommended to plan the following structure in the project skeleton in advance:
src/
api/ Request wrappers; pages should only call functions here
mock/ Mock data, maintaining the same structure as real APIs
hooks/ Reusable logic, e.g., form validation
context/ Global state, e.g., user login info and shopping cart
pages/ Page components
components/ Common components
When connecting to a real backend, you only need to replace the implementation in the api layer, leaving the page code mostly untouched.
V. Actionable Strategies
Based on the observations above, developers can use the following checklist when working with AI coding tools.
- Prompts must include: the tech stack and versions (e.g., React and routing library versions); UI framework (e.g., Ant Design or TailwindCSS); directory structure requirements; and responsive breakpoints (e.g., switching to mobile layout below 768px).
- Generate step-by-step: Start with routing, layout, and global state. Once it runs successfully, generate pages one by one. Conduct manual review and run the project after each step to ensure no errors.
- Prioritize data layering: Before letting the tool write business code, establish the
apiandmockdirectories, and specify in the prompt that pages must only fetch data through theapidirectory. - Execute build commands after each generation, such as
npm run build. Treat compilation errors as acceptance criteria rather than relying solely on visual inspection.
Additionally, there are security and compliance requirements. AI-generated dependencies need license checks. Secrets and access tokens must not be written into frontend code; they should be managed on the server side or in environment variables. Mock data should not contain real user Personally Identifiable Information (PII).
VI. Conclusion
In this test, AI coding tools performed well when handling single components and simple pages. However, when facing an e-commerce system with ten pages and strong consistency requirements, the tools’ stability and architectural quality still showed significant gaps. Developers need to maintain strong architectural control and debugging skills. Currently, it is more appropriate to view these tools as highly efficient junior coders; system design and final judgment must still be completed by developers.
To put currently generated code into actual use, it still needs to be integrated with backend services and cloud infrastructure. For example, static assets can be hosted in object storage, and frontend build artifacts can undergo continuous integration and deployment via container platforms. Such practices help connect code generation with the delivery process. The specific efficiency improvements must be tested in your own projects and should not directly adopt others’ metrics.
