#is it possible to have next.js web app + expo ios app with the same convex backend all in one repo?
1 messages · Page 1 of 1 (latest)
Hi @junior falcon. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Yes, this is both possible and a common pattern with Convex.
There are two main approaches:
1. Monorepo with shared Convex backend (recommended)
You can have a structure like:
apps/
web/ # Next.js app
mobile/ # Expo app
packages/
backend/ # Convex backend (schema + functions)
Both the Next.js and Expo apps import the same generated Convex API from the backend package, e.g.:
// In both Next.js and Expo apps
import { api } from "@workspace/backend/convex/_generated/api";
This is exactly how one production app runs a web dashboard and a mobile app against a single Convex deployment, with both apps sharing the same types and functions. [70‑module backend]
This setup is explicitly described as “adding mobile without adding backend” and is presented as a major advantage: one Convex deployment serving web + mobile, with type-safe shared API. [70‑module backend]
2. Multiple repos sharing one Convex backend
If you prefer separate repos (e.g. web in one, Expo in another), Convex supports generating a typed API file (api.ts) that you can check into other repos and use from there. [Multiple repos docs; Multiple repos article]
This is what Convex staff recommend when someone asks about a web app and a new Expo app sharing the same Convex DB/backend. [Discord multi‑repo thread]
So:
- Feasible? Yes, very much so.
- Advisable? Yes. A monorepo with a shared Convex backend package and both Next.js + Expo apps consuming it is described as “a bit more standard and straightforward” by Convex staff, and is used successfully in real projects. [Discord multi‑repo thread; 70‑module backend]