π¨βπ» Setting up Local Development
API (Dev)
Create a file called .dev.vars
in /packages/api
and add the following environment variables.
The necessary secrets are:
# For preventing CORS errors
APP_URL=
# For Supabase @link https://supabase.com
JWT_VERIFICATION_KEY=
APP_URL
is the URL of your Next.js app. For example,http://localhost:3000
.- Get your
JWT_VERIFICATION_KEY
from Supabase (opens in a new tab).
Configure Wrangler.toml
For more info, see the official Cloudflare Wrangler docs (opens in a new tab).
Wrangler is the official CLI tool for Cloudflare Workers.
Replace the account_id
and database_id
with your own values.
- Go to Cloudflare (opens in a new tab) and create an account.
- Go to "Workers & Pages Overview" and create a new project.
- Configure GitHub integration.
- Configure D1 database bindings with your project.
- do not select the '--experimental-backend' option while in Alpha
- currently this option does not support backups & migrate command fails
- Enter your project details in
wrangler.toml
.
API Wranger.toml
name = "t4-api"
compatibility_date = "2023-01-01"
send_metrics = false
account_id = "your_account_id"
[[ d1_databases ]]
binding = "DB"
database_name = "production"
database_id = "your_db_id"
Next.js + Expo (Dev)
Environment Variables
Rename .env.example
to .env.local
and add your own values.
# API
NEXT_PUBLIC_API_URL=http://localhost:8787/
# Authentication
# @link https://supabase.com/dashboard for your Supabase API keys
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
NEXT_PUBLIC_SUPPORT_EMAIL=
Expo
-
Go in your Expo settings (opens in a new tab) to create a new access token.
-
Add the
EXPO_TOKEN
secret to your repository with the token that you retrieved from Expo to allow GitHub Actions to publish your app. -
Create a new project in the Expo projects (opens in a new tab)
-
Add the correct
projectId
to yourapps/expo/app.json
. Update theslug
field to match your project name. Also update theowner
field with your Expo username. -
Update
projectId
,slug
andowner
fallback field inside ofapps/expo/app.config.ts
. -
Setup EAS credentials for your Android and IOS apps by running
eas credentials
in your terminal. Setup the correctandroid.package
andios.bundleIdentifier
inapps/expo/app.json
.