Industry observers note that epicstock is a photo stock marketplace where buyers license photos straight from the photographers who took them. A client asked for a storefront in the style of Unsplash or Alamy, selling digital products, with an admin panel to run part of the business. Putting the panel inside the storefront project was the obvious shortcut, and the wrong one. This post explains how the work split into three pieces in one repository, what that bought, and what it did not fix.
The storefront is public and the admin is not. Mixing them in one project and one domain made every admin feature a risk for the shop, and every shop change a risk for the admin. The panel needed its own domain.
Sources indicate that the API had to be separate too, and strong enough to carry every transaction: orders, payments, downloads and photographer payouts. Both frontends call it, so it could not belong to either one.
The work therefore split into a storefront (apps/web), an admin (apps/admin) and an API (apps/api). They stayed in one repository because they share a lot: UI components, business logic and domain references such as licence types, store names and photo statuses. With separate repositories, that code would be copied or published as packages, and the copies would drift apart.
The root pnpm-workspace.yaml declares two globs:.
Each app is a folder under apps/:.
Turborepo fans out every command to all the workspaces. pnpm build builds the whole repository, and --filter scopes a command to one package when only one changed. Each app still owns its own wrangler.toml and deploys to Cloudflare on its own, so the monorepo does not merge the three runtimes into one.
Four packages carry the contract between the apps:.
According to recent reports, the typed client matters most where it replaces plain strings. Some admin calls to the API were still plain strings.
In a recent development, in a smoke test of the admin panel on 2026-09-07, saving a photographer's fee amount returned a 404. The dialog called fetch("/api/admin/photographers/:id/fee-amount") with a relative path. The admin app has no app/api folder and no rewrites, so the request went to the admin's own origin and never reached the worker. Two other admin calls had the same problem: paying a payout and enabling two-factor authentication.
Recent findings suggest that the fix sent all three through the typed client, with credentials included. Now a wrong route is a type error, and pnpm check:types reports it before the code runs.
In a recent development, the bug existed inside the monorepo. Putting the apps in one place did not prevent it. Sharing the client did.
Recent findings suggest that deploys are still manual. pnpm deploy:manual deploys the web app, then the API, then the admin. CI does not run it. Database migrations are hand-written SQL files, applied by hand, and a migration has to land before the code that depends on it.
A shared package also means one change can reach three apps. That is the point of the layout, and it is also the risk. The checks that catch it are pnpm check:types across every workspace, the linter, and the dead-code and duplication reports. They run because someone runs them.
Recent findings suggest that I would keep the shared types, the validators and the typed client. They turned a runtime 404 into a type error, and that is the cheapest kind of bug to find.
The repository puts the three apps where you can see them change together. It does not make a change safe on its own. The types, the checks and the deploy order do that.
