πŸ‘¨β€πŸ’» Development

πŸ‘¨β€πŸ’» 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=

Configure Wrangler.toml

Wrangler is the official CLI tool for Cloudflare Workers.

Replace the account_id and database_id with your own values.

  1. Go to Cloudflare (opens in a new tab) and create an account.
  2. Go to "Workers & Pages Overview" and create a new project.
  3. Configure GitHub integration.
  4. 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
  5. 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

  1. Go in your Expo settings (opens in a new tab) to create a new access token.

  2. Add the EXPO_TOKEN secret to your repository with the token that you retrieved from Expo to allow GitHub Actions to publish your app.

  3. Create a new project in the Expo projects (opens in a new tab)

  4. Add the correct projectId to your apps/expo/app.json. Update the slug field to match your project name. Also update the owner field with your Expo username.

  5. Update projectId, slug and owner fallback field inside of apps/expo/app.config.ts.

  6. Setup EAS credentials for your Android and IOS apps by running eas credentials in your terminal. Setup the correct android.package and ios.bundleIdentifier in apps/expo/app.json.