Skip to content
Closed
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
5 changes: 1 addition & 4 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
{
"extends": [
"expo",
"plugin:@typescript-eslint/recommended"
],
"extends": ["expo", "plugin:@typescript-eslint/recommended"],
"plugins": ["@typescript-eslint", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
Expand Down
6 changes: 6 additions & 0 deletions .github/BRANCH_PROTECTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@
To enforce the CI/CD pipeline quality gates, configure branch protection rules in your GitHub repository:

## Settings Location

Go to: Repository Settings → Branches → Add rule

## Required Settings for `main` branch:

### Branch name pattern

```
main
```

### ✅ Required checks (enable ALL):

- [ ] **typescript-lint** - ESLint and Prettier checks
- [ ] **typescript-typecheck** - TypeScript type validation
- [ ] **typescript-tests** - Jest test suite
Expand All @@ -23,6 +26,7 @@ main
- [ ] **rust-build** - Rust contract compilation

### Additional protections:

- [x] Require pull request before merging
- [x] Require at least 1 approval (recommended)
- [x] Dismiss stale reviews
Expand All @@ -31,13 +35,15 @@ main
- [x] Do not allow bypassing the above settings

## Settings Location for `dev` branch (optional):

Similar settings, but you may allow force pushes for rapid development.

---

## Verification

After setting up, verify by:

1. Creating a test PR
2. Intentionally break a lint rule
3. Verify the PR cannot be merged until fixed
3 changes: 3 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## Pull Request Checklist

### Quality Gates (All must pass before merge)

- [ ] **Lint**: Code passes ESLint and Prettier checks
- [ ] **Type Check**: TypeScript compilation succeeds
- [ ] **Tests**: All tests pass
Expand All @@ -11,12 +12,14 @@
- [ ] **Rust Build**: Smart contracts compile successfully

### Additional Requirements

- [ ] New code has appropriate TypeScript types
- [ ] No hardcoded secrets or credentials
- [ ] New features have corresponding tests
- [ ] Documentation updated if needed

### Reviewers

- At least 1 approval required for merge
- All CI checks must be green

Expand Down
34 changes: 27 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

env:
NODE_VERSION: '20'
RUST_VERSION: '1.77'
RUST_VERSION: 'stable'

jobs:
# ─────────────────────────────────────────────────────────
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
version: ${{ env.RUST_VERSION }}
toolchain: ${{ env.RUST_VERSION }}
components: rustfmt

- name: Check Rust formatting
Expand All @@ -124,7 +124,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
version: ${{ env.RUST_VERSION }}
toolchain: ${{ env.RUST_VERSION }}
components: clippy

- name: Cache Rust dependencies
Expand All @@ -146,7 +146,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
version: ${{ env.RUST_VERSION }}
toolchain: ${{ env.RUST_VERSION }}

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand All @@ -167,7 +167,7 @@ jobs:
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
version: ${{ env.RUST_VERSION }}
toolchain: ${{ env.RUST_VERSION }}

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand All @@ -185,7 +185,17 @@ jobs:
name: Merge Protection Check
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
needs: [typescript-lint, typescript-typecheck, typescript-tests, typescript-build, rust-format, rust-clippy, rust-tests, rust-build]
needs:
[
typescript-lint,
typescript-typecheck,
typescript-tests,
typescript-build,
rust-format,
rust-clippy,
rust-tests,
rust-build,
]
steps:
- name: All checks passed
run: echo "All quality gates passed!"
Expand All @@ -197,7 +207,17 @@ jobs:
name: CI Complete
runs-on: ubuntu-latest
if: always()
needs: [typescript-lint, typescript-typecheck, typescript-tests, typescript-build, rust-format, rust-clippy, rust-tests, rust-build]
needs:
[
typescript-lint,
typescript-typecheck,
typescript-tests,
typescript-build,
rust-format,
rust-clippy,
rust-tests,
rust-build,
]
steps:
- name: Check for failures
run: |
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ builds/
.env
.DS_Store
coverage/
contracts/target/
contracts/test_snapshots/
44 changes: 20 additions & 24 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,21 @@ import { StatusBar } from 'expo-status-bar';
import { AppNavigator } from './src/navigation/AppNavigator';

// Import WalletConnect compatibility layer
import "@walletconnect/react-native-compat";
import '@walletconnect/react-native-compat';

import {
createAppKit,
defaultConfig,
AppKit,
} from "@reown/appkit-ethers-react-native";
import { createAppKit, defaultConfig, AppKit } from '@reown/appkit-ethers-react-native';

// Get projectId from environment variable
const projectId = process.env.WALLET_CONNECT_PROJECT_ID || "YOUR_PROJECT_ID";
const projectId = process.env.WALLET_CONNECT_PROJECT_ID || 'YOUR_PROJECT_ID';

// Create metadata
const metadata = {
name: "SubTrackr",
description: "Subscription Management with Crypto Payments",
url: "https://subtrackr.app",
icons: ["https://subtrackr.app/icon.png"],
name: 'SubTrackr',
description: 'Subscription Management with Crypto Payments',
url: 'https://subtrackr.app',
icons: ['https://subtrackr.app/icon.png'],
redirect: {
native: "subtrackr://",
native: 'subtrackr://',
},
};

Expand All @@ -30,26 +26,26 @@ const config = defaultConfig({ metadata });
// Define supported chains
const mainnet = {
chainId: 1,
name: "Ethereum",
currency: "ETH",
explorerUrl: "https://etherscan.io",
rpcUrl: "https://cloudflare-eth.com",
name: 'Ethereum',
currency: 'ETH',
explorerUrl: 'https://etherscan.io',
rpcUrl: 'https://cloudflare-eth.com',
};

const polygon = {
chainId: 137,
name: "Polygon",
currency: "MATIC",
explorerUrl: "https://polygonscan.com",
rpcUrl: "https://polygon-rpc.com",
name: 'Polygon',
currency: 'MATIC',
explorerUrl: 'https://polygonscan.com',
rpcUrl: 'https://polygon-rpc.com',
};

const arbitrum = {
chainId: 42161,
name: "Arbitrum",
currency: "ETH",
explorerUrl: "https://arbiscan.io",
rpcUrl: "https://arb1.arbitrum.io/rpc",
name: 'Arbitrum',
currency: 'ETH',
explorerUrl: 'https://arbiscan.io',
rpcUrl: 'https://arb1.arbitrum.io/rpc',
};

const chains = [mainnet, polygon, arbitrum];
Expand Down
Loading
Loading