This project was bootstrapped with Better-T-Stack, a modern TypeScript stack combining Convex, Expo/React Native, Tailwind (Uniwind), Turborepo, and more. For architecture and deeper patterns, refer to the Better-T-Stack repo and docs.
To reproduce a similar starter, run:
bun create better-t-stack@latest my-app \ --frontend native-uniwind \ --backend convex \ --runtime none --api none --auth better-auth --database none --orm none --db-setup none \ --package-manager bun --no-git \ --web-deploy none --server-deploy none \ --install \ --addons turborepo biome \ --examples none
- TypeScript — static typing for safety and DX
- React Native (Expo) — SDK 55
- Tailwind (Uniwind) — Tailwind CSS v4 for React Native
- Hero UI Native — modern React Native UI library 🚧 Beta
- Convex — reactive backend-as-a-service
- Better Auth — auth primitives on Convex
- Biome — fast formatting and linting
- Turborepo — monorepo build system
duolife/
├─ apps/
│ └─ native/ # Expo App
└─ packages/
├─ backend/ # Convex backend
├─ config/ # Shared TypeScript config
└─ env/ # Environment variables
Update apps/native/app.json with your app identity:
{
"expo": {
"name": "Your App Name",
"slug": "yourapp",
"scheme": "yourapp",
"ios": {
"bundleIdentifier": "com.yourcompany.yourapp"
},
"android": {
"package": "com.yourcompany.yourapp"
}
}
}Deep-link backend configuration is handled later when you enable auth redirects.
Note: Keep
expo.schemeinapp.jsonaligned with the backendNATIVE_APP_URLvalue (set later) for OAuth redirects.
This starter includes multiple authentication methods using Convex + Better Auth:
-
Convex Account — required for all forms of authentication
-
Email & Password — requires Resend + custom domain setup
-
Google OAuth — requires Google Cloud Console project
-
Apple OAuth — requires Apple Developer account
⚠️ Note: Apple Auth cannot be tested in Expo Go. Use a Development Build with EAS.
-
Clone or fork this repo.
-
Install root dependencies:
bun install
-
Start dev (Turborepo scripts will spawn native + backend):
bun dev
In the native#dev terminal pane you should see Metro start successfully:
Metro waiting on ...You do not need to copy an Expo Go URL for backend env setup.
-
Configure Convex Backend In the @app/backend terminal pane, the Convex wizard will prompt:
What would you like to configure (use arrow keys) > create a new project choose an existing projecta. Choose create a new project.
b. Name it (anything).
c. Select cloud development.
A temporary error will appear while routes initialize. Check
packages/backend/.env.local— you should now seeCONVEX_DEPLOYMENTandCONVEX_URLpopulated.Stop the dev servers (Ctrl + C) now that Convex credentials exist.
-
Set Backend Environment Variables
cdintopackages/backend.Generate and set the authentication secret:
npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32)
Set your native app URL for deep linking when you configure OAuth redirects.
# Use the same scheme from apps/native/app.json (example: "myapp") npx convex env set NATIVE_APP_URL=myapp://
-
Set Frontend Environment Varibles
Create
apps/native/.env.development:In
packages/backend/.env.local, locateCONVEX_URL. It should look like:CONVEX_URL=https://xxxx-xxx-xxx.convex.cloudnow add to .env.development the following
# Copy from CONVEX_URL in packages/backend/.env.local EXPO_PUBLIC_CONVEX_URL=https://xxxx-xxx-xxx.convex.cloud # Same as above but with .site instead of .cloud EXPO_PUBLIC_CONVEX_SITE_URL=https://xxxx-xxx-xxx.convex.site
More information about
.cloudand.site- Find in Convex dashboard: Project → Settings → URL & deployment keys → Show development credentials
- The Deployment URL format:
https://xxxx-xxx-xxx.convex.cloud - For HTTP Actions, use the same prefix For HTTP Actions, replace .cloud with .site:
https://xxxx-xxx-xxx.convex.site
- Google OAuth
- Apple OAuth
- Email & Password
⚠️ IMPORTANT: The Convex server may take a short time to warm up on first run after any method above (index creation).
- Google Cloud Console Account + project
Create OAuth 2.0 Credential in Google
-
search google auth platform
-
press
Clients -
Create Client
-
Application Type
web -
name it
-
Add URI to Authorized redirect Uri's
# For development
https://xxxx-xxx-xxx.convex.site/api/auth/callback/google
# For production
https://your-prod-deployment.convex.site/api/auth/callback/google
Replace xxxx-xxx-xxx with your Convex deployment URL (use .site not .cloud)
- Save Credentials- you'll get a Client ID and Client Secret
cd packages/backend & for the newly generated secrets run
npx convex env set GOOGLE_CLIENT_SECRET <key>
npx convex env set GOOGLE_CLIENT_ID <key>
In packages/backend/convex/auth.ts, uncomment the Google env constants and provider block:
// const googleClientId = process.env.GOOGLE_CLIENT_ID || "";
// const googleClientSecret = process.env.GOOGLE_CLIENT_SECRET || "";
// socialProviders: {
// google: {
// clientId: googleClientId,
// clientSecret: googleClientSecret,
// },
// },Expo usage lives in:
apps/native/lib/oauth/useGoogleAuth.ts
apps/native/app/(root)/(auth)/landing.tsx
now done => bun dev from root => will take a moment for index creation if first run
- A Resend account & API key (for transactional emails)
- A verified domain in Resend (required for authentication emails)
a) Resend Setup (Domain + API Key)
⚠️ IMPORTANT: Authentication emails require a verified domain in Resend. You cannot use test mode with just an API key for auth flows. The sender email must match your verified domain.
First, verify your domain in Resend:
- Go to Resend Dashboard → Domains
- Click Add Domain and add your domain (e.g.,
yourdomain.com) - Add the required DNS records
- Wait for verification (usually a few minutes)
Then, create an API key:
-
Go to Dashboard → API Keys → Create
- Name: any
- Permissions: Full access
- Domain: select your verified domain
-
Set it in Convex:
cd into
packages/backendnpx convex env set RESEND_API_KEY=... -
Finally, update the sender email:
npx convex env set RESEND_AUTH_EMAIL=auth@yourdomain.comIn
packages/backend/convex/auth.ts, uncommentsendResetPasswordin theemailAndPasswordblock if you want reset emails:
// emailAndPassword: {
// enabled: true,
// requireEmailVerification: false,
// sendResetPassword: async ({ user, url }) => {
// await sendResetPassword(requireActionCtx(ctx), {
// to: user.email,
// url,
// });
// },
// },now done => bun dev from root => will take a moment for index creation if first run
If you want Apple Sign-In with Better Auth, see: Better Auth Apple Docs
- A Dev Build use expo EAS
- A Apple Developer Account
create a EAS Build it should ask you to provision ... this and that and to setup to your apple account. Then Once this is up. you go to the following
on successful EAS Build you should now see in Apple Developer > Account > Identifiers > your app with the bundle ID from app.json (e.g., com.example.myapp) > press on it > Sign in With Apple > Enable.
In packages/backend/convex/auth.ts, uncomment the Apple env constant and provider block:
set the name of com from identifiers to the appBundleIdentifier
cd packages/backend & for the newly generated secrets run
npx convex env set APPLE_APP_BUNDLE_IDENTIFIER <key>
// const appleBundleId = process.env.APPLE_APP_BUNDLE_IDENTIFIER || "";
// socialProviders: {
// apple: {
// clientId: "", // keep empty for mobile-only setup
// clientSecret: "", // keep empty for mobile-only setup
// appBundleIdentifier: appleBundleId,
// },
// },Expo usage lives in:
apps/native/lib/oauth/useAppleAuth.ts
now done => bun dev from root => will take a moment for index creation if first run
MIT