Skip to content

Commit d400171

Browse files
authored
Merge branch 'main' into pe
2 parents 2e065d1 + c4763f8 commit d400171

291 files changed

Lines changed: 41172 additions & 1334 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.

.env.example

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
APP_ENV=development
22

3-
# API Configuration
3+
# ─── API Configuration ────────────────────────────────────────────────────────
4+
# REQUIRED: base URL for the REST API (includes /api prefix)
45
API_BASE_URL=http://localhost:3000/api
56
STAGING_API_URL=https://staging.petchain.app/api
67
PROD_API_URL=https://api.petchain.app/api
78
API_TIMEOUT=10000
89

9-
# Sentry Configuration
10+
# ─── App Metadata ─────────────────────────────────────────────────────────────
11+
APP_NAME=PetChain
12+
APP_VERSION=1.0.0
13+
14+
# ─── Authentication ───────────────────────────────────────────────────────────
15+
JWT_SECRET=your_jwt_secret_key_here
16+
17+
# TOTP seed encryption (AES-256-GCM). Generate with: openssl rand -hex 32
18+
TOTP_ENCRYPTION_KEY=
19+
20+
# ─── Sentry ───────────────────────────────────────────────────────────────────
1021
SENTRY_DSN=
1122
SENTRY_ENABLE_IN_DEV=false
1223

@@ -16,31 +27,24 @@ SENTRY_AUTH_TOKEN=
1627
SENTRY_ORG=petchain
1728
SENTRY_PROJECT=mobile-app
1829

19-
# Update Mechanism
30+
# ─── Store / Update Mechanism ─────────────────────────────────────────────────
2031
IOS_STORE_URL=https://apps.apple.com/app/petchain/id000000000
2132
ANDROID_STORE_URL=https://play.google.com/store/apps/details?id=app.petchain.mobile
2233
MIN_NATIVE_VERSION_IOS=1.0.0
2334
MIN_NATIVE_VERSION_ANDROID=1.0.0
2435

25-
# App Configuration
26-
APP_NAME=PetChain
36+
# ─── Google Services ──────────────────────────────────────────────────────────
37+
# Required for the nearby-vet map and geolocation features
38+
GOOGLE_PLACES_API_KEY=
2739

28-
# Cache
40+
# ─── Cache ────────────────────────────────────────────────────────────────────
2941
MAX_CACHE_SIZE=50
3042

31-
# Pagination
43+
# ─── Pagination ───────────────────────────────────────────────────────────────
3244
PAGINATION_LIMIT=20
3345

