Project Showcase

AIsle

AIsle

2026PythonFastAPIMCPAI AgentsWSO2 ThunderIDPostgreSQLSupabaseNext.jsTypeScriptTailwind CSSShadCN

AIsle is a supermarket inventory and purchasing system built around a single thesis: the business logic should be written exactly once and reused by every consumer that needs it. It is served through two independent front doors: a FastAPI HTTP API behind a Next.js inventory-manager UI, and an MCP server exposing the same operations as tools an AI agent can call.

The architecture holds because the boundary is mechanical rather than conventional. A service function is a plain Python function; FastAPI wraps it in a route and MCP wraps it in a tool, and neither framework owns the logic. `services/` may never import from `api/` or `mcp_server/` and never touches web concepts with three import-linter contracts enforcing that across the codebase. Services raise plain exceptions from a shared vocabulary, and each adapter translates them into its own dialect: a NotFoundError becomes an HTTP 404 in the API and an error message in MCP.

The frontend gets the same treatment so it cannot drift. Two ESLint no-restricted-imports rules enforce that only the API module may call fetch, and that no Next.js route handlers may mirror FastAPI endpoints. A proxy layer would be a third adapter, the same category of mistake, forbidden for the same reason. Reads happen in Server Components and mutations go through Server Actions, so the API base URL never reaches the browser. The client itself is generated from the OpenAPI schema and committed, with a drift check that fails when the generated types no longer match the backend contract.

The agent behind the MCP door runs as its own Python service reached over HTTP, rather than as a loop embedded in the web tier — so it reaches the business logic through the MCP tools instead of around them, and the UI never becomes its host. Because those tools mutate real stock, the chat surface was specified as a full state machine before it was wired: idle, thinking, streaming a reply, tool-call-in-progress, success and refusal, so a user can always see whether the agent is answering a question or changing their inventory. Identity is a parameter obtained in exactly one place on each side, leaving a single seam for the OAuth token exchange that lets the agent act on a user's behalf without inheriting more privilege than that user has.

Built with Python 3.12, FastAPI, SQLAlchemy and Alembic over Postgres on Supabase, and the MCP Python SDK; the client is Next.js 16 with React 19, Tailwind CSS v4 and shadcn/ui. 31 tests cover the service layer directly plus both adapters, including a real stdio MCP client. Products is taken end to end through every layer as the reference slice for the remaining entities.