Architecture

The Stack - Laravel AI, React, and Why Not Next.js

January 18, 2026

A common question: why Laravel instead of a Node/Python stack for an AI-heavy app?

Laravel AI SDK + Prism gives us streaming, tool use, multi-step reasoning, and provider abstraction out of the box. The SDK handles the back-and-forth of tool calls internally via withMaxSteps(). We get a generator that yields text deltas, and the tool execution happens transparently between steps.

Inertia v2 + React 19 means we get a full SPA experience without building a separate API layer. Server-side routing, shared validation, deferred props, prefetching. The backend defines the contract and the frontend mirrors it. No GraphQL, no REST endpoints for page data, no duplicated logic.

Why not Next.js? Because the AI orchestration is inherently server-side. Sub-agent delegation, queue jobs, database transactions, Horizon workers - these are backend concerns. Next.js would mean splitting the brain between server actions and a separate job runner. Laravel keeps it all in one runtime with Horizon managing the queue topology.

Chutes AI as primary provider is a deliberate choice. It gives us access to a wide range of open models (Qwen, Kimi-K2, DeepSeek) through a single API, with competitive pricing. The provider strategy pattern means swapping or adding providers is just implementing a contract. For local development, Ollama gives us the same abstraction pointing at localhost - useful for offline work, quick iteration, and testing new models without API costs.

Tailwind v4 for the UI. Dark-first design with glass morphism. The CSS uses OKLCH color space for perceptually uniform colors - the cyan accent at oklch(0.75 0.15 200) looks consistent across different display technologies.

Built with AI - this entire codebase is written by Claude Code and Codex. I steer the architecture, review the output, and make design decisions. The AI handles implementation. More on that in a separate post.

The whole thing deploys on a single Forge-managed server. No microservices, no Kubernetes. One Laravel app, one Redis instance, Horizon for queue management. Simple until it needs to not be.