Skip to content
From Frontend to Full-Stack: Delivering a Live-Stream Mini-Game with AI

From Frontend to Full-Stack: Delivering a Live-Stream Mini-Game with AI

A frontend developer at Huajiao used AI to build a live-stream mini-game 'Guagua Le', covering interaction prototyping, UI design, backend development with PHP/Redis, API design, transaction handling, caching, verification with real data and concurrency tests, and phased deployment, demonstrating how AI lowers the barrier for frontend engineers to expand into full-stack delivery.

Huajiao Technology
Huajiao Technology
Huajiao Technology

01 Clarify Flows and State Boundaries with an Interactive Prototype

After receiving the requirements, the author first asked AI to organize the host and audience operation flows, combining the existing public-room entry and layout to produce a runnable demo. Both the mobile live-room view and the admin console had corresponding entries, supporting 3x3 grid configuration, reveal, card swap, history viewing, and blind-box demonstration.

During the prototype phase, identity, inventory, and reward distribution used local mock data, mainly to confirm interactions. Ordinary commands stayed on the card face; blind-box entered a separate popup. The team also verified navigation after configuration, and whether canceling editing retained the original card.

From a frontend perspective, three categories of state were distinguished:

Page Temporary State : Currently selected cell, popup visibility, unsubmitted edit drafts — maintained in frontend component

Room Business State : Saved 3x3 configuration, current card, reveal results, reward order status — saved on backend, read by frontend with permissions; public card-face state synced via room

Operation Config : Gameplay settings published from admin console — maintained in admin console, backend processes according to published config

For example, clicking a cell only changes the current selection; executing a reveal submits a business operation. Saving a template and applying a configuration have different effects — editing the card library must not directly change the card currently in use during a live stream .

When asking AI to fill in pages and backend, the author divided work according to the confirmed operations: which cell is selected and whether a popup is open stay in the frontend component; saved card state goes to the backend, and public card-face changes are synced to the room.

02 Define Style from a Hero Image, Then Complete the Full Page Design

With a working prototype, the next step was visual design. The author first had AI explore several style directions around the main 3x3 grid interface. Guagua Le tried directions like "Moonlight Purple Crystal", "Ice Blue Aurora", "Purple Cartoon (adopted)", and "Warm Yellow Retro". Comparison focused on color palette, character design, card texture, and overall effect inside the live room. This round locked the visual direction for the entire mini-game.

Moonlight Purple Crystal
Moonlight Purple Crystal
Ice Blue Aurora
Ice Blue Aurora
Purple Cartoon (adopted)
Purple Cartoon (adopted)
Warm Yellow Retro
Warm Yellow Retro

After the hero image was approved, AI used it as a baseline to design the configuration, template editing, history, and blind-box result pages. Characters, colors, buttons, and popup styles followed the same visual language, while real content from the prototype checked layout and information hierarchy.

All pages were reviewed together: whether the config page harmonized with the main card, how records arranged when many, how the blind-box popup highlighted results. Once each page's UI was confirmed, asset production began, giving later generated resources clear style and position references.

Multi-page UI preview (mock content)
Multi-page UI preview (mock content)

AI then compiled asset requirements from each page's UI and generated independent resources: characters, cell backgrounds, decorations. Progress, cell numbers, and reward names remain rendered by code to handle varying business data and enable asset reuse.

Assets were assembled into actual Vue config-page and main-card components, adjusting size, spacing, and layering. After wiring mock room data, the author continued checking narrow-screen titles, long copy, record scrolling, and popup positioning so the visual designs held up under real content and interaction states.

03 Finalize Data and Interfaces First, Then Implement Backend Step by Step

Before writing backend code, the author had AI read through an existing PHP gameplay implementation to see how the flow from start to reveal to end was called. Huajiao's room already provided host identity and state sync; Guagua Le could reuse those. After understanding the existing code, the author listed the new logic this gameplay needed.

Discuss Table Structures and Interface Contracts First

When the host saves a configuration, the backend must persist it; when a new card is swapped in, previous operations must remain queryable. The author and AI walked through these operations to discuss data, distinguishing what room state, card content, and history records each needed to save.

Cards must retain the configuration at generation time. If the admin console later changes settings, already-generated cards continue using their original configuration; new cards adopt the updated configuration. Agreeing on this rule upfront meant both interface and page development followed the same logic.

The room frontend, backend, and admin console live in three separate repositories. The author advanced development in separate AI sessions for each. What parameters the page sends, what the backend returns — every part needed a shared understanding. The author organized an interface list around operations like configuration save, reveal, and card swap, documenting response structures and error meanings. All sessions developed against this contract. After implementation, the author traced the call flow to verify that page payloads and backend handling connected correctly.

