Skip to content
This repository was archived by the owner on Oct 27, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Check

on:
workflow_dispatch:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}

defaults:
run:
shell: bash

env:
ACTIONS_RUNNER_DEBUG: true

jobs:
check:
name: 'Lint, Typecheck, Build'
timeout-minutes: 3
runs-on: ['ubuntu-latest']
steps:
- name: '🔑 Checkout'
uses: actions/checkout@v5

- name: '🐰 Setup bun'
uses: oven-sh/setup-bun@main
with:
bun-version: 'latest'

- name: 'Install Dependencies'
run: yarn install --frozen-lockfile

- name: 'Expo Doctor'
run: |
yarn expo install --fix
bun x expo-doctor --verbose --yarn

- name: 'Lint & Format'
run: |
bun x @biomejs/biome check . --reporter='github'

- name: 'Typecheck'
run: bun tsc --project tsconfig.json --noEmit
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ credentials.json
*.key
*.csr
*.crl
*.pem
*.pem
.vscode
10 changes: 0 additions & 10 deletions .vscode/extensions.json

This file was deleted.

16 changes: 0 additions & 16 deletions .vscode/settings.json

This file was deleted.

185 changes: 184 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,186 @@
# [Porto](https://porto.sh) x React Native

TODO: Guide
A React Native application built with Expo v54 and [Porto](https://porto.sh) for Web3 authentication and passkey integration.

## Quick Start

### Prerequisites

- [Node.js](https://nodejs.org/) (LTS)
- [Yarn Classic](https://classic.yarnpkg.com/) (v1.22+)
- [Expo CLI](https://docs.expo.dev/get-started/installation/)
- For iOS development: Xcode and iOS Simulator
- For Android development: Android Studio and Android SDK

### Installation

1. **Clone and install dependencies:**

```bash
git clone <your-fork-url>
cd porto-rn
yarn install
```

2. **Install iOS dependencies (macOS only):**

```bash
cd ios && pod install && cd ..
```

## Development

### Running the App

- **Start development server:** `yarn dev` or `yarn expo start`
- **Start with dev client:** `yarn start`
- **Run on iOS:** `yarn ios`
- **Run on Android:** `yarn android`
- **Run on Web:** `yarn web`
- **Clear cache and restart:** `just clear`

### Available Commands (via [just](https://github.com/casey/just))

- `just fmt` - Format code with Biome
- `just test` - Run tests
- `just build` - Build the project
- `just doctor` - Fix dependencies and run expo doctor
- `just deploy-server` - Deploy server to Railway
- `just android-device` - Mirror Android device screen
- `just android-cert` - Generate Android debug certificate

## Configuration for Forks

When forking this project, update the following fields in `app.config.ts`:

### Required Changes

```typescript
export default (context: ConfigContext): ExpoConfig => ({
// Update these fields:
slug: 'your-app-slug', // Line 8
name: 'Your App Name', // Line 9
scheme: 'your-app-scheme', // Line 10

ios: {
appleTeamId: 'YOUR_TEAM_ID', // Line 16
bundleIdentifier: 'com.yourcompany.yourapp', // Line 17
associatedDomains: ['webcredentials:your-domain.com'], // Line 18
},
android: {
package: 'com.yourcompany.yourapp', // Line 21
},
extra: {
eas: {
projectId: 'your-expo-project-id', // Line 32
},
},
})
```

### Getting Your Values

1. **Apple Team ID**: Found in [Apple Developer Account](https://developer.apple.com/account) → Membership
2. **Bundle Identifier**: Use reverse domain notation (e.g., `com.yourcompany.yourapp`)
3. **EAS Project ID**: Create project at [expo.dev](https://expo.dev) and copy the project ID
4. **Associated Domain**: Your server domain where you'll host the app verification files

## Server Directory (`./server`)

The `./server` directory contains a [Bun](https://bun.sh) server that serves **App Verification Files** required for:

### Purpose

- **iOS Universal Links**: Verifies your app can handle deep links from your domain
- **Android App Links**: Verifies your app can handle Android deep links
- **Passkey/WebAuthn**: Enables passkey authentication across web and mobile

### Files Served

- `/.well-known/apple-app-site-association` - iOS app verification
- `/.well-known/assetlinks.json` - Android app verification

### Deploying the Server

I'm deploy to railway but you can deploy anywhere [./server/index.ts](./server/index.ts) can run.

```bash
just deploy-server
```

## Apple Associated Domains Setup

To enable Universal Links and passkey authentication:

### 1. Update App Configuration

In `app.config.ts`, set your domain:

```typescript
ios: {
associatedDomains: ['webcredentials:yourdomain.com'],
}
```

### 2. Configure Apple App Site Association

Update `server/apple-app-site-association`:

```json
{
"webcredentials": {
"apps": [
"YOUR_TEAM_ID.your.bundle.identifier"
]
}
}
```

### 3. Configure Android Asset Links

Update `server/assetlinks.json`:

```json
[
{
"relation": [
"delegate_permission/common.handle_all_urls",
"delegate_permission/common.get_login_creds"
],
"target": {
"namespace": "android_app",
"package_name": "your.android.package",
"sha256_cert_fingerprints": [
"YOUR_RELEASE_KEY_SHA256",
"YOUR_DEBUG_KEY_SHA256"
]
}
}
]
```

### 4. Get Android Certificate Fingerprints

```bash
# Generate debug certificate
just android-cert

# For release builds, get the SHA256 from your release keystore:
keytool -list -v -keystore your-release-key.keystore -alias your-alias
```

### 5. Deploy and Verify

1. Deploy your server with the updated files
2. Verify files are accessible:
- `https://yourdomain.com/.well-known/apple-app-site-association`
- `https://yourdomain.com/.well-known/assetlinks.json`
3. Test deep links and passkey functionality

## Useful Links

- [Expo Documentation](https://docs.expo.dev/)
- [Porto Documentation](https://context7.com/ithacaxyz/porto/llms.txt)
- [Apple Universal Links](https://developer.apple.com/ios/universal-links/)
- [Android App Links](https://developer.android.com/training/app-links)
- [WebAuthn/Passkeys Guide](https://webauthn.guide/)
4 changes: 0 additions & 4 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,11 @@ module.exports = (api) => {
'babel-preset-expo',
{
unstable_transformImportMeta: true,
jsxImportSource: 'nativewind',
reanimated: false,
},
],
'nativewind/babel',
],
plugins: [
'babel-plugin-transform-import-meta',
'react-native-worklets/plugin',
[
'module-resolver',
{
Expand Down
3 changes: 3 additions & 0 deletions bunfig.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ telemetry = false

[run]
bun = true

[install]
lockfile = { print = "yarn" }
File renamed without changes.
Loading