LLM-Assisted Full-Stack Web Development: From Prompt to Deliverable Prototype

    This article presents a practical workflow for LLM-assisted full-stack prototyping, using a website with a visual narrative page and a flight-booking-style reservation feature as an example. It covers turning prompts into testable specifications, frontend implementation details, booking backend design, overbooking prevention, validation through tests and security review, and a delivery checklist. Readers can use the described approach to move from an idea to a runnable prototype while keeping generated code subject to clear requirements and verification.

    1. Background: A New Form of LLM-Assisted Prototype Development

    In the past, taking a business-facing website from requirements to launch usually involved design mockups, frontend development, backend APIs, database design, integration testing, and several other stages, with a cycle measured in weeks. In recent years, LLM-powered coding agents have been able to generate page structure, styles, interaction scripts, and some server-side logic from a structured description at the same time. This has significantly reduced the cost of prototype validation. A team can get a clickable, operable version within hours.

    Faster speed does not mean quality automatically meets the bar. Model-generated code may lack edge-case handling, may not account for concurrency scenarios, and may leave security gaps. A reasonable approach is therefore to treat the model as a highly efficient junior implementer: people define requirements, break down tasks, and set acceptance criteria, while testing and review confirm the results.

    This article uses a typical scenario—a website that includes a visual narrative page and a flight-booking-style reservation feature—to explain how to organize prompts, implement the frontend and backend, and validate generated results. The approach is generic and can be applied to other types of display sites and business systems.

    2. Requirements Decomposition: Turning Prompts into Testable Specifications

    The quality of the prompt directly determines the quality of the generated result. Vague descriptions such as “build a premium official website” cannot be verified, and the model can only guess based on general experience. A reliable approach is to split a prompt into four parts.

    2.1 Define Page Goals and Audience

    Answer two questions first: what action should the page lead visitors to complete, and who are the visitors? For a booking site, the goal might be for users to select a seat and submit an order, and the audience might be individual users with clear travel needs. The more specific the goal, the clearer the subsequent page hierarchy and interaction path.

    2.2 List Features and Data Entities

    The feature list should specify pages, data entities, states, and constraints item by item. For example:

    1. Pages: home, flight details, seat selection, order confirmation
    2. Entities: flight (number, date, total seats), seat (number, status), order (passenger info, selected seat, created_at)
    3. States: seat status is free / booked; new orders are blocked when the flight is full
    4. Constraints: at most 6 bookable seats per flight; passenger name and ID are required

    This style gives both the model and testers the same basis.

    2.3 Agree on the Visual System

    Visual constraints should be translated into executable parameters, including primary color, secondary color, font family, type scale, animation duration, and spacing rules. Instead of writing “tech feel,” write “dark background, neon cyan primary color, sans-serif body text, monospace headings and numeric values, animations no longer than 600 ms.” Once the parameters are explicit, consistency in the generated result improves significantly.

    2.4 Specify Deliverables and Acceptance Criteria

    The end of the prompt should list deliverables, such as a runnable source directory, startup instructions, API documentation, and test cases. It should also state the acceptance method, for example, “after submitting an order, refreshing the page still shows the order record.” Such descriptions can be converted directly into test cases.

    3. Frontend Implementation Notes

    3.1 Full-Screen Background and Performance Control

    Full-screen backgrounds often use video or large images. Three points matter during implementation: the video should be compressed and set to an appropriate resolution, non-first-screen resources should be lazy-loaded, and the user’s system motion preferences should be respected.

    1. .hero-video {
    2. position: fixed;
    3. inset: 0;
    4. width: 100%;
    5. height: 100%;
    6. object-fit: cover;
    7. z-index: -1;
    8. }
    9. @media (prefers-reduced-motion: reduce) {
    10. .hero-video {
    11. display: none;
    12. }
    13. .hero-fallback {
    14. background: linear-gradient(180deg, #0b1d33, #02060d);
    15. }
    16. }

    When users enable reduced motion, the page should use a static background instead of video. This is both an accessibility requirement and a way to reduce mobile data usage and battery consumption.

    3.2 Vertical Timeline Narrative

    Narrative pages often use a vertical timeline to organize content. Each node corresponds to a point in time or a stage and includes a key value and an explanatory image. In implementation, IntersectionObserver can trigger a fade-in animation when a node enters the viewport, avoiding loading all animations at once.

    1. const steps = document.querySelectorAll('.timeline-step');
    2. const observer = new IntersectionObserver(
    3. (entries) => {
    4. entries.forEach((entry) => {
    5. if (entry.isIntersecting) {
    6. entry.target.classList.add('is-visible');
    7. observer.unobserve(entry.target);
    8. }
    9. });
    10. },
    11. { threshold: 0.3 }
    12. );
    13. steps.forEach((el) => observer.observe(el));

    Numeric values inside nodes should use monospaced numbers, for example font-variant-numeric: tabular-nums in CSS, so that numbers in different rows align and are easier to read.

    3.3 Data Panels and Status Indicators

    Dashboard-style panels are suitable for displaying parameters and operating status. A status indicator can be represented by a dot with a periodic animation, but note that it is only a visual decoration. The real status on the page should be determined by data returned by the API. Do not let a decorative animation imply an actual online status that does not exist.

    3.4 Responsive Design and Accessibility

    On mobile, the timeline and panels need to be rearranged to avoid horizontal scrolling. All interactive elements should have keyboard focus styles, images need alternative text, and color contrast should meet common WCAG AA standards, meaning normal text contrast should be no lower than 4.5:1.

    4. Designing the Booking Backend

    4.1 Data Model

    The booking feature requires at least three tables: flights, seats, and orders. Seats have a many-to-one relationship with flights, and orders are linked to seats through a unique constraint.

    1. CREATE TABLE flights (
    2. id INTEGER PRIMARY KEY,
    3. flight_no TEXT NOT NULL,
    4. depart_at TEXT NOT NULL,
    5. capacity INTEGER NOT NULL CHECK (capacity > 0)
    6. );
    7. CREATE TABLE seats (
    8. id INTEGER PRIMARY KEY,
    9. flight_id INTEGER NOT NULL REFERENCES flights(id),
    10. seat_no TEXT NOT NULL,
    11. status TEXT NOT NULL DEFAULT 'free' CHECK (status IN ('free', 'booked')),
    12. passenger TEXT,
    13. UNIQUE (flight_id, seat_no)
    14. );

    UNIQUE (flight_id, seat_no) ensures that a seat number can appear only once within the same flight. This is the first line of defense at the data layer.

    4.2 Preventing Overbooking

    The most common failure in booking systems is overbooking: two users select the same seat at the same time, and both requests determine that the seat is available. The solution is to combine “check” and “modify” into a single atomic operation; do not query first and update afterward.

    1. import sqlite3
    2. class SeatUnavailableError(Exception):
    3. """The seat is already occupied or does not exist."""
    4. def reserve_seat(conn: sqlite3.Connection, flight_id: int,
    5. seat_no: str, passenger: str) -> None:
    6. with conn: # Transaction: commit on normal exit, roll back on exception
    7. cur = conn.execute(
    8. """
    9. UPDATE seats
    10. SET status = 'booked', passenger = ?
    11. WHERE flight_id = ? AND seat_no = ? AND status = 'free'
    12. """,
    13. (passenger, flight_id, seat_no),
    14. )
    15. if cur.rowcount != 1:
    16. raise SeatUnavailableError(f"Seat {seat_no} is unavailable")

    WHERE ... AND status = 'free' places the condition inside the update statement. When the database executes it, it locks the target row, and only one of two concurrent requests can make rowcount equal 1. Most relational databases support this pattern; the specific isolation level and locking behavior should be confirmed in the documentation of the database in use.

    4.3 Automatic Locking When Full

    Rules such as “6 seats per flight, automatically locked when full” should be derived from data rather than relying on a manually maintained boolean field. The derivation can be done as follows:

    1. def flight_is_full(conn: sqlite3.Connection, flight_id: int) -> bool:
    2. row = conn.execute(
    3. "SELECT COUNT(*) FROM seats WHERE flight_id = ? AND status = 'booked'",
    4. (flight_id,),
    5. ).fetchone()
    6. return row[0] >= conn.execute(
    7. "SELECT capacity FROM flights WHERE id = ?", (flight_id,)
    8. ).fetchone()[0]

    Manual fields can easily become inconsistent with actual data after an abnormal interruption. Calculating directly from order and seat data keeps the result consistent with reality. In high-concurrency scenarios, the count can be placed in the same transaction, or a counter table with conditional updates can be used to avoid races between reads and writes.

    4.4 Persistence and Backup

    Booking data is business-critical data and must be written to persistent storage with regular backups. The backup strategy should include full backups and incremental logs, and the recovery process should be rehearsed regularly. Before migrating the database schema, complete a backup first and validate the migration script in a test environment.

    5. Validating Generated Results

    Code produced by a model should go through the same validation process as manually written code.

    5.1 Unit and API Tests

    Write tests for the booking logic covering the following scenarios: normal booking, booking the same seat twice, booking a nonexistent seat, submitting after the flight is full, and missing input fields.

    1. def test_double_booking_is_rejected(conn):
    2. reserve_seat(conn, flight_id=1, seat_no="A1", passenger="Alice")
    3. try:
    4. reserve_seat(conn, flight_id=1, seat_no="A1", passenger="Bob")
    5. except SeatUnavailableError:
    6. return
    7. raise AssertionError("Double booking should be rejected")

    5.2 Concurrency Tests

    Single-threaded tests cannot expose race conditions. Multiple threads or asynchronous tasks can request the same seat at the same time while counting successful attempts; the correct result should be exactly 1. Such tests should be included in the continuous integration process.

    5.3 Security Review

    A security review should focus on the following:

    • Revalidate all external input on the server; client-side validation is only for improving the user experience.
    • Use parameterized statements for database access and avoid string concatenation.
    • Inject sensitive information such as secrets and database connection strings through environment variables or a secret management service; do not write them into code or logs.
    • Personal information such as passenger ID documents requires a stated purpose and should be stored and displayed on a minimum necessary basis.

    5.4 Rollback and Canary Releases

    Each delivery should have a version marker so that a failed deployment can be rolled back quickly. For booking features, it is advisable to validate with a small portion of traffic first and then expand gradually.

    6. Delivery Checklist

    Before handing the generated prototype to the business team, confirm each item:

    1. Every feature point in the requirements document has a corresponding page or API.
    2. Visual parameters match the prompt agreement, and animations can be disabled under reduced-motion settings.
    3. The booking path can be completed end to end, and data remains unchanged after refresh.
    4. In concurrency tests, the same seat can be booked successfully only once.
    5. The full-flight status is derived from data and displayed correctly on the page.
    6. Sensitive configuration does not appear in the codebase, and dependency versions are locked.
    7. Startup instructions, API documentation, and test commands are complete, so a new team member can run the project without guidance.

    7. Conclusion

    LLMs can significantly shorten the distance from idea to runnable prototype, but their output still needs clear requirement specifications, executable acceptance criteria, and a strict testing process. Writing prompts as structured specifications, using atomic operations to ensure booking data consistency, and relying on automated tests and security review as safeguards are key to achieving stable results in this kind of project. Teams can turn the above process into a template and reuse it across display sites and business systems.