Refine Implementation Using "Reveal a Cell" as an Example

On the frontend, revealing a cell looks like a simple click, but the interface must know which round of gameplay the host is operating, which card, and the card version the page holds. The backend validates host permission, card ownership, and current version; handles stale page state and duplicate submissions; and ensures an already-revealed cell cannot be rewarded again.

Backend processing flow for 'reveal a cell'
Backend processing flow for 'reveal a cell'

A single reveal simultaneously changes the card-face result and the reveal progress. The author and AI first listed all data involved in this operation, then placed the records that must change together into a single database transaction. All writes succeed before commit; any error rolls back everything together. Reveal results are saved first; subsequent business actions are handled separately.

Room info is read repeatedly by the frontend. The author and AI agreed to cache query results in Redis, with explicit cache-update timing. The reveal operation completes the database commit first, then invalidates the old cache , generates the new public state, and syncs it to the room. If sync temporarily fails, the saved reveal result in the database remains valid; subsequent processing must not re-trigger a reveal. Unrevealed answers and reward recipients also stay within their respective permission boundaries.

This discussion broke one interface into verifiable steps: what to validate first, which configuration to read, which records to modify, and what to return. AI implemented per these steps, and the author cross-checked each step against frontend operations and business rules.

Align Admin Console Input with Backend Processing

The admin console reused the existing Vue component library. The author first agreed on the meaning and units of each input field so parameters sent from the page could be correctly interpreted by the backend. On query failure, the page clears the previously fetched data and blocks confirmation, preventing stale results from entering the current configuration.

04 Verify Frontend and Backend with Real Responses and Business Data

Verification was split into two layers: whether interfaces match the contract, and whether business results follow the rules.

Interface Verification Uses Actual Backend Responses

The backend executed real interfaces in an isolated environment and exported response packets. The frontend directly used these results for integration verification. Default 3x3 grid, saved configuration, card version, and reward info all came from the same backend execution. This checked whether frontend and backend shared the same understanding of fields, types, and state meanings. Component tests, actual builds, and browser inspection further verified request handling, page rendering, layout at different sizes, and interactions.

Business Verification Checks Data Against Rules

When the admin console modifies reward duration, should already-generated cards change? A clear rule was needed first. Guagua Le adopted a configuration snapshot: old cards keep the reward configuration at generation time; new cards read the new configuration.

In the test environment, a card was generated, then the admin console modified the configuration, and the old card was revealed only after that change. AI queried actual business records and confirmed the old card still processed according to its generation-time configuration , while subsequently generated new cards used the updated configuration. This check simultaneously validated configuration update, card generation, and reward-order processing against the same rule.

The author also had AI run PHP and database integration tests in an isolated environment. Concurrency scenarios used two PHP processes executing simultaneously ; database write exceptions were injected to verify that related states could roll back together. Duplicate submissions for card opening, reveal, and card swap were included in the tests. Cache and locks were verified with a real Redis instance. Related code was additionally reviewed by an independent AI sub-agent.

05 Deploy in Dependency Order and Verify Deployed Artifacts

After frontend and backend development, the author confirmed that database schema, interface versions, and page code could run together in the same environment.

When adding new room configuration fields, AI prepared the database changes first, completing comments, default values, and check information. The author confirmed execution via the existing review process, then had AI verify the new fields against existing data. Deployment followed a backend-first, frontend-second order .

Before the frontend enables the new configuration flow, the corresponding fields and backend interfaces must be ready. AI organized changes, prepared merge candidates, ran checks, advanced the test-environment pipeline and deployment, then read the actually loaded page, scripts, and styles to verify that deployed artifacts matched the code that passed checks .

Guagua Le has completed multiple test-environment releases; production is configured with a single-room whitelist entry. Critical executions, merges, and releases still follow the platform's existing confirmation processes.

06 Summary

This Guagua Le practice presents a replicable path: starting from familiar interactions and pages, building on existing platform capabilities, and using AI to extend understanding step by step into data, interfaces, business verification, and deployment. Work originally scattered across different stages can be connected along a single requirement, becoming a concrete entry point for frontend developers to expand their capabilities.

Such expansion can begin with everyday questions: Which states does an operation change? What rules govern the interface response? After the page shows success, is the data correctly saved? Pursuing these questions further, then validating with prototypes, interfaces, and real data, lets frontend-accumulated experience play a role in more complete business flows. AI lowers the cost of trying unfamiliar domains and gives these learning opportunities a chance to happen directly in real projects.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI-assisted developmentRedisPHPAPI Designtransaction managementfull-stack developmentdeployment pipelinelive-stream mini-game
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.