Generating Full-Stack Applications with LLMs: From UI to Business Logic Closure
This article uses a full-stack generation case study to explore the practical performance of Large Language Models (LLMs) across frontend, backend, and data persistence. Avoiding benchmark scores, the article focuses on aspects that can be validated in real projects: UI fidelity, translating business rules into code, and areas where manual intervention is still required.
This article uses a full-stack generation case study to explore the practical performance of Large Language Models (LLMs) across frontend, backend, and data persistence. It avoids benchmark scores, focusing only on aspects that can be validated in real projects: how well the UI is restored, whether business rules can be translated into code, and where manual completion is still required.
1. How Capable Are LLMs in Frontend Development?
1.1 Restoring Visual Style and Narrative Rhythm
Taking a showcase website for a low-Earth orbit travel company as an example. The prompt included two features: “seat selection” and “flight booking.” The model generated a full-screen video background, a monospaced font data panel, and a breathing light effect indicating system online status. The narrative section was organized chronologically, sequentially presenting the wearing of pressure suits, acceleration during the propulsion phase, zero-gravity experience, and ocean splashdown recovery. The seat map was drawn using SVG, allowing users to click and select.
These results show that the model can map abstract descriptions like “commercial aerospace” and “premium feel” to fonts, animation curves, and color schemes. However, the case only describes the generated results; the original text does not provide the full prompt, model version, or results of repeated experiments. Readers should verify these in their own projects rather than directly adopting these visual conclusions.
1.2 Adapting to Different Industry Tones
The same method was applied to a deep-sea exploration agency website and a luxury perfume brand’s official website. The deep-sea scenario used parallax scrolling, with the page gradually sinking from the surface into the water. CSS gradients simulated the waterline and light attenuation, while floating submersible lights and deep-sea creature displays enhanced the scientific atmosphere. The perfume scenario used Canvas or WebGL to draw amber-colored bottles, and a serif font (such as Cormorant Garamond) was used to reflect the brand identity.
These two examples demonstrate that the same type of prompt structure can switch between multiple industry styles. It can shorten the time required to build early visual prototypes, but brand colors, font licensing, and accessibility contrast still need to be confirmed by designers.
2. How Well Can Backend Business Rules Be Implemented?
2.1 Validation Process and Concurrency Flaws in the Seat Locking Example
The flight booking requirements in the case included: selecting a date, selecting a seat, filling in passenger information, writing data to persistent storage, and setting a “maximum of 6 seats per flight, automatically locking when full.” The pseudocode generated by the model executed in the following order: read the flight, check if the seat is occupied, check if it is full, and finally write the seat.
The single-threaded flow of this code is correct, but it does not guarantee concurrency safety. Two requests might simultaneously read “1 seat remaining,” both pass the check, and ultimately cause overbooking. The modified version needs to do three things:
- Wrap the entire booking process in a transaction.
- Use
SELECT ... FOR UPDATEto lock the flight row, serializing booking requests for the same flight. - Create a
UNIQUE(flight_id, seat_number)constraint on the seat table, allowing the database to intercept duplicate seat selections.
The modified example is as follows (using PostgreSQL and node-postgres as examples; the table structure must be created beforehand):
async function bookSeat(db, flightId, seatNumber, passenger) {const client = await db.connect();try {await client.query('BEGIN');// Lock the flight row to serialize concurrent bookings for the same flightconst { rows } = await client.query('SELECT capacity, status FROM flights WHERE id = $1 FOR UPDATE',[flightId]);if (rows.length === 0) throw new Error('Flight does not exist');if (rows[0].status !== 'open') throw new Error('Flight is locked');const { rows: booked } = await client.query('SELECT COUNT(*)::int AS cnt FROM seat_bookings WHERE flight_id = $1',[flightId]);if (booked[0].cnt >= rows[0].capacity) {await client.query("UPDATE flights SET status = 'locked' WHERE id = $1", [flightId]);await client.query('COMMIT');throw new Error('Flight is full');}// Duplicate seat selection is caught by the UNIQUE(flight_id, seat_number) constraintconst { rows: rec } = await client.query(`INSERT INTO seat_bookings (flight_id, seat_number, passenger_name, passenger_id)VALUES ($1, $2, $3, $4) RETURNING id`,[flightId, seatNumber, passenger.name, passenger.idNo]);await client.query('COMMIT');return rec[0].id;} catch (err) {await client.query('ROLLBACK');throw err;} finally {client.release();}}
SELECT ... FOR UPDATE blocks other transactions for the same flight until the current transaction is committed or rolled back. The unique constraint…
