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:
bash 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
convexpo/
├─ 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:
Google OAuth — requires Google Cloud Console project
Apple OAuth — requires Apple Developer account
Clone or fork this repo.
Install root dependencies:
bash
bun install
bash
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.
``` What would you like to configure (use arrow keys)
create a new project choose an existing project ```
a. 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 see `CONVEX_DEPLOYMENT` and `CONVEX_URL` populated.
**Stop the dev servers** (Ctrl + C) now that Convex credentials exist.
Set Backend Environment Variables
cd into packages/backend.
Generate and set the authentication secret:
bash
npx convex env set BETTER_AUTH_SECRET=$(openssl rand -base64 32)
Set your native app URL for deep linking when you configure OAuth redirects.
```bash
npx convex env set NATIVE_APP_URL=myapp:// ```
Set Frontend Environment Varibles
Create apps/native/.env.development:
In packages/backend/.env.local, locate CONVEX_URL. It should look like:
ini
CONVEX_URL=https://xxxx-xxx-xxx.convex.cloud
now add to .env.development the following
```ini
EXPO_PUBLIC_CONVEX_URL=https://xxxx-xxx-xxx.convex.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
⚠️ IMPORTANT: The Convex server may take a short time to warm up on first run after any method above (index creation).
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)
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 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:
yourdomain.com)Then, create an API key:
Go to Dashboard → API Keys → Create
Name: any
Set it in Convex:
cd into packages/backend
bash
npx convex env set RESEND_API_KEY=...
bash
npx convex env set RESEND_AUTH_EMAIL=auth@yourdomain.com
In packages/backend/convex/auth.ts, uncomment sendResetPassword in the emailAndPassword block 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
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
$ claude mcp add convexpo \
-- python -m otcore.mcp_server <graph>