Building a React E-Commerce Site from Scratch: AI Coding Tool Limits and Engineering Practices
A React e-commerce project with 10 core pages provides a practical test of AI coding tools beyond code completion. This article examines generation workflows, UI quality, business logic, and architectural weaknesses, then outlines a developer-led approach to refining AI-generated code and integrating cloud backend services.
AI coding tools are moving beyond code completion toward automated full-stack generation. But how well do they handle the interconnected requirements of a real application?
Building a React e-commerce frontend from scratch offers a useful test. A site with 10 core pages requires more than convincing individual screens: routing, shared state, validation, and responsive layouts must work together. This article examines the strengths and limitations of AI coding tools in that setting and the engineering practices needed to turn generated code into a maintainable application.
1. The Test Scenario: A 10-Page React E-Commerce Site
The evaluation used a standardized task: build a shopping frontend from scratch with React, covering the following pages:
- Home page and product listing
- Product details
- Purchase page
- Purchase confirmation
- User login
- User registration
- Account dashboard
- Account orders
- Account wallet for cards and coupons
- Account settings
The main challenge was completeness and consistency across the site. Rendering each page was only part of the task. The application also needed coordinated state management, navigation, form validation, and responsive behavior.
2. Interaction Modes and Generation Efficiency
An AI coding tool’s interaction model affects both its development workflow and the quality of its output. Two broad approaches are fully automated generation and semi-automated workflows guided by multiple agents or explicit build instructions.
The Pitfalls of Fast Generation
Some tools offer a streamlined generation mode designed to produce results as quickly as possible. Although these modes respond quickly, they can struggle to maintain a coherent project structure as complexity increases.
In the evaluation, a typical failure was the creation of nested directories with identical names. The resulting structure caused dependency resolution problems and prevented the application from starting.
This illustrates a fundamental trade-off: fast generation is not useful if the output lacks the structural correctness required to run.
The Limits of Architecture-Oriented Modes
Other tools emphasize architectural planning and claim to support larger, more complex tasks. They spend more time planning before generating code, which increases response times.
In the tests described here, this approach produced projects that could start but still encountered numerous runtime errors. Context-window limits or insufficient reasoning depth could leave dependencies between components unresolved.
Developers then had to spend substantial time diagnosing and repairing the output. In some cases, the repair effort made continuing with the generated project impractical. More planning did not, by itself, guarantee a reliable implementation.
3. Generated Code Quality: UI and Business Flows
A frontend must do more than start successfully. It also needs usable interfaces and coherent end-to-end workflows.
UI Design and Responsive Layouts
The visual quality of AI-generated interfaces varied considerably. Some tools maintained a consistent primary color across pages, yet still produced basic contrast errors, such as white text on white buttons.
Generated layouts also tended to favor mobile screens. Basic adaptive styling was often present, but login and registration forms could become visibly distorted on desktop displays or at other screen sizes.
Image assets were commonly replaced with placeholders, while information-heavy pages, such as product details, lacked sufficient content. These results could serve as initial scaffolds, but they still required substantial UI refinement.
Business Flows and Form Validation
AI tools generally managed to connect a basic shopping flow and provide simple form validation. Their limitations became more apparent when requirements involved more complex interactions, such as combined coupon calculations or multistep order confirmation.
The distinction is important: implementing the visible outline of a requirement is not the same as modeling its business rules. The tools performed reasonably well on straightforward interactions but struggled with deeper business logic.
4. Engineering and Architectural Weaknesses
Runnable code and maintainable code are not equivalent. Reviewing the generated projects revealed several recurring problems.
Architecture Without Implementation
Some tools separated styles from JavaScript and created directories for hooks and context. Those structural choices appeared promising, but the directories were often empty.
Shared state remained inside individual components rather than being extracted into a meaningful state-management layer. The presence of a context directory did not mean that React Context was actually being used to coordinate cross-component state.
The result was an architecture that looked organized at the directory level without providing the behavior that structure implied.
Tight Coupling Between Data and Components
A more serious issue was the coupling of mock data with business code. To render pages quickly, tools frequently hardcoded mock data directly inside components rather than separating it behind an API layer.
This made the initial screens easy to demonstrate but increased the work required to connect real backend services later. Replacing mock data was no longer an isolated change: it required refactoring components and their associated logic.
5. A Developer-Led Workflow with Cloud Backend Integration
Relying on AI tools to generate an entire production-ready frontend remains risky when the application has complex business requirements. A more practical approach combines AI-assisted generation with human architectural oversight and deliberate frontend–backend integration.
AI tools are most useful for generating boilerplate, individual page scaffolds, and basic form components. Developers can use them to establish the foundations of the 10 pages, then review and refactor the output.
That review should focus on three priorities:
- Establishing an independent API request layer
- Separating mock data from UI and business logic
- Implementing appropriate shared-state management
These steps address the gap between a working demonstration and a codebase that can evolve as backend integration and business requirements become more demanding.
Supporting the Backend with Baidu AI Cloud
Once the frontend scaffold is generated, backend development also needs an efficient foundation. Cloud platforms such as Baidu AI Cloud can provide infrastructure for that work.
The services discussed in this approach include:
- API Gateway and Cloud Function Compute (CFC) for serverless backend endpoints
- Baidu Object Storage (BOS) for frontend static assets and product images
- Relational database services for highly available storage of order and user data
- Monitoring and logging services for tracking the application’s behavior in production
These services support backend implementation and operations; they do not remove the need to review the generated frontend architecture. For an overseas deployment, service availability and regional suitability should be checked in the official documentation rather than assumed.
6. Conclusion
AI coding tools significantly lower the effort required to create an initial frontend. They can accelerate the transition from an idea to a set of working screens, but a complex e-commerce site exposes clear weaknesses in project structure, state management, data separation, and business-rule implementation.
The most effective approach is to treat AI as a development aid rather than a substitute for engineering judgment. Use it to generate scaffolding quickly, then retain responsibility for architectural review and refactoring.
Combining that reviewed frontend foundation with suitable cloud backend services, including those discussed from Baidu AI Cloud, offers a more practical path to efficient, high-quality delivery than relying on end-to-end generation alone.
