LLM Agents for Full-Stack Development: Practices and Boundaries
Large language model agents can read a long requirements document and generate frontend pages, backend APIs, and data models, which makes them useful for accelerating prototypes and minimum viable products (MVPs). However, their output must be verified before production. This article describes a practical approach and the boundary of using LLM agents in full-stack development, based on observations from a controlled demonstration with no quantitative measurements or benchmark scores. It covers what agents can produce, where human review is required, frontend and backend verification, concurrency-safe seat booking, prompt engineering for reproducible generation, deployment, and data security.
Large language models are now able to read a long requirements document and generate frontend pages, backend APIs, and data models. These agents are useful for accelerating prototypes and minimum viable products (MVPs), but their output must be validated before it can be used. This article is based on observations from a controlled demonstration. It contains no quantitative measurements and cites no benchmark scores, so it should be read as a method reference rather than a performance conclusion.
1. What Agents Can Handle and Where Human Review Is Required
In full-stack development, an agent typically handles four types of work: requirements decomposition, page generation, API generation, and configuration drafting. The table below lists the deliverables for each area and the points engineers need to review.
| Area | Agent Output | Human Review |
|---|---|---|
| Requirements decomposition | Page list, entity list, API list | Whether business rules are accurate and whether exception flows are missing |
| Frontend pages | Page structure, styles, component code | Browser compatibility, accessibility, mobile layout |
| Backend APIs | Routes, CRUD logic, basic parameter validation | Transactions, concurrency control, permission checks, error handling |
| Deployment configuration | Container files, environment variable templates | Secret management, resource cost, compliance requirements |
Complex business rules, security, performance, and compliance still require human ownership. Code generated by an agent can serve as an engineering skeleton, but it should not go directly to production.
2. Frontend Implementation: Effect, Implementation, and Verification
The frontend is often the most visible output. A space-tourism website demo can be used to separate each effect into what it looks like, how it is implemented, and how to verify it.
Seat Selection Map
- Effect: A clickable spacecraft cabin map; seats use different colors by state.
- Implementation: Seats are drawn in pure SVG. Each seat element is bound to a status field returned by the API, not hardcoded on the page.
- Verification: Check click behavior, keyboard focus, and mobile layout in the latest two versions of Chrome, Firefox, and Safari. Seat elements need readable labels for screen readers.
Status Indicators and Flight Timeline
- Effect: The flight data panel uses a monospace font; status lights have a breathing animation; the timeline shows stages.
- Implementation: The animation uses CSS keyframes. Timeline stage data comes from a configuration file, so copy changes do not require component code changes.
- Verification: Check that animations are disabled when the “reduce motion” system setting is enabled.
Canvas/WebGL Product Showcase
In the demo, the agent used Canvas to simulate light effects on liquid inside a perfume bottle. This type of effect is demanding on GPU and browser performance. Before release, measure frame rate on mid-to-low-end phones and provide a static image fallback for browsers without WebGL.
3. Backend Implementation: The Correct Way to Write Seat Booking
The backend is the most error-prone part. Agent-generated business code can often pass the normal happy path, but it may not be correct under concurrency.
A common pattern seen in demos is to query a seat status first, confirm that it is available, and then save it as locked. This read-then-write pattern is not atomic. Two requests can both read the same seat as available and then write one after another, producing two valid bookings. The presence of the word LOCKED in the code does not mean overselling is prevented.
A correct approach has three parts. First, use one conditional UPDATE statement that combines “available” and “lock” in a single atomic database operation. Second, create a unique constraint on (flight_id, seat_number) as a final backstop. Third, give the lock a timeout and let a scheduled task release expired locks.
The following PostgreSQL example shows the lock and confirm steps. This is illustrative code; adjust transaction syntax to the database client used in a real project.
// Step 1: Lock the seat. The conditional update lets only one request lock a seat.async function lockSeat(db, flightId, seatNumber, holdId, holdUntil) {const result = await db.query(`UPDATE seatsSET status = 'LOCKED', hold_id = $3, hold_until = $4WHERE flight_id = $1 AND seat_number = $2 AND status = 'AVAILABLE'`,[flightId, seatNumber, holdId, holdUntil]);if (result.rowCount !== 1) {throw new Error('Seat is already locked or occupied');}return true;}// Step 2: Confirm the booking. Both updates run in one transaction; failures roll back.async function confirmBooking(db, { flightId, seatNumber, holdId, passenger }) {return db.transaction(async (tx) => {const seat = await tx.query(`UPDATE seatsSET status = 'BOOKED', hold_id = NULL, hold_until = NULLWHERE flight_id = $1 AND seat_number = $2AND status = 'LOCKED' AND hold_id = $3 AND hold_until > now()`,[flightId, seatNumber, holdId]);if (seat.rowCount !== 1) {throw new Error('Lock expired or is no longer valid; please select a seat again');}// The bookings table has a unique constraint on (flight_id, seat_number) as a backstop.const booking = await tx.query(`INSERT INTO bookings (flight_id, seat_number, passenger_name, status)VALUES ($1, $2, $3, 'CONFIRMED')RETURNING *`,[flightId, seatNumber, passenger.name]);return booking.rows[0];});}
A few points:
- Do not maintain a separate available-seat counter. Derive the count from rows whose status is
AVAILABLE. A separate counter can drift from the real data after an abnormal failure. - Lock timeout uses
hold_until. A scheduled task runs every minute and changesLOCKEDseats that are pasthold_untilback toAVAILABLE. - The confirm request should carry an idempotency key. If the client retries after a network timeout, the server should return the existing order instead of creating a second one.
- If any step in the transaction fails, the database rolls back and the seat is not left in a half-completed state.
The code above is not meaningful without tests. At minimum, include these cases:
- Send 100 concurrent lock requests for the same seat. Exactly one should succeed and the other 99 should fail.
- Simulate a database error while inserting the order. Verify the seat returns to its pre-lock state, not
BOOKED. - Wait beyond the lock timeout and then confirm. The API should return a “lock expired” error.
- Submit the confirm request with the same idempotency key multiple times. Only one order should be created.
4. Prompt Engineering: Making One-Shot Generation Reproducible
A single prompt can produce a runnable prototype, but only if the prompt is specific. Vague instructions produce vague output. The following prompt skeleton is reusable.
Role: You are an experienced full-stack engineer. Output a runnable project skeleton.Business context: one sentence describing the product and users.Tech stack:- Frontend: React 18 + Vite- Backend: Node.js 20 + Express- Database: PostgreSQL 16Data model: list fields, primary keys, foreign keys, and unique constraints for each table.API contract: list method, path, request body, response body, and error codes for each endpoint.Visual requirements: color, font, animation scope, and fallback cases.Acceptance criteria:1. npm test passes.2. In the concurrency test, only one request succeeds for the same seat.3. Pages produce no console errors in the specified browsers.Prohibitions:- No hardcoded keys.- No read-then-write non-atomic pattern.- No undeclared third-party dependencies.- No omitted error handling.Output requirements:1. Show the directory structure first.2. Output code file by file.3. List assumptions that need human confirmation.
With this skeleton, the generated directory structure often looks like this:
flight-booking/client/src/pages/components/api/server/src/routes/controllers/services/models/db/migrations/tests/README.md.env.example
In practice, one generated pass rarely meets acceptance criteria directly. A more reliable workflow is iterative: generate the data model and API contract first, then ask the agent to add business services, and finally have it revise code based on the test report. Save generated content and test results from each round so the source of a problem can be traced.
5. Deployment and Data Security
Agent-generated services are usually monoliths or lightweight microservices. For deployment, put them in a container platform, put static assets such as images and videos into object storage, keep business data in a managed relational database, and send logs and metrics to standard logging and monitoring systems. Cloud vendor selection should be based on the team’s existing infrastructure and procurement conditions.
Data security has three bottom lines. First, do not put real customer data, passwords, or secrets into prompts. Second, route calls to the code generation service through an internal gateway and log the caller and request content for auditability. Third, in sensitive industries such as finance and healthcare, evaluate first whether the model service deployment meets industry requirements. Private deployment can reduce the risk of data leaving the organization, but it does not replace code review and security testing.
6. Conclusion
LLM agents can significantly shorten the time from requirements to prototype. They are good at generating page structure, API frameworks, and common CRUD logic. They are not good at judging whether business rules are accurate or at guaranteeing concurrency, transaction, and security correctness. When teams use agents, their effort should be concentrated on requirements definition, architecture review, test design, and code review. Only when those tasks are done well can generated code move from prototype to a reliable product.
