Delivering Runnable Full-Stack Apps with Open-Source LLM Coding Agents

    Open-source large language models are increasingly used as coding agents, but benchmark scores don't tell you whether a generated project is actually deployable. This article focuses on one practical question: given a requirements spec, can an agent produce an application that runs, persists data, and enforces verifiable business rules? It covers a structured prompt framework for design-consistent frontends, backend data modeling with database-level constraint enforcement, an automated acceptance test checklist, security and operational risks, and how to allocate agent versus engineer responsibilities across project phases.

    Define the Task Scope First

    Recently, open-source LLMs have drawn attention for their performance in coding agent scenarios. Leaderboard scores reflect results on specific test sets, but they can’t directly answer whether a project is ready for production. This article doesn’t rely on benchmark data for any particular model; it addresses a single question: given a set of requirements, can an agent produce an application that runs, persists data, and has verifiable business rules?

    The approach applies to open-source coding agents that can read and write project files, execute terminal commands, and run tests. The example throughout is a fictional flight booking website with four pages: home, flight list, seat selection, and order confirmation.

    1. Getting a Design-Consistent Frontend in One Pass

    The most common problem when an agent generates a frontend in a single pass is inconsistent component styling: colors, font sizes, and spacing each take arbitrary values, effects pile up, and the same page ends up with three different button styles. The fix is to break requirements into fixed sections and have the agent execute them section by section.

    A recommended prompt structure:

    1. [Brand tone] Product type, target users, three keywords (e.g., professional, restrained, data-driven)
    2. [Page structure] Page list, block order per page, navigation pattern
    3. [Interactions] Required state changes, form fields, button behavior
    4. [Business rules] Quantity limits, validation conditions, error message copy
    5. [Technical constraints] Framework versions, styling approach, directory structure, prohibited dependencies
    6. [Acceptance criteria] Commands that must pass, page elements that must exist

    Beyond the prompt, do three things at the engineering level:

    • Have the agent first write design tokens (colors, font sizes, spacing, radii) into a standalone file. All components then reference the tokens instead of hardcoding values.
    • Split each page into independent components that receive data only via props and never call APIs directly. This way, swapping the data source later requires no page code changes.
    • Limit animations to three categories maximum, and provide a fallback for users who prefer reduced motion: detect prefers-reduced-motion and disable non-essential animations.

    Heavy resources like video backgrounds and extensive 3D rendering need separate load-time measurement. If first-screen load time exceeds the project’s threshold, fall back to static images.

    2. From Frontend to Backend: Making Booking Data Actually Persist

    A complete frontend doesn’t mean a usable application. If seat selections live only in an in-memory array, the data is lost on restart. Using the rule “each flight has a maximum of 6 seats” as an example, here’s how to enforce it in the database and API.

    With SQLite, the data model could look like this:

    1. CREATE TABLE flights (
    2. id INTEGER PRIMARY KEY,
    3. departure TEXT NOT NULL,
    4. seat_limit INTEGER NOT NULL DEFAULT 6,
    5. seats_sold INTEGER NOT NULL DEFAULT 0,
    6. CHECK (seats_sold >= 0 AND seats_sold <= seat_limit)
    7. );
    8. CREATE TABLE bookings (
    9. id INTEGER PRIMARY KEY,
    10. flight_id INTEGER NOT NULL REFERENCES flights(id),
    11. seat_no TEXT NOT NULL,
    12. passenger TEXT NOT NULL,
    13. created_at TEXT NOT NULL,
    14. UNIQUE (flight_id, seat_no)
    15. );

    The CHECK constraint makes the database reject writes that would oversell, and UNIQUE (flight_id, seat_no) prevents double-booking the same seat. Business rules are backed by the database; frontend validation exists only to improve the user experience.

    The API contract should specify a status code for every outcome:

    Request Success Failure
    POST /api/flights/{id}/bookings 201, returns the booking record 409: seat sold or flight full; 422: field validation failed
    GET /api/flights/{id}/seats 200, returns all seats and their availability 404: flight not found

    The booking write must happen inside a single transaction; otherwise, two users competing for the last seat could trigger an oversell. With SQLite:

    1. BEGIN IMMEDIATE;
    2. UPDATE flights
    3. SET seats_sold = seats_sold + 1
    4. WHERE id = ? AND seats_sold < seat_limit;
    5. -- The application checks the affected row count: if 0, run ROLLBACK and return 409
    6. INSERT INTO bookings (flight_id, seat_no, passenger, created_at)
    7. VALUES (?, ?, ?, ?);
    8. COMMIT;

    The frontend seat map must fetch seat status from the GET /seats endpoint and gray out sold seats. When a submission fails with a 409, the frontend should re-fetch the seat list and ask the user to choose again. Frontend state must never be treated as a source of business validation.

    3. Testing and Acceptance: How to Prove It Works

    Agent-generated code is only usable if it passes tests. The following checklist can be converted directly into automated test cases:

    1. Persistence: submit a booking, restart the service, then query the seats—the seat should still show as sold.
    2. Limit: submit 7 consecutive bookings for the same flight; the 7th should return 409, and seats_sold should equal 6.
    3. Concurrency: hit 6 seats with 20 concurrent requests; the number of successes must equal 6, and the bookings row count must match seats_sold.
    4. Frontend/backend consistency: sold seats shown on the seat selection page must match the list returned by the API.
    5. Invalid input: empty names and illegal seat numbers should return 422, with no new records in the database.

    When evaluating agent output, check each item against this table:

    Evaluation dimension Acceptance method Common failure mode
    Single-pass completeness Start the project for the first time after installing dependencies; count the lines requiring manual fixes Missing dependency declarations; fails to start
    Backend authenticity Query data after restarting the service Data lives only in an in-memory array
    Business constraints Run limit-exceeded and concurrency tests Frontend enforces limits, but the API doesn’t validate
    Design consistency Check the proportion of components referencing design tokens Colors and font sizes hardcoded across multiple components
    Maintainability Have an engineer who didn’t work on the code locate the booking logic within 30 minutes Business rules scattered across page components

    Thresholds in the table are up to the project. For example, “lines requiring manual fixes” can be relaxed during prototyping and tightened before launch.

    4. Risks and Boundaries Before Going Live

    Agent-generated code introduces new risks that must be addressed item by item before deployment:

    • Code auditing: run static analysis and dependency scanning on generated code. Agents may introduce outdated or known-vulnerable third-party packages.
    • Input validation: revalidate every client-submitted field on the server, including length, format, and permissions.
    • Credential management: keep database passwords and third-party API keys in environment variables or a secrets management service—never in code, and never in prompts.
    • Data backup: before the agent generates database migration scripts, back up the existing database and verify the backup can be restored.
    • Least privilege: grant the application’s database account read/write access only to the required tables—no admin privileges.
    • Operations configuration: after deploying to a container platform, set up log collection, metrics monitoring, and alerting. If you host static assets on object storage, review the access policy separately to prevent the bucket from being publicly writable.

    5. Using Agents by Project Phase

    Agents fit different roles at different stages:

    • Prototyping: have the agent quickly generate pages, scaffolding, and basic CRUD endpoints to confirm requirements.
    • Business logic: engineers should write or review core business rules and concurrency control—this code should not be fully delegated to generation.
    • Launch: deploy to production only after passing the test checklist and security checks.

    Conclusion

    Agents shorten the path from requirements to a runnable prototype, with the most visible gains in page structure, styling, and basic data operations. Business rules, concurrency consistency, and security boundaries still require engineers to define and verify them. Whether an agent-generated application is fit for a real project should be judged by whether it passes the test checklist above—not by how polished the visuals look.