This is an example monorepo for create-t3-app and expo. If you want to create your own from scratch, make sure all of your react, react-dom, @types/react, and @types/react-dom are at the same version as the expo app in other apps.
This turborepo uses Yarn as a package manager. It includes the following packages/apps:
docs
: a Next.js appweb
: a create-t3-app appapi
: a shared library for all apps. Includes a prisma client, a trpc router, next-auth options, and expo-auth functionalitiesui-web
: a stub React component library shared by bothweb
anddocs
applicationseslint-config-custom
:eslint
configurations (includeseslint-config-next
andeslint-config-prettier
)tsconfig
:tsconfig.json
s used throughout the monorepoprisma
: aschema.prisma
file with optionaldb.sqlite
This example app uses a lot of logic from Next-auth to implement the same/similar features for mobile. To make this possible, no cookies are used for authentication. Here's how it works:
- From the Expo app, a request is made and the response is verified.
- The Expo verfied response, is sent to a tRCP endpoint and verfied once again by the
.expo-auth
router. - Once successful, a JWT token is generated, the user and account is updated accordingly, and the new JWT and user is sent to the Expo app.
This repository can be cloned from https://github.com/mrzachnugent/turbo-t3-expo.
git clone git@github.com:mrzachnugent/turbo-t3-expo.git
cd turbo-t3-expo
yarn
To build all apps and packages, run the following command in the root folder:
yarn run build
To develop all apps and packages, run the following command:
cd turbo-t3-expo
yarn run dev
Turborepo can use a technique known as Remote Caching to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can create one, then enter the following commands:
cd my-turborepo
npx turbo login
This will authenticate the Turborepo CLI with your Vercel account.
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo:
npx turbo link
Learn more about the power of Turborepo: