Skip to content

Commit cdceff7

Browse files
committed
feat: squashed routes branch with secrets removed
Co-authored-by: od-hunter <146340502+od-hunter@users.noreply.github.com> Co-authored-by: abimbolaalabi <ibrahimade92@gmail.com> Includes all changes from the routes branch history: - Redis distributed cache for plan metadata - All previous features, fixes, and optimizations - Hardcoded secrets replaced with environment variables
1 parent 5eb04e6 commit cdceff7

865 files changed

Lines changed: 94363 additions & 8807 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.detoxrc.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = {
77
args: {
88
$0: 'jest',
99
config: 'e2e/jest.config.js',
10+
maxWorkers: process.env.E2E_MAX_WORKERS || 1,
1011
},
1112
jest: {
1213
setupTimeout: 120000,
@@ -17,13 +18,13 @@ module.exports = {
1718
type: 'ios.app',
1819
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/SubTrackr.app',
1920
build:
20-
'xcodebuild -workspace ios/subtrackr.xcworkspace -scheme subtrackr -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
21+
'xcodebuild -workspace ios/SubTrackr.xcworkspace -scheme SubTrackr -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build',
2122
},
2223
'ios.release': {
2324
type: 'ios.app',
2425
binaryPath: 'ios/build/Build/Products/Release-iphonesimulator/SubTrackr.app',
2526
build:
26-
'xcodebuild -workspace ios/subtrackr.xcworkspace -scheme subtrackr -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
27+
'xcodebuild -workspace ios/SubTrackr.xcworkspace -scheme SubTrackr -configuration Release -sdk iphonesimulator -derivedDataPath ios/build',
2728
},
2829
'android.debug': {
2930
type: 'android.apk',
@@ -83,6 +84,15 @@ module.exports = {
8384
app: 'android.release',
8485
},
8586
},
87+
behavior: {
88+
init: {
89+
exposeGlobals: true,
90+
reinstallApp: true,
91+
},
92+
cleanup: {
93+
shutdownDevice: false,
94+
},
95+
},
8696
artifacts: {
8797
rootDir: 'artifacts',
8898
plugins: {

.env.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SubTrackr Backend - Environment Variables
2+
# Copy this file to .env and fill in your values.
3+
4+
# PostgreSQL
5+
DB_HOST=localhost
6+
DB_PORT=5432
7+
DB_NAME=subtrackr
8+
DB_USER=postgres
9+
# Required: set a strong password
10+
DB_PASSWORD=
11+
12+
# Redis
13+
REDIS_HOST=localhost
14+
REDIS_PORT=6379
15+
# Optional: set if Redis requires authentication
16+
REDIS_PASSWORD=
17+
REDIS_DB=0
18+
REDIS_DEFAULT_TTL_SECONDS=3600
19+
REDIS_CONNECT_TIMEOUT_MS=5000

.eslintrc.json

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,32 @@
1111
},
1212
"rules": {
1313
"prettier/prettier": "error",
14-
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
14+
"@typescript-eslint/no-unused-vars": [
15+
"error",
16+
{
17+
"argsIgnorePattern": "^_",
18+
"varsIgnorePattern": "^_",
19+
"caughtErrorsIgnorePattern": "^_",
20+
"destructuredArrayIgnorePattern": "^_"
21+
}
22+
],
1523
"@typescript-eslint/explicit-function-return-type": "off",
1624
"@typescript-eslint/no-explicit-any": "warn",
17-
"no-console": ["warn", { "allow": ["warn", "error"] }]
25+
"no-console": ["warn", { "allow": ["warn", "error"] }],
26+
"import/no-unresolved": [
27+
"error",
28+
{
29+
"ignore": [
30+
"@sentry/react-native",
31+
"bcryptjs",
32+
"expo-image",
33+
"expo-linking",
34+
"expo-local-authentication",
35+
"react-native-performance",
36+
"../../backend/services/shared/monitoring"
37+
]
38+
}
39+
]
1840
},
1941
"ignorePatterns": [
2042
"node_modules/",
@@ -28,7 +50,8 @@
2850
"acbu-backend/",
2951
"src/animations/",
3052
"stellarlend/",
31-
"stellarlend-pr282/"
53+
"stellarlend-pr282/",
54+
"vscode-extension/"
3255
],
3356
"settings": {
3457
"import/resolver": {
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Bundle Size Analysis
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
analyze:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v6
12+
- uses: actions/setup-node@v6
13+
with:
14+
node-version: '20'
15+
cache: npm
16+
- run: npm ci
17+
- run: npx expo export --platform web --output-dir dist
18+
- name: Analyze bundle
19+
run: |
20+
npx size-limit
21+
echo "Bundle size analysis complete"

.github/workflows/cdn-deploy.yml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: CDN Configuration Deploy
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
paths:
7+
- 'infra/fastly/**'
8+
- '.github/workflows/cdn-deploy.yml'
9+
workflow_dispatch:
10+
inputs:
11+
provider:
12+
description: 'CDN provider'
13+
required: true
14+
default: 'fastly'
15+
type: choice
16+
options:
17+
- fastly
18+
- cloudflare
19+
20+
env:
21+
NODE_VERSION: '20'
22+
23+
jobs:
24+
validate-vcl:
25+
name: Validate Fastly VCL
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@v4
30+
31+
- name: Check VCL syntax (basic)
32+
run: |
33+
test -f infra/fastly/snippets/recv.vcl
34+
test -f infra/fastly/snippets/fetch.vcl
35+
grep -q "s-maxage" infra/fastly/snippets/fetch.vcl
36+
grep -q "/plans" infra/fastly/snippets/recv.vcl
37+
echo "VCL snippet validation passed"
38+
39+
deploy-fastly:
40+
name: Deploy Fastly VCL Snippet
41+
needs: validate-vcl
42+
if: >
43+
github.event_name == 'push' ||
44+
(github.event_name == 'workflow_dispatch' && github.event.inputs.provider == 'fastly')
45+
runs-on: ubuntu-latest
46+
environment: production
47+
steps:
48+
- name: Checkout code
49+
uses: actions/checkout@v4
50+
51+
- name: Deploy VCL snippet to Fastly
52+
env:
53+
FASTLY_API_TOKEN: ${{ secrets.FASTLY_API_TOKEN }}
54+
FASTLY_SERVICE_ID: ${{ secrets.FASTLY_SERVICE_ID }}
55+
run: |
56+
if [ -z "$FASTLY_API_TOKEN" ] || [ -z "$FASTLY_SERVICE_ID" ]; then
57+
echo "Fastly credentials not configured — skipping deploy (CI validation only)"
58+
exit 0
59+
fi
60+
chmod +x scripts/deploy-fastly-vcl.sh
61+
./scripts/deploy-fastly-vcl.sh infra/fastly/snippets
62+
63+
deploy-cloudflare:
64+
name: Deploy Cloudflare Cache Rules
65+
needs: validate-vcl
66+
if: github.event_name == 'workflow_dispatch' && github.event.inputs.provider == 'cloudflare'
67+
runs-on: ubuntu-latest
68+
environment: production
69+
steps:
70+
- name: Checkout code
71+
uses: actions/checkout@v4
72+
73+
- name: Verify Cloudflare cache tag support
74+
env:
75+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
76+
CLOUDFLARE_ZONE_ID: ${{ secrets.CLOUDFLARE_ZONE_ID }}
77+
run: |
78+
if [ -z "$CLOUDFLARE_API_TOKEN" ] || [ -z "$CLOUDFLARE_ZONE_ID" ]; then
79+
echo "Cloudflare credentials not configured — skipping deploy"
80+
exit 0
81+
fi
82+
echo "Cloudflare purge-by-tag configured via CDN_PROVIDER=cloudflare"
83+
echo "Origin sets Cache-Tag header alongside Surrogate-Key"
84+
85+
run-cache-tests:
86+
name: CDN Cache Unit Tests
87+
needs: validate-vcl
88+
runs-on: ubuntu-latest
89+
steps:
90+
- name: Checkout code
91+
uses: actions/checkout@v4
92+
93+
- name: Setup Node.js
94+
uses: actions/setup-node@v4
95+
with:
96+
node-version: ${{ env.NODE_VERSION }}
97+
cache: 'npm'
98+
99+
- name: Install dependencies
100+
run: npm ci --legacy-peer-deps
101+
102+
- name: Run CDN cache tests
103+
run: npm run test:cdn

0 commit comments

Comments
 (0)