diff --git a/.cursor/rules/git-analysis.mdc b/.cursor/rules/git-analysis.mdc
new file mode 100644
index 00000000..a49080c1
--- /dev/null
+++ b/.cursor/rules/git-analysis.mdc
@@ -0,0 +1,57 @@
+---
+description: "Git information gathering for PR creation"
+---
+
+# Git Analysis for PR Creation
+
+## Required Commands
+
+Execute these commands in sequence:
+
+```bash
+git status --porcelain # Check staged/unstaged files
+git branch --show-current # Get current branch name
+git log --oneline -10 --no-merges # Recent commit messages
+git remote get-url origin # Extract owner/repo
+git diff --cached --name-status # Staged changes summary
+```
+
+## Data Extraction
+
+### Repository Info
+
+```bash
+# From: git remote get-url origin
+# Extract: github.com/owner/repo.git -> owner="owner", repo="repo"
+```
+
+### Change Analysis
+
+```bash
+# From: git diff --cached --name-status
+# A = Added, M = Modified, D = Deleted, R = Renamed
+# Example: "M src/services/auth_service.py" -> Modified auth service
+```
+
+### Commit Messages
+
+```bash
+# From: git log --oneline -10 --no-merges
+# Extract patterns: "feat:", "fix:", "refactor:", "docs:"
+# Example: "feat: add JWT authentication" -> Feature addition
+```
+
+## Output Format
+
+Return structured data:
+
+```json
+{
+ "owner": "username",
+ "repo": "repository-name",
+ "head_branch": "feature/auth",
+ "changes": ["M src/services/auth_service.py", "A tests/test_auth.py"],
+ "commits": ["feat: add JWT authentication", "fix: handle edge cases"],
+ "change_type": "feature"
+}
+```
diff --git a/.cursor/rules/pr-creation.mdc b/.cursor/rules/pr-creation.mdc
new file mode 100644
index 00000000..79de8fd4
--- /dev/null
+++ b/.cursor/rules/pr-creation.mdc
@@ -0,0 +1,43 @@
+---
+description: "Create GitHub PR using template and MCP tools"
+---
+
+# PR Creation Workflow
+
+When user requests PR creation, execute this workflow:
+
+## Core Process
+
+1. **Gather git information** (see [git-analysis](mdc:.cursor/rules/git-analysis.mdc))
+2. **Generate PR content** (see [pr-template-generator](mdc:.cursor/rules/pr-template-generator.mdc))
+3. **Create PR via GitHub MCP**
+
+## GitHub MCP Call
+
+Always use `mcp_GitHub_create_pull_request` with:
+
+```json
+{
+ "owner": "extracted-from-git-remote",
+ "repo": "extracted-from-git-remote",
+ "title": "feat: add user authentication system",
+ "head": "feature/auth",
+ "base": "main",
+ "body": "# Summary\n\n[Generated from template]...",
+ "draft": false
+}
+```
+
+## Repository Requirements
+
+**Always include in PR body:**
+
+- Mongo pipeline usage confirmation
+- Service logic implementation confirmation
+- Reference to [PULL_REQUEST_TEMPLATE.md](mdc:.github/PULL_REQUEST_TEMPLATE.md)
+
+## Error Handling
+
+- **No changes**: "Please stage/commit changes first"
+- **GitHub API failure**: Show specific error + retry guidance
+- **Not in git repo**: Guide to correct directory
diff --git a/.cursor/rules/pr-template-generator.mdc b/.cursor/rules/pr-template-generator.mdc
new file mode 100644
index 00000000..217f5989
--- /dev/null
+++ b/.cursor/rules/pr-template-generator.mdc
@@ -0,0 +1,82 @@
+---
+description: "Generate PR content using template structure"
+---
+
+# PR Template Content Generation
+
+Use [PULL_REQUEST_TEMPLATE.md](mdc:.github/PULL_REQUEST_TEMPLATE.md) structure with git analysis data.
+
+## Content Mapping
+
+### Summary Section
+
+```markdown
+# Summary
+
+Brief description extracted from commit messages and change analysis.
+Example: "Implements JWT-based authentication system with token refresh capability."
+```
+
+### Type of Change
+
+Map git changes to template checkboxes:
+
+- `feat:` commits โ โจ New feature
+- `fix:` commits โ ๐ Bug fix
+- `refactor:` commits โ โป๏ธ Refactoring
+- `docs:` commits โ ๐ Documentation
+- Performance-related โ โก Performance improvements
+- Test files modified โ ๐งช Tests
+
+### Changes Made
+
+Transform git diff output:
+
+```markdown
+- [ ] Added JWT authentication service
+- [ ] Modified user login endpoint
+- [ ] Fixed token validation logic
+```
+
+### Motivation and Context
+
+Extract from commit messages:
+
+```markdown
+**Why is this change required?**
+Based on commit: "feat: add JWT authentication for better security"
+
+**What problem does it solve?**
+Replaces session-based auth with stateless JWT tokens.
+```
+
+## Repository-Specific Additions
+
+Always append:
+
+```markdown
+## Checklist
+
+- [ ] I have used mongo pipelines instead of loops where applicable (per repo guidelines)
+- [ ] I have defined logic in appropriate service files
+```
+
+## Example Output
+
+```markdown
+# Summary
+
+Implements JWT-based authentication system with token refresh capability.
+
+## Type of Change
+
+- [x] โจ New feature (non-breaking change which adds functionality)
+
+## Changes Made
+
+- [x] Added JWT authentication service
+- [x] Modified user login endpoint
+- [x] Added token refresh mechanism
+
+[... rest of template sections filled ...]
+```
diff --git a/.env.template b/.env.template
index e97d7f67..1a46ad99 100644
--- a/.env.template
+++ b/.env.template
@@ -1,2 +1,3 @@
EXPO_PUBLIC_IS_DEV=true
EXPO_PUBLIC_API_URL="https://mnt-api-880207287631.europe-west3.run.app"
+EXPO_PUBLIC_DISABLE_FIREBASE=true
\ No newline at end of file
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 5f84abef..724a4ae4 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,2 +1 @@
-github: [nikashelia]
-custom: []
+github: [nikashelia, nikasamadalashvili]
diff --git a/.github/workflows/development-local-build.yml b/.github/workflows/development-local-build.yml
new file mode 100644
index 00000000..eb0818c7
--- /dev/null
+++ b/.github/workflows/development-local-build.yml
@@ -0,0 +1,110 @@
+name: Development Local Build
+
+permissions:
+ contents: write
+
+on:
+ workflow_dispatch:
+ inputs:
+ platform:
+ type: choice
+ description: 'Platform to build'
+ default: 'all'
+ options:
+ - android
+ - ios
+ - all
+
+env:
+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+ NODE_OPTIONS: --openssl-legacy-provider
+
+jobs:
+ build:
+ strategy:
+ matrix:
+ platform: [android]
+ include:
+ - platform: ios
+ runs-on: macos-latest
+ runs-on: ${{ matrix.platform == 'ios' && 'macos-latest' || 'ubuntu-latest' }}
+ steps:
+ - name: ๐ Checkout repository
+ uses: actions/checkout@v4
+
+ - name: ๐ Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '22'
+ cache: 'npm'
+
+ - name: ๐ฆ Install dependencies
+ run: |
+ npm ci
+ npm i -g eas-cli@latest
+
+ - name: ๐ง Show EAS CLI version
+ run: eas --version
+
+ - name: ๐ Prepare Firebase config files from secrets
+ run: |
+ printf "%s" "$GOOGLE_SERVICES_JSON" > google-services.json
+ printf "%s" "$GOOGLESERVICE_INFO_DEV_PLIST" > GoogleService-Info.plist
+ env:
+ GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
+ GOOGLESERVICE_INFO_DEV_PLIST: ${{ secrets.GOOGLESERVICE_INFO_DEV_PLIST }}
+
+ - name: โ Verify iOS Firebase plist exists
+ if: matrix.platform == 'ios'
+ run: |
+ if [ ! -s GoogleService-Info.plist ]; then
+ echo "GoogleService-Info.plist is missing or empty. Ensure GOOGLESERVICE_INFO_DEV_PLIST secret is set." >&2
+ exit 1
+ fi
+
+ - name: ๐ฑ Build Android (development-local APK)
+ if: matrix.platform == 'android'
+ run: |
+ export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
+ eas build --platform android --profile development-local --non-interactive --local --output ./app-development-local.apk
+ env:
+ NODE_ENV: development
+
+ - name: ๐ Build iOS (development-local dev client)
+ if: matrix.platform == 'ios'
+ run: |
+ export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
+ eas build --platform ios --profile development-local --non-interactive --local --output ./app-development-local.ipa
+ env:
+ NODE_ENV: development
+
+ - name: ๐ท๏ธ Generate build information
+ id: build-info
+ run: |
+ if ! command -v jq &> /dev/null; then
+ sudo apt-get update && sudo apt-get install -y jq
+ fi
+ VERSION=$(npx expo config --json | jq -r '.expo.version')
+ BUILD_NUMBER=$(date +%Y%m%d%H%M)
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
+ echo "build_number=$BUILD_NUMBER" >> $GITHUB_OUTPUT
+ # Generate changelog from commit messages since last tag
+ if git describe --tags --abbrev=0 > /dev/null 2>&1; then
+ LAST_TAG=$(git describe --tags --abbrev=0)
+ git log $LAST_TAG..HEAD --pretty=format:"- %s" > changelog.md
+ else
+ git log --pretty=format:"- %s" -n 20 > changelog.md
+ fi
+
+ - name: ๐ Create GitHub Release
+ uses: softprops/action-gh-release@v1
+ with:
+ draft: true
+ name: 'Development Build v${{ steps.build-info.outputs.version }}-${{ steps.build-info.outputs.build_number }}'
+ tag_name: 'dev-v${{ steps.build-info.outputs.version }}-${{ steps.build-info.outputs.build_number }}'
+ files: |
+ ./app-development-local.apk
+ ./app-development-local.ipa
+ body_path: changelog.md
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/ota-update.yml b/.github/workflows/ota-update.yml
deleted file mode 100644
index 75322679..00000000
--- a/.github/workflows/ota-update.yml
+++ /dev/null
@@ -1,95 +0,0 @@
-name: EAS OTA Update
-
-on:
- push:
- branches: [dev, preview, main]
-
-jobs:
- detect-native-change:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Detect native-impacting changes
- id: detect
- run: |
- set -e
- base_ref=$(git rev-parse HEAD~1)
- echo "Comparing against $base_ref"
- CHANGED=$(git diff --name-only "$base_ref" HEAD)
- echo "$CHANGED" | sed 's/^/changed: /'
- NATIVE_MATCHES=$(echo "$CHANGED" | grep -E '^(package.json|yarn.lock|pnpm-lock.yaml|package-lock.json|android/|ios/|app\.plugin\.(js|ts)|app\.config\.(js|ts|json)|eas\.json|plugins?/|patches/|babel\.config\.(js|ts)|metro\.config\.(js|ts))' || true)
- if [ -n "$NATIVE_MATCHES" ]; then
- echo "native_changed=true" >> $GITHUB_OUTPUT
- echo "Native-impacting changes detected:" && echo "$NATIVE_MATCHES"
- else
- echo "native_changed=false" >> $GITHUB_OUTPUT
- echo "No native-impacting changes detected."
- fi
- update:
- needs: detect-native-change
- if: needs.detect-native-change.outputs.native_changed == 'false'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 20
- - name: Install deps
- run: |
- npm ci
- npm i -g eas-cli@latest
- - name: Determine channel
- id: ch
- run: |
- branch="${GITHUB_REF_NAME}"
- if [ "$branch" = "dev" ]; then echo "channel=development" >> $GITHUB_OUTPUT; fi
- if [ "$branch" = "preview" ]; then echo "channel=preview" >> $GITHUB_OUTPUT; fi
- if [ "$branch" = "main" ]; then echo "channel=production" >> $GITHUB_OUTPUT; fi
- - name: EAS update
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- eas update --channel ${{ steps.ch.outputs.channel }} --non-interactive --message "Auto OTA: ${GITHUB_SHA::7} (${GITHUB_REF_NAME})"
-
- notify-skip:
- needs: detect-native-change
- if: needs.detect-native-change.outputs.native_changed == 'true'
- runs-on: ubuntu-latest
- steps:
- - name: Skip notice
- run: echo "Native-impacting changes detected; skipping OTA. Run a full EAS build instead."
-
- build-dev-android:
- needs: detect-native-change
- if: needs.detect-native-change.outputs.native_changed == 'true' && github.ref == 'refs/heads/dev'
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 20
- - name: Install deps and EAS
- run: |
- npm ci
- npm i -g eas-cli@latest jq
- - name: Build Android (development-local)
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- eas build --profile development-local --platform android --non-interactive --wait --json > build.json
- echo "Build JSON:" && cat build.json
- - name: Download APK
- id: dl
- run: |
- url=$(jq -r '.[0].artifacts.buildUrl' build.json)
- name="app-dev-${GITHUB_SHA::7}.apk"
- echo "url=$url" >> $GITHUB_OUTPUT
- echo "name=$name" >> $GITHUB_OUTPUT
- curl -L "$url" -o "$name"
- - name: Upload artifact
- uses: actions/upload-artifact@v4
- with:
- name: ${{ steps.dl.outputs.name }}
- path: ${{ steps.dl.outputs.name }}
diff --git a/.github/workflows/production-deploy.yml b/.github/workflows/production-deploy.yml
new file mode 100644
index 00000000..355bcee5
--- /dev/null
+++ b/.github/workflows/production-deploy.yml
@@ -0,0 +1,131 @@
+name: Production Deploy
+
+permissions:
+ contents: read
+
+on:
+ workflow_dispatch:
+ inputs:
+ platform:
+ type: choice
+ description: 'Platform to deploy'
+ default: 'all'
+ options:
+ - android
+ - ios
+ - all
+ mode:
+ type: choice
+ description: 'Mode: build_and_submit or remote_update'
+ default: 'build_and_submit'
+ options:
+ - build_and_submit
+ - remote_update
+ channel:
+ type: string
+ description: 'EAS update channel (used when mode=remote_update)'
+ default: 'production'
+
+env:
+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+ EXPO_APPLE_ID: ${{ secrets.EXPO_APPLE_ID }}
+ EXPO_APPLE_PASSWORD: ${{ secrets.EXPO_APPLE_PASSWORD }}
+ EXPO_TEAM_ID: ${{ secrets.EXPO_TEAM_ID }}
+ GOOGLE_PLAY_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
+ GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
+ GOOGLESERVICE_INFO_PROD_PLIST: ${{ secrets.GOOGLESERVICE_INFO_PROD_PLIST }}
+ NODE_OPTIONS: --openssl-legacy-provider
+
+jobs:
+ deploy:
+ runs-on: ubuntu-latest
+ steps:
+ - name: ๐ Checkout repository
+ uses: actions/checkout@v4
+
+ - name: ๐ Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: '22'
+ cache: 'npm'
+
+ - name: ๐ฆ Install dependencies
+ run: |
+ npm ci
+ npm i -g eas-cli@latest
+
+ - name: ๐ง Show EAS CLI version
+ run: eas --version
+
+ - name: ๐ EAS Update (remote update)
+ if: github.event.inputs.mode == 'remote_update'
+ run: |
+ export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
+ export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
+ export EXPO_PUBLIC_SENTRY_DSN=${{ secrets.EXPO_PUBLIC_SENTRY_DSN }}
+ export EXPO_PUBLIC_SUPABASE_URL=${{ secrets.EXPO_PUBLIC_SUPABASE_URL }}
+ export EXPO_PUBLIC_SUPABASE_ANON_KEY=${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }}
+ export EXPO_PUBLIC_API_URL=${{ secrets.EXPO_PUBLIC_API_URL }}
+ eas update --channel ${{ github.event.inputs.channel }} --non-interactive --message "Remote update: ${GITHUB_SHA::7}"
+ env:
+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+
+ - name: ๐ Prepare Firebase config files from secrets
+ run: |
+ printf "%s" "$GOOGLE_SERVICES_JSON" > google-services.json
+ printf "%s" "$GOOGLESERVICE_INFO_PROD_PLIST" > GoogleService-Info.plist
+ env:
+ GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
+ GOOGLESERVICE_INFO_PROD_PLIST: ${{ secrets.GOOGLESERVICE_INFO_PROD_PLIST }}
+
+ - name: โ Verify iOS Firebase plist exists
+ if: matrix.platform == 'ios'
+ run: |
+ if [ ! -s GoogleService-Info.plist ]; then
+ echo "GoogleService-Info.plist is missing or empty. Ensure GOOGLESERVICE_INFO_PROD_PLIST secret is set." >&2
+ exit 1
+ fi
+
+ - name: ๐ฑ Build Android (Production AAB)
+ if: (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android') && github.event.inputs.mode != 'remote_update'
+ run: |
+ export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
+ export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
+ export EXPO_PUBLIC_SENTRY_DSN=${{ secrets.EXPO_PUBLIC_SENTRY_DSN }}
+ export EXPO_PUBLIC_SUPABASE_URL=${{ secrets.EXPO_PUBLIC_SUPABASE_URL }}
+ export EXPO_PUBLIC_SUPABASE_ANON_KEY=${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }}
+ export EXPO_PUBLIC_API_URL=${{ secrets.EXPO_PUBLIC_API_URL }}
+ eas build --platform android --profile production --non-interactive --local --output ./app-production.apk
+ env:
+ NODE_ENV: production
+
+ - name: ๐ Submit Android to Play Store
+ if: (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android') && github.event.inputs.mode != 'remote_update'
+ run: |
+ eas submit -p android --latest --non-interactive --path ./app-production.apk
+ env:
+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+ GOOGLE_PLAY_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
+
+ - name: ๐ฑ Build iOS (Production IPA)
+ if: (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios') && github.event.inputs.mode != 'remote_update'
+ run: |
+ export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
+ export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
+ export EXPO_PUBLIC_SENTRY_DSN=${{ secrets.EXPO_PUBLIC_SENTRY_DSN }}
+ export EXPO_PUBLIC_SUPABASE_URL=${{ secrets.EXPO_PUBLIC_SUPABASE_URL }}
+ export EXPO_PUBLIC_SUPABASE_ANON_KEY=${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }}
+ export EXPO_PUBLIC_API_URL=${{ secrets.EXPO_PUBLIC_API_URL }}
+ eas build --platform ios --profile production --non-interactive --local --output ./app-production.ipa
+ env:
+ NODE_ENV: production
+
+ - name: ๐ Submit iOS to App Store
+ if: (github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios') && github.event.inputs.mode != 'remote_update'
+ run: |
+ eas submit -p ios --latest --non-interactive --path ./app-production.ipa
+ env:
+ EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
+ EXPO_APPLE_ID: ${{ secrets.EXPO_APPLE_ID }}
+ EXPO_APPLE_PASSWORD: ${{ secrets.EXPO_APPLE_PASSWORD }}
+ EXPO_TEAM_ID: ${{ secrets.EXPO_TEAM_ID }}
diff --git a/.github/workflows/react-native-ci.yml b/.github/workflows/react-native-ci.yml
index 75238d27..c3130ac3 100644
--- a/.github/workflows/react-native-ci.yml
+++ b/.github/workflows/react-native-ci.yml
@@ -1,21 +1,18 @@
name: React Native CI/CD
+permissions:
+ contents: write
+
on:
push:
branches:
- dev
- - preview
- - main
- 'release/**'
- 'hotfix/**'
paths-ignore:
- '**.md'
- 'LICENSE'
- 'docs/**'
- pull_request:
- branches:
- - main
- - dev
workflow_dispatch:
inputs:
buildType:
@@ -44,6 +41,8 @@ env:
EXPO_APPLE_PASSWORD: ${{ secrets.EXPO_APPLE_PASSWORD }}
EXPO_TEAM_ID: ${{ secrets.EXPO_TEAM_ID }}
GOOGLE_PLAY_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
+ GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
+ GOOGLESERVICE_INFO_PROD_PLIST: ${{ secrets.GOOGLESERVICE_INFO_PROD_PLIST }}
NODE_OPTIONS: --openssl-legacy-provider
jobs:
@@ -61,10 +60,18 @@ jobs:
- name: ๐ Checkout repository
uses: actions/checkout@v4
+ - name: ๐ Prepare Firebase config files from secrets
+ run: |
+ printf "%s" "$GOOGLE_SERVICES_JSON" > google-services.json
+ printf "%s" "$GOOGLESERVICE_INFO_PROD_PLIST" > GoogleService-Info.plist
+ env:
+ GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
+ GOOGLESERVICE_INFO_PROD_PLIST: ${{ secrets.GOOGLESERVICE_INFO_PROD_PLIST }}
+
- name: ๐ Setup Node.js
uses: actions/setup-node@v4
with:
- node-version: '20'
+ node-version: '22'
cache: 'npm'
- name: ๐ฆ Install dependencies
@@ -73,9 +80,6 @@ jobs:
- name: ๐งช Run TypeScript check
run: npm run typecheck
- # - name: ๐งน Run ESLint
- # run: npm run lint
-
- name: ๐จ Run Prettier check
run: npm run format:check
@@ -85,24 +89,31 @@ jobs:
startsWith(github.ref, 'refs/heads/release/') ||
startsWith(github.ref, 'refs/heads/hotfix/') ||
github.ref == 'refs/heads/dev' ||
- github.ref == 'refs/heads/preview' ||
- github.ref == 'refs/heads/main' ||
+ github.ref == 'refs/heads/main'
)) || github.event_name == 'workflow_dispatch'
strategy:
matrix:
platform: [android]
include:
- platform: ios
- runs-on: macos-latest
- runs-on: ${{ matrix.platform == 'ios' && 'macos-latest' || 'ubuntu-latest' }}
+ runs-on: macos-15
+ runs-on: ${{ matrix.platform == 'ios' && 'macos-15' || 'ubuntu-latest' }}
steps:
- name: ๐ Checkout repository
uses: actions/checkout@v4
+ - name: ๐ Prepare Firebase config files from secrets
+ run: |
+ printf "%s" "$GOOGLE_SERVICES_JSON" > google-services.json
+ printf "%s" "$GOOGLESERVICE_INFO_PROD_PLIST" > GoogleService-Info.plist
+ env:
+ GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
+ GOOGLESERVICE_INFO_PROD_PLIST: ${{ secrets.GOOGLESERVICE_INFO_PROD_PLIST }}
+
- name: ๐ Setup Node.js
uses: actions/setup-node@v4
with:
- node-version: '20'
+ node-version: '22'
cache: 'npm'
- name: ๐ฆ Install dependencies
@@ -110,25 +121,6 @@ jobs:
npm ci
npm i -g eas-cli@latest
- - name: ๐ Bump version and sync EAS (preview only)
- if: github.event_name == 'push' && github.ref == 'refs/heads/preview'
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- run: |
- # Bump local version (patch) without tagging to keep repo/version in sync
- npm version patch --no-git-tag-version
- VERSION=$(node -p "require('./package.json').version")
- echo "Bumped version to $VERSION"
- git config user.name "github-actions[bot]"
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- git add package.json package-lock.json || true
- git commit -m "chore(release): $VERSION [skip ci]" || echo "No version change to commit"
- git push || echo "Skip push (no changes)"
- # Sync remote app version (EAS) so builds use this version
- eas project:version:set "$VERSION" --non-interactive
- eas project:version:get
-
- name: ๐ฑ Setup EAS build cache
uses: actions/cache@v3
with:
@@ -150,107 +142,38 @@ jobs:
sudo apt-get update && sudo apt-get install -y jq
fi
- # Fix the main entry in package.json
- if [ -f ./package.json ]; then
- # Create a backup
- cp package.json package.json.bak
- # Update the package.json
- jq '.main = "node_modules/expo/AppEntry.js"' package.json > package.json.tmp && mv package.json.tmp package.json
- echo "Updated package.json main entry"
- cat package.json | grep "main"
- else
- echo "package.json not found"
+ - name: โ Verify iOS Firebase plist exists
+ if: matrix.platform == 'ios'
+ run: |
+ if [ ! -s GoogleService-Info.plist ]; then
+ echo "GoogleService-Info.plist is missing or empty. Ensure GOOGLESERVICE_INFO_PROD_PLIST secret is set." >&2
exit 1
fi
- - name: ๐ฑ Build Development APK
- if:
- github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'dev' || (
- github.event_name == 'push' && (
- github.ref == 'refs/heads/dev'
- ) && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
- )
- run: |
- # Build with increased memory limit
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform android --profile development --local --non-interactive --output=./app-dev.apk
- env:
- NODE_ENV: development
-
- name: ๐ฑ Build Preview APK
- if: github.event_name == 'push' && (
- github.ref == 'refs/heads/preview' ||
- startsWith(github.ref, 'refs/heads/release/') ||
- startsWith(github.ref, 'refs/heads/hotfix/')
- ) && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
- run: |
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform android --profile preview --local --non-interactive --output=./app-preview.apk
- env:
- NODE_ENV: production
-
- - name: ๐ฑ Build Production APK
- if: github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'prod-apk' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android'))
- run: |
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform android --profile production-apk --local --non-interactive --output=./app-prod.apk
- env:
- NODE_ENV: production
-
- - name: ๐ฑ Build Production AAB
- if: github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'prod-aab' || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android'))
+ if: github.event_name == 'push' && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
run: |
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform android --profile production --local --non-interactive --output=./app-prod.aab
+ export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
+ export EXPO_PUBLIC_SENTRY_DSN=${{ secrets.EXPO_PUBLIC_SENTRY_DSN }}
+ export EXPO_PUBLIC_SUPABASE_URL=${{ secrets.EXPO_PUBLIC_SUPABASE_URL }}
+ export EXPO_PUBLIC_SUPABASE_ANON_KEY=${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }}
+ export EXPO_PUBLIC_API_URL=${{ secrets.EXPO_PUBLIC_API_URL }}
+ eas build --platform android --profile preview --local --non-interactive --output ./app-preview.apk
env:
NODE_ENV: production
- - name: ๐ฑ Build iOS Development
- if: ((github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'ios-dev') && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')) || (github.event_name == 'push' && (github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/develop') && matrix.platform == 'ios')
- run: |
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform ios --profile development --local --non-interactive --output=./app-ios-dev.app
- env:
- NODE_ENV: development
-
- name: ๐ฑ Build iOS Preview
- if: github.event_name == 'push' && (
- github.ref == 'refs/heads/preview' ||
- startsWith(github.ref, 'refs/heads/release/') ||
- startsWith(github.ref, 'refs/heads/hotfix/')
- ) && matrix.platform == 'ios'
+ if: github.event_name == 'push' && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')
run: |
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform ios --profile preview --local --non-interactive --output=./app-ios-preview.ipa
+ export SENTRY_AUTH_TOKEN=${{ secrets.SENTRY_AUTH_TOKEN }}
+ export EXPO_PUBLIC_SENTRY_DSN=${{ secrets.EXPO_PUBLIC_SENTRY_DSN }}
+ export EXPO_PUBLIC_SUPABASE_URL=${{ secrets.EXPO_PUBLIC_SUPABASE_URL }}
+ export EXPO_PUBLIC_SUPABASE_ANON_KEY=${{ secrets.EXPO_PUBLIC_SUPABASE_ANON_KEY }}
+ export EXPO_PUBLIC_API_URL=${{ secrets.EXPO_PUBLIC_API_URL }}
+ eas build --platform ios --profile preview --local --non-interactive --output ./app-preview.ipa
env:
NODE_ENV: production
- - name: ๐ฑ Build iOS Production
- if: ((github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'ios-prod') && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')) || (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') && matrix.platform == 'ios')
- run: |
- export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"
- eas build --platform ios --profile production --local --non-interactive --output=./app-ios-prod.ipa
- env:
- NODE_ENV: production
-
- - name: ๐ Submit to Play Store
- if: (github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'publish-stores') && (matrix.platform == 'android' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'android')
- run: |
- eas submit -p android --path ./app-prod.aab --non-interactive
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- GOOGLE_PLAY_SERVICE_ACCOUNT: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT }}
-
- - name: ๐ Submit to App Store
- if: (github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'publish-stores') && (matrix.platform == 'ios' || github.event.inputs.platform == 'all' || github.event.inputs.platform == 'ios')
- run: |
- eas submit -p ios --path ./app-ios-prod.ipa --non-interactive
- env:
- EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
- EXPO_APPLE_ID: ${{ secrets.EXPO_APPLE_ID }}
- EXPO_APPLE_PASSWORD: ${{ secrets.EXPO_APPLE_PASSWORD }}
- EXPO_TEAM_ID: ${{ secrets.EXPO_TEAM_ID }}
-
- name: ๐ท๏ธ Generate build information
id: build-info
run: |
@@ -277,25 +200,33 @@ jobs:
name: 'Release v${{ steps.build-info.outputs.version }}-${{ steps.build-info.outputs.build_number }}'
tag_name: 'v${{ steps.build-info.outputs.version }}-${{ steps.build-info.outputs.build_number }}'
files: |
- ./app-dev.apk
- ./app-prod.apk
- ./app-prod.aab
- ./app-ios-dev.app
- ./app-ios-prod.ipa
+ ./app-preview.apk
+ ./app-preview.ipa
body_path: changelog.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- - name: ๐ฆ Upload build artifacts to GitHub
+ - name: ๐ฆ Upload build artifacts to GitHub (per-platform)
+ if: ${{ !startsWith(github.ref, 'refs/heads/hotfix/') }}
uses: actions/upload-artifact@v4
with:
- name: app-builds
+ name: app-builds-${{ matrix.platform }}
path: |
- ./app-dev.apk
./app-preview.apk
- ./app-prod.apk
- ./app-prod.aab
- ./app-ios-dev.app
- ./app-ios-preview.ipa
- ./app-ios-prod.ipa
+ ./app-preview.ipa
+ overwrite: true
+ if-no-files-found: ignore
+ retention-days: 7
+
+ merge-artifacts:
+ needs: build-and-release
+ if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/heads/hotfix/') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Merge per-platform artifacts
+ uses: actions/upload-artifact/merge@v4
+ with:
+ name: app-builds
+ pattern: app-builds-*
retention-days: 7
+ delete-merged: true
diff --git a/.github/workflows/semantic-pr.yml b/.github/workflows/semantic-pr.yml
index c235de2d..a975ef61 100644
--- a/.github/workflows/semantic-pr.yml
+++ b/.github/workflows/semantic-pr.yml
@@ -3,6 +3,8 @@ name: Semantic Pull Request
on:
pull_request_target:
types: [opened, edited, synchronize]
+ branches-ignore:
+ - 'release/**'
jobs:
main:
diff --git a/.gitignore b/.gitignore
index 6f2c4b06..825374b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -39,4 +39,5 @@ build-android-preview.sh
build-android.sh
build-ios-development.sh
build-ios-preview.sh
-build-ios.sh
\ No newline at end of file
+build-ios.sh
+
\ No newline at end of file
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100755
index 00000000..0813b9ba
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+set -e
+
+# Ensure node is available in PATH
+if ! command -v node &> /dev/null; then
+ # Try common Node.js installation locations
+ for node_path in \
+ "/opt/homebrew/bin/node" \
+ "/usr/local/bin/node" \
+ "/usr/bin/node" \
+ "$HOME/.nvm/versions/node/*/bin/node"
+ do
+ if [ -x "$node_path" ]; then
+ export PATH="$(dirname "$node_path"):$PATH"
+ break
+ fi
+ done
+
+ # Final check if node is now available
+ if ! command -v node &> /dev/null; then
+ echo "Error: Node.js not found. Please ensure Node.js is installed and available in PATH" >&2
+ echo "Tip: If using VS Code, make sure it inherits your shell environment" >&2
+ exit 127
+ fi
+fi
+
+# Get list of staged files
+FILES=$(git diff --cached --name-only --diff-filter=ACMR | sed 's| |\\ |g')
+[ -z "$FILES" ] && exit 0
+
+# Run prettier on staged files
+if [ -f "./node_modules/.bin/prettier" ]; then
+ echo "$FILES" | xargs ./node_modules/.bin/prettier --ignore-unknown . --write
+ echo "$FILES" | xargs git add
+fi
+
+if [ -f "./node_modules/typescript/bin/tsc" ]; then
+ node ./node_modules/typescript/bin/tsc --noEmit
+fi
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 00000000..537dd7bc
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,14 @@
+build/
+ios/
+android/
+**/*.html
+*.json
+*.md
+*.txt
+*.xml
+*.jsonc
+*.json5
+*.jsonp
+*.jsonld
+google-services.json
+GoogleService-Info.plist
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 2241ffb3..698dba56 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,37 +1,7 @@
-# Contributing to WAL
-
Thank you for your interest in contributing!
-## Getting started
-
-- Fork and clone the repository
-- Install dependencies: `npm ci` or `yarn install`
-- Start app: `npm start`
-- Generate API client if backend spec changed: `npm run generate:api`
-
-## Branching
-
-- Create feature branches from `dev`
-- Open PRs into `dev`
-- `preview` is for pre-release; `main` is production
-
-## Checks
-
-- Typecheck: `npm run typecheck`
-- Lint: `npm run lint`
-- Prettier: `npm run format:check`
-- Tests: `npm test`
-
-## Commit and PR guidelines
-
-- Use Conventional Commits in PR titles
-- Link issues: `Closes #123`
-
-## Environment
-
-- API base URL is derived from stage in `app.config.js`
+Branch from `dev` and see the README on how to get started with the development process. We prioritize bug fixes, security or performance issues at this stage. If you want to add feature please discuss it in appropriate channel first (e.g Discussions tab or even Telegram)
-## Releases
+use conventional commits in PR titles, copilot works great.
-- Version comes from `app.config.js`
-- Android APKs are uploaded to GitHub Releases; AAB to Play Store
+make sure to run the appropriate linting and formatting.
diff --git a/GoogleService-Info-Prod.plist b/GoogleService-Info-Prod.plist
deleted file mode 100644
index 29367124..00000000
--- a/GoogleService-Info-Prod.plist
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- API_KEY
- AIzaSyBEW4MaxdOJ6j19ahY3JigPL5xHKjAcLGU
- GCM_SENDER_ID
- 754510532845
- PLIST_VERSION
- 1
- BUNDLE_ID
- com.greetai.ment
- PROJECT_ID
- mnt-86e3d
- STORAGE_BUCKET
- mnt-86e3d.appspot.com
- IS_ADS_ENABLED
-
- IS_ANALYTICS_ENABLED
-
- IS_APPINVITE_ENABLED
-
- IS_GCM_ENABLED
-
- IS_SIGNIN_ENABLED
-
- GOOGLE_APP_ID
- 1:754510532845:ios:5208816ad22f4cc7d2bce4
-
-
\ No newline at end of file
diff --git a/GoogleService-Info.plist b/GoogleService-Info.plist
deleted file mode 100644
index c98825a5..00000000
--- a/GoogleService-Info.plist
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
- API_KEY
- AIzaSyBEW4MaxdOJ6j19ahY3JigPL5xHKjAcLGU
- GCM_SENDER_ID
- 754510532845
- PLIST_VERSION
- 1
- BUNDLE_ID
- com.greetai.mentdev
- PROJECT_ID
- mnt-86e3d
- STORAGE_BUCKET
- mnt-86e3d.appspot.com
- IS_ADS_ENABLED
-
- IS_ANALYTICS_ENABLED
-
- IS_APPINVITE_ENABLED
-
- IS_GCM_ENABLED
-
- IS_SIGNIN_ENABLED
-
- GOOGLE_APP_ID
- 1:754510532845:ios:9c3e68d9b83b5bc9d2bce4
-
-
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index c5214db9..cacf2417 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,22 +1,201 @@
-MIT License
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
-Copyright (c) 2025 WAL
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+1. Definitions.
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+END OF TERMS AND CONDITIONS
+
+APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+Copyright 2025 Nika
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
diff --git a/README.md b/README.md
index f2c1bb0e..5be21a83 100644
--- a/README.md
+++ b/README.md
@@ -1,30 +1,52 @@
-## Environment Variables
+[](https://deepwiki.com/walofficial/wal-react-native)
+
+## WAL (Expo React Native)
-This project uses Expo's environment variable system in two different contexts:
+### Platform support
-1. **Building the app**: Environment variables for building are specified in the `eas.json` file.
+- This React Native app is tested on macOS only. Development on other OSes may work but is not supported at the moment.
+- The backend server can be run easily on any platform via Docker.
-Example: to build a preview build, use: eas build --profile preview
+### Requirements
-2. **EAS Updates**: When updating the app (not building), environment variables are pulled from the Expo EAS service. These are public environment variables configured on the EAS service.
+- Docker
+- Node.js (18+ recommended)
+- A good Mac; 16GB RAM recommended for smooth development
-Example: To deploy an update to a preview environment, use: eas update --channel preview --message "MESSAGE" --environment preview
+### Backend
-## Local Development
+- Backend repository: [WAL Server](https://github.com/walofficial/wal-server)
+- By default, the backend listens at `http://localhost:5500`.
-For local backend development, it is recommended to use `pnpm start` to run the app without tunneling. This provides a direct connection to your local backend services.
+### Setup (minimal)
-## Push Notifications
+```bash
+npm i
+```
-This project uses push notifications for both Android and iOS platforms. The required configuration files are:
+You only need your Supabase URL and Anon Key. Create a new [Supabase project](https://supabase.com/dashboard/sign-in) to obtain them.
-- `google-services.json`: Required for Android push notifications (development and production)
-- `GoogleService-Info.plist`: Required for iOS push notifications (development and production)
+Create a `.env.development` file in the project root:
-These files should be properly configured for each environment (development and production).
+```bash
+EXPO_PUBLIC_SUPABASE_URL=
+EXPO_PUBLIC_SUPABASE_ANON_KEY=
+EXPO_PUBLIC_DISABLE_FIREBASE=true
+```
-## Web Suppor
+### Run
-There is experimental support for web using the `npx expo start --web` flag. However, this is not ready for production as we are waiting for server-side rendering support. Currently, Expo only supports static file generation during build time, with SSR support being blocked by Expo's current limitations.
+```bash
+# Build for you sinmulator
+npx expo run:ios or npx expo run:android
-# tests
+# If you need to publish expo dev server on LAN do this
+npm start
+```
+
+Thatโs it. With the backend on `http://localhost:5500` and the Supabase env set, the frontend and backend are connected.
+
+### Additional notes
+
+- The new architecture from Expo/React Native has performance issues on Android, and LiveKit does not support the new architecture yet. There are no plans to migrate at this time.
+- You will need to add a test phone number in Supabase and set up phone number authentication with Twilio to log into the app. Twilioโs test setup is free.
diff --git a/app.config.js b/app.config.js
index a81df868..5c3e5bff 100644
--- a/app.config.js
+++ b/app.config.js
@@ -5,6 +5,135 @@ const pkg = require('./package.json');
export const app_name_slug = 'wal';
export const app_name = IS_DEV ? 'WAL DEV' : 'WAL';
+
+// Build plugin list dynamically so the app can run without Firebase files
+const pluginsList = [
+ 'expo-router',
+ [
+ 'expo-share-intent',
+ {
+ iosActivationRules: {
+ NSExtensionActivationSupportsWebURLWithMaxCount: 1,
+ NSExtensionActivationSupportsWebPageWithMaxCount: 1,
+ NSExtensionActivationSupportsText: true,
+ NSExtensionActivationSupportsImageWithMaxCount: 10,
+ },
+ androidIntentFilters: ['text/*', 'image/*'],
+ },
+ ],
+ [
+ 'expo-build-properties',
+ {
+ ios: {
+ useFrameworks: 'static',
+ },
+ android: {
+ //LiveKit sdk requires min 24
+ minSdkVersion: 24,
+ targetSdkVersion: 35,
+ },
+ },
+ ],
+ [
+ 'expo-notifications',
+ {
+ icon: './assets/images/small-icon-android.png',
+ color: '#000',
+ },
+ ],
+ [
+ 'react-native-vision-camera',
+ {
+ cameraPermissionText:
+ '$(PRODUCT_NAME) needs access to your Camera to capture photos and videos or go live.',
+
+ // optionally, if you want to record audio:
+ enableMicrophonePermission: true,
+ microphonePermissionText:
+ '$(PRODUCT_NAME) needs access to your Microphone to capture audio.',
+ },
+ ],
+ [
+ '@sentry/react-native/expo',
+ {
+ url: 'https://sentry.io/',
+ project: 'react-native',
+ organization: 'greetai-inc',
+ },
+ ],
+ [
+ 'expo-location',
+ {
+ locationPermissionText:
+ 'This app accesses your location to let you post videos or photos to nearby locations.',
+ },
+ ],
+ [
+ 'expo-contacts',
+ {
+ contactsPermission:
+ 'WAL needs access to your contacts to help you find friends on the app. Your contact information is only used for friend discovery and is never stored or shared.',
+ },
+ ],
+ 'react-native-compressor',
+ [
+ 'expo-build-properties',
+ {
+ ios: {
+ newArchEnabled: false,
+ },
+ android: {
+ newArchEnabled: false,
+ },
+ },
+ ],
+ 'react-native-libsodium',
+ [
+ 'react-native-share',
+ {
+ ios: ['fb', 'instagram', 'whatsapp', 'tg', 'twitter', 'tiktoksharesdk'],
+ android: [
+ 'com.whatsapp',
+ 'org.telegram.messenger',
+ 'com.facebook.katana',
+ 'com.instagram.android',
+ 'com.twitter.android',
+ 'com.zhiliaoapp.musically',
+ ],
+ },
+ ],
+ '@livekit/react-native-expo-plugin',
+ '@config-plugins/react-native-webrtc',
+ [
+ 'expo-image-picker',
+ {
+ photosPermission:
+ '$(PRODUCT_NAME) needs access to your photos to set profile image.',
+ cameraPermission:
+ '$(PRODUCT_NAME) needs access to your Camera to capture photos and videos or go live on locations.',
+ },
+ ],
+ [
+ 'expo-splash-screen',
+ {
+ backgroundColor: '#000000',
+ image: './assets/images/icon.png',
+ dark: {
+ image: './assets/images/icon.png',
+ backgroundColor: '#000000',
+ },
+ imageWidth: 200,
+ },
+ ],
+];
+
+// Firebase config toggles: enable only if explicitly enabled
+const DISABLE_FIREBASE = process.env.EXPO_PUBLIC_DISABLE_FIREBASE == 'true';
+
+if (!DISABLE_FIREBASE) {
+ pluginsList.push('@react-native-firebase/app');
+}
+
export default {
expo: {
platforms: ['ios', 'android', 'web'],
@@ -44,9 +173,9 @@ export default {
},
supportsTablet: false,
bundleIdentifier: IS_DEV ? 'com.greetai.mentdev' : 'com.greetai.ment',
- googleServicesFile: IS_DEV
+ googleServicesFile: !DISABLE_FIREBASE
? './GoogleService-Info.plist'
- : './GoogleService-Info-Prod.plist',
+ : undefined,
},
assetBundlePatterns: ['**/*'],
android: {
@@ -58,7 +187,9 @@ export default {
backgroundColor: '#ffffff',
},
- googleServicesFile: './google-services.json',
+ googleServicesFile: !DISABLE_FIREBASE
+ ? './google-services.json'
+ : undefined,
intentFilters: [
{
action: 'VIEW',
@@ -80,133 +211,7 @@ export default {
],
permissions: ['READ_CONTACTS'],
},
- plugins: [
- 'expo-router',
- [
- 'expo-share-intent',
- {
- iosActivationRules: {
- NSExtensionActivationSupportsWebURLWithMaxCount: 1,
- NSExtensionActivationSupportsWebPageWithMaxCount: 1,
- NSExtensionActivationSupportsText: true,
- NSExtensionActivationSupportsImageWithMaxCount: 10,
- },
- androidIntentFilters: ['text/*', 'image/*'],
- },
- ],
- [
- 'expo-build-properties',
- {
- ios: {
- useFrameworks: 'static',
- },
- android: {
- //LiveKit sdk requires min 24
- minSdkVersion: 24,
- targetSdkVersion: 35,
- },
- },
- ],
- [
- 'expo-notifications',
- {
- icon: './assets/images/small-icon-android.png',
- color: '#000',
- },
- ],
- [
- 'react-native-vision-camera',
- {
- cameraPermissionText:
- '$(PRODUCT_NAME) needs access to your Camera to capture photos and videos or go live.',
-
- // optionally, if you want to record audio:
- enableMicrophonePermission: true,
- microphonePermissionText:
- '$(PRODUCT_NAME) needs access to your Microphone to capture audio.',
- },
- ],
- [
- '@sentry/react-native/expo',
- {
- url: 'https://sentry.io/',
- project: 'react-native',
- organization: 'greetai-inc',
- },
- ],
- [
- 'expo-location',
- {
- locationPermissionText:
- 'This app accesses your location to let you post videos or photos to nearby locations.',
- },
- ],
- [
- 'expo-contacts',
- {
- contactsPermission:
- 'WAL needs access to your contacts to help you find friends on the app. Your contact information is only used for friend discovery and is never stored or shared.',
- },
- ],
- '@react-native-firebase/app',
- 'react-native-compressor',
- [
- 'expo-build-properties',
- {
- ios: {
- newArchEnabled: false,
- },
- android: {
- newArchEnabled: false,
- },
- },
- ],
- 'react-native-libsodium',
- [
- 'react-native-share',
- {
- ios: [
- 'fb',
- 'instagram',
- 'whatsapp',
- 'tg',
- 'twitter',
- 'tiktoksharesdk',
- ],
- android: [
- 'com.whatsapp',
- 'org.telegram.messenger',
- 'com.facebook.katana',
- 'com.instagram.android',
- 'com.twitter.android',
- 'com.zhiliaoapp.musically',
- ],
- },
- ],
- '@livekit/react-native-expo-plugin',
- '@config-plugins/react-native-webrtc',
- [
- 'expo-image-picker',
- {
- photosPermission:
- '$(PRODUCT_NAME) needs access to your photos to set profile image.',
- cameraPermission:
- '$(PRODUCT_NAME) needs access to your Camera to capture photos and videos or go live on locations.',
- },
- ],
- [
- 'expo-splash-screen',
- {
- backgroundColor: '#000000',
- image: './assets/images/icon.png',
- dark: {
- image: './assets/images/icon.png',
- backgroundColor: '#000000',
- },
- imageWidth: 200,
- },
- ],
- ],
+ plugins: pluginsList,
experiments: {
typedRoutes: true,
},
diff --git a/app/(auth)/photos.tsx b/app/(auth)/photos.tsx
index 4635e96d..96d6f624 100644
--- a/app/(auth)/photos.tsx
+++ b/app/(auth)/photos.tsx
@@ -22,7 +22,7 @@ export default function RegisterPhotos() {
flex: 1,
}}
>
-
+ {/* */}
);
diff --git a/app/(auth)/register.tsx b/app/(auth)/register.tsx
index 1027c2f5..9f226b37 100644
--- a/app/(auth)/register.tsx
+++ b/app/(auth)/register.tsx
@@ -2,10 +2,17 @@ import RegisterView from '@/components/RegisterView';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { View } from 'react-native';
import { useTheme } from '@/lib/theme';
+import { isUserRegistered, useSession } from '@/components/AuthLayer';
+import { Redirect, router } from 'expo-router';
export default function Register() {
const insets = useSafeAreaInsets();
const theme = useTheme();
+ const { user } = useSession();
+ if (user && isUserRegistered(user)) {
+ return ;
+ }
+
return (
;
+ }
if (user && isUserRegistered(user)) {
- return ;
+ return ;
+ }
+
+ if (user && !isUserRegistered(user)) {
+ return ;
}
return (
diff --git a/app/(tabs)/(home)/_layout.tsx b/app/(tabs)/(home)/_layout.tsx
index 90836026..58619e04 100644
--- a/app/(tabs)/(home)/_layout.tsx
+++ b/app/(tabs)/(home)/_layout.tsx
@@ -1,4 +1,4 @@
-import { Link, Stack, useLocalSearchParams } from 'expo-router';
+import { Stack } from 'expo-router';
import ProfileHeader from '@/components/ProfileHeader';
import { TaskTitle } from '@/components/CustomTitle';
import { ScrollReanimatedValueProvider } from '@/components/context/ScrollReanimatedValue';
@@ -95,7 +95,7 @@ export default function Layout() {
/>
null,
}}
diff --git a/app/(tabs)/(home)/index.tsx b/app/(tabs)/(home)/index.tsx
index c2006770..275eb7f9 100644
--- a/app/(tabs)/(home)/index.tsx
+++ b/app/(tabs)/(home)/index.tsx
@@ -67,7 +67,7 @@ export default function TaskScrollableView() {
return;
}
}
- }, [data, isFetching, router, goLiveMutation, errorMsg]);
+ }, [data, isFetching, goLiveMutation, errorMsg]);
return (
{
if (!user) {
@@ -151,6 +160,12 @@ export default function Component() {
);
};
+ const handleApplyApiBaseUrl = async () => {
+ try {
+ await setApiBaseUrlInConfig(apiBaseUrl);
+ } catch {}
+ };
+
const handleClearCache = async () => {
try {
await AsyncStorage.clear();
@@ -216,6 +231,32 @@ export default function Component() {
+
+ {isNonProduction && (
+
+
+ API Base URL (dev/preview)
+
+
+
+
+
+ )}
diff --git a/app/(tabs)/_layout.tsx b/app/(tabs)/_layout.tsx
index 075a6a7f..9286d3cb 100644
--- a/app/(tabs)/_layout.tsx
+++ b/app/(tabs)/_layout.tsx
@@ -1,26 +1,17 @@
-import { Redirect, router, Tabs, usePathname, useRouter } from 'expo-router';
+import { Redirect, Tabs, usePathname, useRouter } from 'expo-router';
import React, { useEffect } from 'react';
import { Stack } from 'expo-router';
-import {
- BottomSheetModal,
- BottomSheetModalProvider,
-} from '@gorhom/bottom-sheet';
-import { StyleSheet, View, BackHandler } from 'react-native';
-import { BlurView } from 'expo-blur';
-
+import { BottomSheetModalProvider } from '@gorhom/bottom-sheet';
+import { BackHandler, StyleSheet, View } from 'react-native';
import { TabBarIcon } from '@/components/navigation/TabBarIcon';
import { useColorScheme } from '@/lib/useColorScheme';
import { isUserRegistered, useSession } from '@/components/AuthLayer';
import DbUserGetter from '@/components/DbUserGetter';
-import { useNotificationHandler } from '@/components/DbUserGetter/useNotficationHandler';
import SidebarLayout from '@/components/SidebarLayout';
-import { isAndroid, isIOS, isWeb } from '@/lib/platform';
+import { isAndroid, isWeb } from '@/lib/platform';
import LocationProvider from '@/components/LocationProvider';
-import SpacesBottomSheet from '@/components/SpacesBottomSheet';
-import { Lightbox } from '@/components/Lightbox/Lightbox';
import useFeeds from '@/hooks/useFeeds';
import { useLightboxControls } from '@/lib/lightbox/lightbox';
-import { Georgia } from '@/lib/icons/Georgia';
import { useShareIntentContext } from 'expo-share-intent';
import ErrorMessageCard from '@/components/ErrorMessageCard';
import FullScreenLoader from '@/components/FullScreenLoader';
@@ -31,10 +22,76 @@ import { setAndroidNavigationBar } from '@/lib/android-navigation-bar';
import { Provider as HeaderTransformProvider } from '@/lib/context/header-transform';
import { Provider as ReactionsOverlayProvider } from '@/lib/reactionsOverlay/reactionsOverlay';
import { ReactionsOverlay } from '@/components/ReactionsOverlay/ReactionsOverlay';
-import { PortalHost } from '@/components/primitives/portal';
-import { useAtom, useSetAtom } from 'jotai';
+import { useAtomValue, useSetAtom } from 'jotai';
import { factCheckBottomSheetState } from '@/lib/atoms/news';
import { locationUserListSheetState } from '@/lib/atoms/location';
+import { isUserLiveState } from '@/components/CameraPage/atom';
+import Animated, {
+ Easing,
+ useAnimatedStyle,
+ useSharedValue,
+ withRepeat,
+ withSequence,
+ withTiming,
+} from 'react-native-reanimated';
+
+function LivePulseIcon({ children }: { children: React.ReactNode }) {
+ const scale = useSharedValue(1);
+ const opacity = useSharedValue(0.6);
+
+ React.useEffect(() => {
+ scale.value = withRepeat(
+ withSequence(
+ withTiming(1.15, { duration: 900, easing: Easing.inOut(Easing.quad) }),
+ withTiming(1.0, { duration: 900, easing: Easing.inOut(Easing.quad) }),
+ ),
+ -1,
+ true,
+ );
+ opacity.value = withRepeat(
+ withSequence(
+ withTiming(0.2, { duration: 900 }),
+ withTiming(0.6, { duration: 900 }),
+ ),
+ -1,
+ true,
+ );
+ }, []);
+
+ const ringStyle = useAnimatedStyle(() => {
+ return {
+ transform: [{ scale: scale.value }],
+ opacity: opacity.value,
+ };
+ });
+
+ return (
+
+
+ {children}
+
+ );
+}
+
+const styles = StyleSheet.create({
+ iconContainer: {
+ width: 36,
+ height: 36,
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+ pulseRing: {
+ position: 'absolute',
+ width: 28,
+ height: 28,
+ borderRadius: 14,
+ backgroundColor: 'rgba(255,0,0,0.25)',
+ },
+ iconInner: {
+ alignItems: 'center',
+ justifyContent: 'center',
+ },
+});
export default function TabLayout() {
const pathname = usePathname();
@@ -76,7 +133,7 @@ export default function TabLayout() {
const router = useRouter();
const setUserLocationBottomSheet = useSetAtom(locationUserListSheetState);
const setIsFactCheckBottomSheetOpen = useSetAtom(factCheckBottomSheetState);
-
+ const isUserLive = useAtomValue(isUserLiveState);
useEffect(() => {
if (shareIntent && session && isAndroid) {
// Check if we have images or text content to share
@@ -153,28 +210,6 @@ export default function TabLayout() {
}
}, [pathname]);
- // Navigate to news feed on sign in basically.
- useEffect(() => {
- if (
- user?.preferred_news_feed_id &&
- newsFeedId &&
- !userIsLoading &&
- !isLoading
- ) {
- // Only navigate if we're not already on the news feed
- const isOnNewsFeed =
- pathname.includes('(news)') && pathname.includes(newsFeedId);
- if (!isOnNewsFeed) {
- router.navigate({
- pathname: '/(tabs)/(news)/[feedId]',
- params: {
- feedId: user.preferred_news_feed_id,
- },
- });
- }
- }
- }, [user?.preferred_news_feed_id, newsFeedId, userIsLoading, isLoading]);
-
// You can keep the splash screen open, or render a loading screen like we do here.
if (isLoading) {
return null;
@@ -243,7 +278,7 @@ export default function TabLayout() {
- (
-
- ),
- }}
- />
-
+
+ isUserLive ? (
+
+
+
+ ) : (
+
+ ),
+ }}
+ />
- {Platform.OS === 'android' && (
-
- )}
+
diff --git a/app/index.tsx b/app/index.tsx
index 2170514b..849522cc 100644
--- a/app/index.tsx
+++ b/app/index.tsx
@@ -24,6 +24,7 @@ export default function Index() {
}, [session]);
if (session && !userIsLoading && user && user.preferred_news_feed_id) {
+ // This fires when user is signed in the application and app was fully closed.
return ;
}
if (isLoading || userIsLoading) {
diff --git a/components/AccessView/index.tsx b/components/AccessView/index.tsx
index c7983bde..ae25447a 100644
--- a/components/AccessView/index.tsx
+++ b/components/AccessView/index.tsx
@@ -22,24 +22,16 @@ import { zodResolver } from '@hookform/resolvers/zod';
import { z } from 'zod';
import { Text } from '@/components/ui/text';
import Button from '@/components/Button';
-// import { Button } from "@/components/ui/button";
import { OtpInput } from 'react-native-otp-entry';
import { useMutation, useQuery } from '@tanstack/react-query';
import { authenticatingState } from '@/lib/state/auth';
import { useAtom, useAtomValue } from 'jotai';
import { supabase } from '@/lib/supabase';
-import { colors } from '@/lib/colors';
-import { Redirect, useRouter } from 'expo-router';
-import { toast } from '@backpackapp-io/react-native-toast';
import { AndroidAutoSMSRef } from './AndroidAutoSMS';
import { LogBox } from 'react-native';
-import { BottomSheetTextInput, BottomSheetView } from '@gorhom/bottom-sheet';
+import { BottomSheetView } from '@gorhom/bottom-sheet';
import { RefObject } from 'react';
-import {
- showPhoneInputState,
- showCountrySelectorState,
- selectedCountryState,
-} from './atom';
+import { showPhoneInputState, showCountrySelectorState } from './atom';
import { FontSizes, useTheme } from '@/lib/theme';
import { BlurView } from 'expo-blur';
import CountrySelector from '@/components/CountrySelector';
@@ -239,6 +231,11 @@ const SignupForm = forwardRef(function SignupForm(
},
});
+ useEffect(() => {
+ // Reset phone input visibility after returning, but don't interfere with OTP flow
+ if (!isAuthenticating) setShowPhoneInput((prev) => (prev ? prev : true));
+ }, [isAuthenticating]);
+
const handleTimerStart = useCallback((duration: number) => {
// This callback is called when timer starts in TimerButton
}, []);
diff --git a/components/AuthLayer.tsx b/components/AuthLayer.tsx
index e2c07e26..1fb53ce4 100644
--- a/components/AuthLayer.tsx
+++ b/components/AuthLayer.tsx
@@ -87,9 +87,6 @@ export default function AuthLayer({ children }: { children: React.ReactNode }) {
// Handle user registration status
useEffect(() => {
if (user) {
- if (!isUserRegistered(user)) {
- router.navigate('/(auth)/register');
- }
// Send public key when we have a user
sendPublicKey({ userId: user.id });
}
@@ -115,7 +112,6 @@ export default function AuthLayer({ children }: { children: React.ReactNode }) {
}
try {
- successToast({ title: t('common.finalize_user_details') });
const newUser = await handleUserNotFound(supabaseUser.data.user);
setUser(newUser.data);
dismissAll();
diff --git a/components/CameraPage/CaptureButton.tsx b/components/CameraPage/CaptureButton.tsx
index 8cd9e26b..2a07b61f 100644
--- a/components/CameraPage/CaptureButton.tsx
+++ b/components/CameraPage/CaptureButton.tsx
@@ -16,7 +16,6 @@ import Reanimated, {
import type { Camera, VideoFile } from 'react-native-vision-camera';
import { CAPTURE_BUTTON_SIZE } from './Constants';
import AsyncStorage from '@react-native-async-storage/async-storage';
-import { toast } from '@backpackapp-io/react-native-toast';
import { useHaptics } from '@/lib/haptics';
import { useToast } from '../ToastUsage';
import { t } from '@/lib/i18n';
@@ -53,6 +52,7 @@ const _CaptureButton: React.FC = ({
const recordingProgress = useSharedValue(0);
const recordingTimer = useRef | null>(null);
const haptic = useHaptics();
+ const { dismiss } = useToast();
useEffect(() => {
setRecordingTimeView(isRecording);
diff --git a/components/CameraPage/LiveButton.tsx b/components/CameraPage/LiveButton.tsx
index 5aa6ee59..30d922ac 100644
--- a/components/CameraPage/LiveButton.tsx
+++ b/components/CameraPage/LiveButton.tsx
@@ -6,7 +6,10 @@ import {
ActivityIndicator,
} from 'react-native';
import { useMutation } from '@tanstack/react-query';
-import { requestLivekitIngressMutation } from '@/lib/api/generated/@tanstack/react-query.gen';
+import {
+ requestLivekitIngressMutation,
+ startLiveMutation,
+} from '@/lib/api/generated/@tanstack/react-query.gen';
import { useToast } from '@/components/ToastUsage';
import { t } from '@/lib/i18n';
@@ -30,7 +33,7 @@ export function LiveButton({
}: LiveButtonProps) {
const { error: errorToast } = useToast();
const { mutate: requestLive, isPending } = useMutation({
- ...requestLivekitIngressMutation(),
+ ...startLiveMutation(),
onSuccess: (data) => {
onShowRoom(data);
},
diff --git a/components/CameraPage/LiveStream.tsx b/components/CameraPage/LiveStream.tsx
index 0dc2ce51..d5df6788 100644
--- a/components/CameraPage/LiveStream.tsx
+++ b/components/CameraPage/LiveStream.tsx
@@ -1,5 +1,5 @@
import React, { useEffect, useState, useCallback } from 'react';
-import { View, StyleSheet, Text } from 'react-native';
+import { View, StyleSheet, Text, Alert } from 'react-native';
import {
AudioSession,
LiveKitRoom,
@@ -10,7 +10,6 @@ import {
useRoom,
useRoomContext,
} from '@livekit/react-native';
-import { toast } from '@backpackapp-io/react-native-toast';
import { Track, LocalVideoTrack } from 'livekit-client';
import { RoomControls } from './RoomControls';
// @ts-ignore
@@ -18,6 +17,12 @@ import { mediaDevices } from '@livekit/react-native-webrtc';
import useAuth from '@/hooks/useAuth';
import { BlurView } from 'expo-blur';
import { t } from '@/lib/i18n';
+import { useToast } from '../ToastUsage';
+import { isUserLiveState } from './atom';
+import { useAtom } from 'jotai';
+import { apiClient } from '@/lib/api/client';
+import { useMutation } from '@tanstack/react-query';
+import { stopLiveMutation } from '@/lib/api/generated/@tanstack/react-query.gen';
registerGlobals();
@@ -28,19 +33,35 @@ interface LiveStreamProps {
}
export function LiveStream({ token, roomName, onDisconnect }: LiveStreamProps) {
- const handleDisconnect = useCallback(() => {
- // Ensure cleanup happens before calling the parent's onDisconnect
- if (onDisconnect) {
- onDisconnect();
- }
- }, [onDisconnect]);
+ const { error: errorToast, success: successToast } = useToast();
+ const [isUserLive, setIsUserLive] = useAtom(isUserLiveState);
+ const stopLive = useMutation({
+ ...stopLiveMutation(),
+ onSuccess: (data) => {
+ if (onDisconnect) {
+ setIsUserLive(false);
+ onDisconnect();
+ }
+ },
+ });
return (
{
+ setIsUserLive(true);
+ // successToast({
+ // title: t('common.live_stream_started'),
+ // description: t('common.live_stream_started_description'),
+ // });
+ }}
onError={(error: Error) => {
- // toast(error.message);
+ // errorToast({
+ // title: t('common.failed_to_start_live_stream'),
+ // description: t('common.failed_to_start_live_stream_description'),
+ // });
+ setIsUserLive(false);
}}
connect={true}
options={{
@@ -48,10 +69,24 @@ export function LiveStream({ token, roomName, onDisconnect }: LiveStreamProps) {
}}
audio={true}
video={true}
- onDisconnected={handleDisconnect}
+ onDisconnected={() => {
+ setIsUserLive(false);
+ if (onDisconnect) {
+ onDisconnect();
+ }
+ }}
>
-
+
+ stopLive.mutate({
+ query: {
+ room_name: roomName,
+ },
+ })
+ }
+ />
);
@@ -59,15 +94,14 @@ export function LiveStream({ token, roomName, onDisconnect }: LiveStreamProps) {
interface RoomViewProps {
onDisconnect?: () => void;
+ isDisconnecting?: boolean;
}
-function RoomView({ onDisconnect }: RoomViewProps) {
+function RoomView({ onDisconnect, isDisconnecting }: RoomViewProps) {
const { localParticipant } = useLocalParticipant();
const [isMicEnabled, setIsMicEnabled] = useState(true);
const [isCameraEnabled, setIsCameraEnabled] = useState(true);
const [isCameraFrontFacing, setCameraFrontFacing] = useState(true);
- const room = useRoomContext();
- const { user } = useAuth();
// Get all camera tracks.
const tracks = useTracks([Track.Source.Camera]);
@@ -229,6 +263,7 @@ function RoomView({ onDisconnect }: RoomViewProps) {
}}
onDisconnectClick={handleDisconnect}
onSwitchCamera={handleCameraSwitch}
+ isDisconnecting={isDisconnecting}
/>
);
diff --git a/components/CameraPage/RoomControls.tsx b/components/CameraPage/RoomControls.tsx
index 2cf83ce7..7b35a0cc 100644
--- a/components/CameraPage/RoomControls.tsx
+++ b/components/CameraPage/RoomControls.tsx
@@ -1,5 +1,11 @@
import React from 'react';
-import { View, Pressable, Text, StyleSheet } from 'react-native';
+import {
+ View,
+ Pressable,
+ Text,
+ StyleSheet,
+ ActivityIndicator,
+} from 'react-native';
import { Ionicons } from '@expo/vector-icons';
import Animated, {
FadeIn,
@@ -20,6 +26,7 @@ interface RoomControlsProps {
setCameraEnabled: (enabled: boolean) => void;
onDisconnectClick?: () => void;
onSwitchCamera?: () => void;
+ isDisconnecting?: boolean;
}
const AnimatedPressable = Animated.createAnimatedComponent(Pressable);
@@ -31,6 +38,7 @@ export function RoomControls({
setCameraEnabled,
onDisconnectClick,
onSwitchCamera,
+ isDisconnecting,
}: RoomControlsProps) {
const insets = useSafeAreaInsets();
@@ -175,7 +183,11 @@ export function RoomControls({
onPress={handleDisconnect}
style={[styles.disconnectButton, disconnectAnimatedStyle]}
>
-
+ {isDisconnecting ? (
+
+ ) : (
+
+ )}
@@ -188,7 +200,7 @@ const styles = StyleSheet.create({
position: 'absolute',
flexDirection: 'row',
alignItems: 'center',
- backgroundColor: 'rgba(239, 68, 68, 0.9)',
+ backgroundColor: '#FF0000',
paddingHorizontal: 12,
paddingVertical: 6,
borderRadius: 20,
@@ -240,7 +252,7 @@ const styles = StyleSheet.create({
width: 52,
height: 52,
borderRadius: 26,
- backgroundColor: '#EF4444',
+ backgroundColor: '#FF0000',
justifyContent: 'center',
alignItems: 'center',
shadowColor: '#000',
diff --git a/components/CameraPage/atom.ts b/components/CameraPage/atom.ts
index 5ff3909a..c09aa47d 100644
--- a/components/CameraPage/atom.ts
+++ b/components/CameraPage/atom.ts
@@ -3,3 +3,5 @@ import { atom } from 'jotai';
export const lastSavedRecordingTimeState = atom(0);
export const isContactSyncSheetOpenState = atom(false);
+
+export const isUserLiveState = atom(false);
diff --git a/components/CameraPage/index.tsx b/components/CameraPage/index.tsx
index c9df53c9..6793bbfa 100644
--- a/components/CameraPage/index.tsx
+++ b/components/CameraPage/index.tsx
@@ -55,9 +55,9 @@ import { usePreferredCameraDevice } from '../../hooks/usePreferredCameraDevice';
import { CaptureButton } from './CaptureButton';
import { useLocalSearchParams, useNavigation, useRouter } from 'expo-router';
import { CaptureButtonPhoto } from './CaptureButtonPhoto';
-import { toast } from '@backpackapp-io/react-native-toast';
import { LiveButton } from './LiveButton';
import { t } from '@/lib/i18n';
+import { useToast } from '../ToastUsage';
const ReanimatedCamera = Reanimated.createAnimatedComponent(Camera);
Reanimated.addWhitelistedNativeProps({
@@ -89,7 +89,7 @@ const CameraOverlay = Reanimated.createAnimatedComponent(View);
export default function CameraPage(): React.ReactElement {
const navigation = useNavigation();
const { feedId } = useLocalSearchParams();
-
+ const { dismiss } = useToast();
const [liveDescription, setLiveDescription] = useState('');
const shouldShowMediaTypeSwitch = true;
@@ -455,8 +455,8 @@ export default function CameraPage(): React.ReactElement {
livekit_token: string;
room_name: string;
}) => {
- router.replace({
- pathname: '/(tabs)/(home)/[feedId]/livestream',
+ router.navigate({
+ pathname: '/(tabs)/(home)/livestream',
params: {
feedId: feedId as string,
livekit_token: livekit_token,
@@ -501,7 +501,7 @@ export default function CameraPage(): React.ReactElement {
{
- toast.remove();
+ dismiss('all');
router.navigate({
pathname: '/(tabs)/(home)/[feedId]',
params: {
diff --git a/components/FeedItem/FeedActions.tsx b/components/FeedItem/FeedActions.tsx
index 72dfb66d..c98f5e11 100644
--- a/components/FeedItem/FeedActions.tsx
+++ b/components/FeedItem/FeedActions.tsx
@@ -1,15 +1,19 @@
-import React, { useEffect, useRef } from 'react';
+import React, { useEffect } from 'react';
import {
View,
StyleSheet,
- Platform,
useColorScheme,
Text,
- Animated,
Pressable,
- TouchableOpacity,
} from 'react-native';
import Svg, { Circle } from 'react-native-svg';
+import Animated, {
+ Easing,
+ useAnimatedStyle,
+ useSharedValue,
+ withRepeat,
+ withTiming,
+} from 'react-native-reanimated';
import CommentButton from './CommentButton';
import ShareButton from './ShareButton';
import { useTheme } from '@/lib/theme';
@@ -19,13 +23,14 @@ import FactualityBadge from '../ui/FactualityBadge';
import { getFactCheckBadgeInfo } from '@/utils/factualityUtils';
import { t } from '@/lib/i18n';
import { useToast } from '../ToastUsage';
+import useVerificationById from '@/hooks/useVerificationById';
interface FeedActionsProps {
verificationId: string;
sourceComponent?: React.ReactNode;
hideUserRects?: boolean;
showFactualityBadge?: boolean;
- isOwner: boolean;
+ // isOwner: boolean;
}
// Animated loading circle component
@@ -36,23 +41,21 @@ const LoadingCircle = ({
color: string;
size?: number;
}) => {
- const rotateValue = useRef(new Animated.Value(0)).current;
+ const rotateValue = useSharedValue(0);
useEffect(() => {
- const animation = Animated.loop(
- Animated.timing(rotateValue, {
- toValue: 1,
- duration: 1000,
- useNativeDriver: false, // SVG animations need useNativeDriver: false
- }),
+ rotateValue.value = withRepeat(
+ withTiming(1, { duration: 1000, easing: Easing.linear }),
+ -1,
+ false,
);
- animation.start();
- return () => animation.stop();
+ // no cleanup needed for reanimated repeat loop
}, []);
- const rotate = rotateValue.interpolate({
- inputRange: [0, 1],
- outputRange: ['0deg', '360deg'],
+ const animatedStyle = useAnimatedStyle(() => {
+ return {
+ transform: [{ rotate: `${rotateValue.value * 360}deg` }],
+ };
});
const radius = size / 2 - 1;
@@ -61,7 +64,7 @@ const LoadingCircle = ({
const strokeDashoffset = circumference * 0.75; // Show 25% of the circle
return (
-
+