34-
# Session Monitoring
46+
# ─── Session Monitoring ───────────────────────────────────────────────────────
3547
MONITORING_ENABLED=true
3648
MONITORING_SAMPLE_RATE=1.0
3749
SESSION_TIMEOUT_MS=1800000
3850
CRASH_FREE_THRESHOLD=99.5
39-
# Authentication
40-
JWT_SECRET=your_jwt_secret_key_here
41-
42-
# TOTP seed encryption (AES-256-GCM). Generate with: openssl rand -hex 32
43-
TOTP_ENCRYPTION_KEY=
44-
45-
# Google Places API (for nearby vet clinics)
46-
GOOGLE_PLACES_API_KEY=
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: Report a reproducible bug or unexpected behaviour
4+
title: "[Bug] "
5+
labels: bug, needs-triage
6+
assignees: ""
7+
---
8+
9+
## Description
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
## Steps to Reproduce
14+
15+
<!--
16+
Provide a minimal, reproducible sequence of steps.
17+
The more precise you are, the faster we can fix it.
18+
-->
19+
20+
1.
21+
2.
22+
3.
23+
4.
24+
25+
## Expected Behaviour
26+
27+
<!-- What did you expect to happen? -->
28+
29+
## Actual Behaviour
30+
31+
<!-- What actually happened? Include error messages or screenshots if relevant. -->
32+
33+
## Screenshots / Screen Recordings
34+
35+
<!-- Drag-and-drop images or videos here, or write "N/A". -->
36+
37+
## Environment
38+
39+
| Field | Value |
40+
| ---------------------- | --------------------------------- |
41+
| App version | e.g. `1.0.0` |
42+
| Platform | iOS / Android / Both |
43+
| OS version | e.g. iOS 17.4 / Android 14 |
44+
| Device model | e.g. iPhone 15 Pro / Pixel 8 |
45+
| Expo SDK | e.g. `56.0.8` |
46+
| Connectivity | Online / Offline / Intermittent |
47+
| Reproducible in prod? | Yes / No / Not tested |
48+
49+
## Logs / Error Output
50+
51+
```
52+
Paste any relevant console output, stack traces, or Sentry event IDs here.
53+
```
54+
55+
## Possible Root Cause
56+
57+
<!-- Optional: do you have a hypothesis about what might be causing this? -->
58+
59+
## Additional Context
60+
61+
<!-- Any other information that might help — related issues, recent changes, links, etc. -->
62+
63+
---
64+
65+
## Checklist
66+
67+
- [ ] I searched existing issues and this is not a duplicate
68+
- [ ] I can reproduce the issue consistently
69+
- [ ] I have attached relevant screenshots / logs
70+
- [ ] I have filled in the **Environment** table above

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
blank_issues_enabled: false
2+
3+
contact_links:
4+
- name: 🔒 Security Vulnerability
5+
url: https://github.com/DogStark/PetChain-MobileApp/security/advisories/new
6+
about: Please use GitHub private vulnerability reporting for security issues — do not file a public issue.
7+
8+
- name: 💬 Community Discussion
9+
url: https://github.com/DogStark/PetChain-MobileApp/discussions
10+
about: Questions, ideas, or general feedback? Start a discussion instead of an issue.
11+
12+
- name: 📧 Email Support
13+
url: mailto:support@petchain.app
14+
about: For account issues or private enquiries, contact us directly.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
name: 🚀 Feature Request
3+
about: Propose a new feature or improvement
4+
title: "[Feature] "
5+
labels: enhancement, needs-triage
6+
assignees: ""
7+
---
8+
9+
## Problem Statement
10+
11+
<!--
12+
What problem does this feature solve?
13+
Describe the motivation without assuming a solution.
14+
Example: "As a pet owner I can't see which vaccines are due next month without manually checking each record."
15+
-->
16+
17+
## Proposed Solution
18+
19+
<!--
20+
Describe the solution you have in mind.
21+
Include UI/UX sketches, pseudo-code, or API shape if helpful.
22+
-->
23+
24+
## Alternative Solutions Considered
25+
26+
<!--
27+
List any alternative approaches you have thought about and why you rejected them.
28+
Write "N/A" if none.
29+
-->
30+
31+
## Acceptance Criteria
32+
33+
<!--
34+
Define what "done" looks like for this feature.
35+
Each criterion should be independently verifiable.
36+
-->
37+
38+
- [ ]
39+
- [ ]
40+
- [ ]
41+
42+
## User Impact
43+
44+
<!--
45+
Who benefits from this feature?
46+
- Affected user role(s): Owner / Vet / Admin / All
47+
- Estimated frequency of use: Daily / Weekly / Rare
48+
- Premium only? Yes / No
49+
-->
50+
51+
**Role(s):**
52+
**Frequency:**
53+
**Premium only:**
54+
55+
## Technical Notes
56+
57+
<!--
58+
Optional: known constraints, relevant files/services, potential risks, or dependencies.
59+
-->
60+
61+
## Screenshots / Mockups
62+
63+
<!-- Drag-and-drop mockups here, or write "N/A". -->
64+
65+
## Additional Context
66+
67+
<!-- Any other context, related issues, or external references. -->
68+
69+
---
70+
71+
## Checklist
72+
73+
- [ ] I searched existing issues and this is not a duplicate
74+
- [ ] The feature is aligned with the PetChain product direction
75+
- [ ] I have defined clear acceptance criteria above

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Description
2+
3+
<!-- What does this PR change and why? Link related issues (e.g. Closes #123). -->
4+
5+
## Type of change
6+
7+
- [ ] Bug fix
8+
- [ ] New feature
9+
- [ ] Breaking change
10+
- [ ] Documentation update
11+
- [ ] Refactor / chore
12+
13+
## How has this been tested?
14+
15+
<!-- Describe the tests you ran and how to reproduce them. -->
16+
17+
## Checklist
18+
19+
- [ ] My code follows the style guidelines of this project
20+
- [ ] I have performed a self-review of my own code
21+
- [ ] I have commented my code, particularly in hard-to-understand areas
22+
- [ ] I have made corresponding changes to the documentation
23+
- [ ] My changes generate no new warnings
24+
- [ ] I have added tests that prove my fix is effective or that my feature works
25+
- [ ] New and existing unit tests pass locally with my changes
26+
27+
## Screenshots (if applicable)
28+
29+
<!-- Add screenshots or screen recordings for UI changes. -->
30+
31+
## Additional context
32+
33+
<!-- Anything else reviewers should know. -->

.github/workflows/ci.yml

Lines changed: 58 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,64 @@ jobs:
145145
- name: Install dependencies
146146
run: npm ci --legacy-peer-deps
147147

148-
- name: Run npm audit
149-
run: npm run audit:high
148+
- name: Run npm audit (fail on high/critical)
149+
id: audit
150+
run: |
151+
# Capture full JSON report for summary output
152+
npm audit --audit-level=high --json > audit-report.json || true
153+
154+
# Parse severity counts
155+
CRITICAL=$(jq '.metadata.vulnerabilities.critical // 0' audit-report.json)
156+
HIGH=$(jq '.metadata.vulnerabilities.high // 0' audit-report.json)
157+
MODERATE=$(jq '.metadata.vulnerabilities.moderate // 0' audit-report.json)
158+
LOW=$(jq '.metadata.vulnerabilities.low // 0' audit-report.json)
159+
160+
# Print summary to CI output
161+
echo ""
162+
echo "══════════════════════════════════════════"
163+
echo " npm audit — Vulnerability Summary "
164+
echo "══════════════════════════════════════════"
165+
echo " 🔴 Critical : $CRITICAL"
166+
echo " 🟠 High : $HIGH"
167+
echo " 🟡 Moderate : $MODERATE"
168+
echo " 🔵 Low : $LOW"
169+
echo "══════════════════════════════════════════"
170+
171+
# Write to GitHub Actions step summary
172+
echo "## 🔒 npm audit Results" >> $GITHUB_STEP_SUMMARY
173+
echo "| Severity | Count |" >> $GITHUB_STEP_SUMMARY
174+
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
175+
echo "| 🔴 Critical | $CRITICAL |" >> $GITHUB_STEP_SUMMARY
176+
echo "| 🟠 High | $HIGH |" >> $GITHUB_STEP_SUMMARY
177+
echo "| 🟡 Moderate | $MODERATE |" >> $GITHUB_STEP_SUMMARY
178+
echo "| 🔵 Low | $LOW |" >> $GITHUB_STEP_SUMMARY
179+
180+
# Fail the build if high or critical vulnerabilities are found
181+
if [ "$CRITICAL" -gt 0 ] || [ "$HIGH" -gt 0 ]; then
182+
echo ""
183+
echo "❌ Build failed: $CRITICAL critical and $HIGH high severity vulnerabilities detected."
184+
echo " Run 'npm audit fix' locally to resolve them."
185+
exit 1
186+
fi
187+
188+
echo "✅ No high or critical vulnerabilities found."
189+
190+
- name: Upload audit report
191+
if: always()
192+
uses: actions/upload-artifact@v4
193+
with:
194+
name: npm-audit-report
195+
path: audit-report.json
196+
retention-days: 30
197+
198+
- name: Snyk scan (optional)
199+
if: env.SNYK_TOKEN != ''
200+
uses: snyk/actions/node@master
201+
continue-on-error: true
202+
env:
203+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
204+
with:
205+
args: --severity-threshold=high
150206

151207
# ─── Storybook build validation ───────────────────────────────────────────
152208
storybook:
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Dependency Compatibility — Expo & React Native
2+
3+
# Issue #989 — block upgrades that drift Expo, React Native or native libraries
4+
# beyond the supported matrix.
5+
6+
on:
7+
push:
8+
branches: [main, master, develop]
9+
paths:
10+
- package.json
11+
- package-lock.json
12+
- app.config.js
13+
- app.json
14+
- eas.json
15+
- scripts/check-dependency-compat.ts
16+
- .github/workflows/dependency-compat.yml
17+
pull_request:
18+
branches: [main, master, develop]
19+
paths:
20+
- package.json
21+
- package-lock.json
22+
- app.config.js
23+
- app.json
24+
- eas.json
25+
- scripts/check-dependency-compat.ts
26+
- .github/workflows/dependency-compat.yml
27+
workflow_dispatch:
28+
29+
concurrency:
30+
group: dependency-compat-${{ github.ref }}
31+
cancel-in-progress: true
32+
33+
jobs:
34+
compat:
35+
name: Expo Doctor + Native Dependency Validation
36+
runs-on: ubuntu-latest
37+
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
42+
- name: Setup Node.js
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: 20
46+
cache: npm
47+
48+
- name: Install dependencies
49+
run: npm ci --legacy-peer-deps
50+
51+
- name: Check Expo / React Native compatibility matrix
52+
run: npx tsx scripts/check-dependency-compat.ts
53+
54+
- name: Peer dependency check (informational)
55+
if: always()
56+
run: npm ls --all --legacy-peer-deps || true

0 commit comments

Comments
 (0)