-
Notifications
You must be signed in to change notification settings - Fork 4
Merge Develop into Main #132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
4046de7
ab3cda2
63670c4
19b9074
9fedae4
1f98e72
f0cb168
c694856
73aa2f6
76a9fc8
8fe4530
3ae30b5
b70a0c6
e6cec80
b1d18cf
12a9cd6
d13b827
debca97
6c86644
222e63a
4692f56
6182b61
d2d8401
e21bb0e
a290175
689f52a
5b6e506
2b472f7
523e67f
f533a3e
92595d8
4a84e3a
9e3e199
af60ba1
3846d01
8cbbda9
1fda051
29819bf
4bcf0eb
aacef1e
fcb3e66
b4f7924
54e2051
37ef3eb
c534610
79101f8
33f9b1e
9adaa16
b502563
12901f2
83f36be
bebf661
1c2b8c1
0405aa7
c214965
d9707aa
2273e98
3eb25cb
1c5c463
0ead558
64846f4
62c2a18
73a9148
4aba5a8
d095b67
af0da93
15448fc
78b9b3e
979ac32
547d344
da46193
c20b04a
e23905f
63a5792
e6cd7bc
147aed0
1bc11cd
47aac66
6b4c158
d20a28f
a9d16bc
56559de
d3c00d7
cb5a75e
50bff04
47d3710
08570ce
46daaf8
aca0fc9
6c1b186
7bd7800
6d63062
607656a
a14f356
e7f23a2
90afcd5
f659444
fe0e141
359bed3
ee52988
b33cc92
07ee1c8
8a802ad
333298f
ddd5440
cf952ba
a21da83
e1ab08f
5a9064c
5e20536
9146358
8ebf2e8
30b0c66
ed0db72
0a9f6b7
4b5ae4c
cd44bec
37551cd
292b5a5
cc631a5
222fde3
bdcd9f3
e3862e0
ec07ec0
2bd30a0
920356a
d5ec8da
20c4c6d
0b210c5
dbac108
023ffa4
b03c39c
8edfdf3
9979735
f2a4051
a3fae91
290664c
56cab62
39e3f80
f8e7618
6ada12d
3ce3c41
0d1210e
300c8f9
ad6a8ab
cb52247
cd6a408
c58d8a6
bbbeaa8
93f7857
c7af897
8bd8b9b
c343094
e4f460c
d928d46
41615ab
c762806
d987f85
81b0512
21e8a85
adac224
1ed3261
eac7b12
df0c4b4
59f6ec8
6c55d6a
287ad01
d6d59f1
f6dc001
522f866
71feda8
adbf43e
dd19bec
1bc826e
f3756e6
7181a0d
810a462
efdfe3f
5cff563
820b051
e2f1a65
1ebd981
4f282e4
52de468
31ae320
df35186
b2aea07
58b8d54
b162ebf
dfbda72
6528beb
e5c3488
b749071
d8dcd63
e5a1a9e
a1b5c5c
abf7192
52e2cdd
26e72d2
2269176
003bf33
04a77b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# External libraries and dependencies | ||
packages/contracts/lib/ | ||
packages/indexer/ | ||
**/node_modules/ | ||
**/generated/ | ||
**/*.generated.* | ||
**/*.bs.js | ||
|
||
# Build outputs | ||
**/dist/ | ||
**/build/ | ||
**/out/ | ||
**/cache/ | ||
**/broadcast/ | ||
**/coverage/ | ||
|
||
# CSS files (handled by other tools) | ||
**/*.css | ||
|
||
# Environment and config files | ||
**/*.env | ||
**/*.log | ||
**/.DS_Store | ||
**/.pnp.* | ||
**/bun.lockb | ||
**/lcov.info | ||
**/package-lock.json | ||
**/pnpm-lock.yaml | ||
**/yarn.lock |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
description: Green Goods — project-wide engineering principles, tooling, DX, and repo workflow. | ||
alwaysApply: false | ||
--- | ||
# Green Goods — Project-Wide Rules | ||
|
||
## Monorepo & Packages | ||
- This is a pnpm workspace monorepo with packages: `client` (PWA), `api` (backend), `contracts` (Foundry), `indexer` (Envio), `mcp` (Model Context Protocol server). Keep inter-package boundaries clean; share via published interfaces, not deep imports. | ||
|
||
## Tooling & Quality Gates | ||
- Use **TypeScript strict** everywhere. Generate small, focused modules with explicit exports. | ||
- **Formatting/Linting:** use **Biome** for formatting and **oxlint (0xlint)** for linting; do not add Prettier/ESLint. Ensure staged changes pass hooks (Husky runs format/lint/tests). | ||
- Keep CI fast: write tests that are deterministic and parallel-safe. Prefer unit tests at package level; add E2E in `/tests` for cross-package flows. | ||
|
||
## Secrets & Env | ||
- Never commit secrets. Provide `.env.example` in each package with doc comments. Read from `process.env` at the edge; validate via Zod (or package-native schema). | ||
|
||
## Git & PRs | ||
- Conventional commits. Small PRs with: summary, screenshots/GIFs for UI, checklist (lint/type/tests), and notes on DX/ops impact. | ||
- When adding features, update relevant READMEs and runbooks in `/docs`. | ||
|
||
## Observability & Errors | ||
- Standardize error shapes (`{ code, message, details? }`) across API/client. In UI, surface friendly copy + a “Copy error details” affordance. | ||
|
||
## Accessibility & i18n | ||
- Follow WCAG AA, keyboard navigability, focus rings, ARIA where needed. All user-facing copy in i18n dictionaries; avoid hard-coded strings. | ||
|
||
# Lifecycle & PR Expectations | ||
|
||
## Stage-gated deliverables | ||
- **Seedling/Alpha:** ship 1–2 core features, a landing page, brand kit basics, ToS/Privacy, basic QA notes. | ||
- **Beta:** refine flows, add user guide, GTM notes, app metrics (active users, task completion, photo doc rate). | ||
- **Release:** perf budgets, error budgets, observability, and scale/readiness items documented. | ||
|
||
## Every Feature PR Must Include | ||
- Update to `.env.example` if new env vars introduced. | ||
- Tests: unit (touched files ≥80% coverage) + at least one E2E happy path if user-critical. | ||
- Migration/rollback notes if data or contracts change. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
# ========================================== | ||
# GREEN GOODS MONOREPO ENVIRONMENT CONFIG | ||
# ========================================== | ||
# Copy this file to .env and fill in your actual values | ||
# This root .env file is used by all packages when running the full development environment | ||
# | ||
# Quick Setup: | ||
# 1. cp .env.example .env | ||
# 2. Edit .env with your actual values | ||
# 3. pnpm i (installs dependencies) | ||
# 4. pnpm dev (starts all services) | ||
# | ||
# For package isolation, see individual package .env.example files | ||
|
||
# ========================================== | ||
# ANALYTICS & MONITORING 📈 | ||
# ========================================== | ||
# Get from: https://posthog.com | ||
VITE_PUBLIC_POSTHOG_KEY="your-posthog-key" # 📱 Client: Analytics tracking | ||
VITE_PUBLIC_POSTHOG_HOST="your-posthog-host" # 📱 Client: Analytics host (e.g., https://app.posthog.com) | ||
|
||
# ========================================== | ||
# PRIVY AUTHENTICATION 🔐 | ||
# ========================================== | ||
# Get these from: https://console.privy.io | ||
VITE_PRIVY_APP_ID="your-privy-app-id" # 📱 Client: Public Privy app ID | ||
PRIVY_APP_ID="your-privy-app-id" # 🖥️ API: Same as above for server-side | ||
PRIVY_APP_SECRET_ID="your-privy-app-secret" # 🔑 API: Server-side Privy secret | ||
PRIVY_CLIENT_ID="your-privy-client-id" # 🔗 Contracts: Alternative client ID | ||
|
||
# WalletConnect/Reown AppKit | ||
VITE_WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here | ||
|
||
# Privy Test Accounts (for E2E testing) 🧪 | ||
# Dashboard: User management > Authentication > Advanced > Enable test accounts | ||
PRIVY_TEST_EMAIL="[email protected]" # 📧 Replace with your test email | ||
PRIVY_TEST_PHONE="+1 555 555 3487" # 📱 Replace with your test phone | ||
PRIVY_TEST_OTP="123456" # 🔢 Replace with your test OTP | ||
|
||
# ========================================== | ||
# TESTING CONFIGURATION 🧪 | ||
# ========================================== | ||
SKIP_WEBSERVER="true" # �� Tests: Skip Playwright web server startup | ||
VITE_DESKTOP_DEV="true" # 📱 Client: Allow desktop development | ||
|
||
# ========================================== | ||
# FILE STORAGE (Pinata) 📁 | ||
# ========================================== | ||
# Get from: https://pinata.cloud | ||
VITE_PINATA_JWT="your-pinata-jwt" # 📱 Client: Public file uploads | ||
PINATA_JWT="your-pinata-jwt" # 📜 Contracts: Can be the same as above or different | ||
|
||
# ========================================== | ||
# INDEXER | ||
# ========================================== | ||
VITE_ENVIO_INDEXER_URL="your-indexer-url" # 📱 Client: GraphQL indexer endpoint | ||
ENVIO_API_TOKEN="your-envio-api-token" # 🔍 Indexer: Get from https://envio.dev/app/api-tokens | ||
|
||
# ========================================== | ||
# API CONFIGURATION 🖥️ | ||
# ========================================== | ||
PORT="3000" # 🚪 API: Server port | ||
|
||
# Database URLs 🗄️ | ||
POSTGRES_URL="your-postgres-url" # 🐘 API: Main database | ||
REDIS_URL="your-redis-url" # 🔴 API: Cache/sessions | ||
|
||
# ========================================== | ||
# BLOCKCHAIN CONFIGURATION ⛓️ | ||
# ========================================== | ||
VITE_CHAIN_ID="42161" # 📱 Client: Current chain (42161=Arbitrum, 84532=Base Sepolia, 42220=Celo) | ||
NODE_ENV="development" # 🌍 All: Environment mode | ||
|
||
# Private Keys (KEEP SECURE!) 🔐 | ||
PRIVATE_KEY="your-deployment-private-key" # 🔑 Contracts/API: Without 0x prefix | ||
ALCHEMY_API_KEY="your-alchemy-api-key" # 🔗 API: For blockchain interactions | ||
|
||
# Network RPC URLs 🌐 | ||
LOCALHOST_RPC_URL="http://localhost:8545" | ||
SEPOLIA_RPC_URL="https://sepolia.infura.io/v3/YOUR_INFURA_KEY" | ||
ARBITRUM_RPC_URL="https://arbitrum-mainnet.infura.io/v3/YOUR_INFURA_KEY" | ||
BASE_RPC_URL="https://base-mainnet.infura.io/v3/YOUR_INFURA_KEY" | ||
BASE_SEPOLIA_RPC_URL="https://sepolia.base.org" | ||
OPTIMISM_RPC_URL="https://optimism-mainnet.infura.io/v3/YOUR_INFURA_KEY" | ||
CELO_RPC_URL="https://forno.celo.org" | ||
|
||
# ========================================== | ||
# CONTRACT DEPLOYMENT ⚙️ | ||
# ========================================== | ||
# Block Explorer API Keys 🔍 | ||
ETHERSCAN_API_KEY="your-etherscan-api-key" # 📜 Contracts: For verification | ||
|
||
# Deployment Configuration 🚀 | ||
DEPLOY_WITH_SAMPLE_DATA="false" # 📜 Contracts: Include test data | ||
DEPLOYMENT_SALT="0x6551655165516551655165516551655165516551655165516551655165516551" | ||
GUARDIAN_ADDRESS="" # 📜 Contracts: Defaults to deployer | ||
|
||
# Gas Configuration (optional) ⛽ | ||
GAS_PRICE_GWEI="" # 📜 Contracts: Manual gas price | ||
GAS_LIMIT="" # 📜 Contracts: Manual gas limit | ||
|
||
# Fork Configuration (optional) 🍴 | ||
FORK_BLOCK_NUMBER="" # 📜 Contracts: For testing | ||
FORK_CHAIN_ID="" # 📜 Contracts: For testing | ||
|
||
# External Services (optional) 🌐 | ||
BLOCKNATIVE_API_KEY="" # 📜 Contracts: Gas optimization |
Original file line number | Diff line number | Diff line change | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,113 @@ | |||||||||||||||||||||||
name: Admin Dashboard Tests | |||||||||||||||||||||||
|
|||||||||||||||||||||||
on: | |||||||||||||||||||||||
push: | |||||||||||||||||||||||
branches: [ main, develop, 'cursor/implement-admin-dashboard-package-*' ] | |||||||||||||||||||||||
paths: | |||||||||||||||||||||||
- 'packages/admin/**' | |||||||||||||||||||||||
pull_request: | |||||||||||||||||||||||
branches: [ main, develop ] | |||||||||||||||||||||||
paths: | |||||||||||||||||||||||
- 'packages/admin/**' | |||||||||||||||||||||||
|
|||||||||||||||||||||||
jobs: | |||||||||||||||||||||||
unit-tests: | |||||||||||||||||||||||
runs-on: ubuntu-latest | |||||||||||||||||||||||
steps: | |||||||||||||||||||||||
- name: Checkout code | |||||||||||||||||||||||
uses: actions/checkout@v4 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Setup Node.js | |||||||||||||||||||||||
uses: actions/setup-node@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
node-version: '20' | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Setup pnpm | |||||||||||||||||||||||
uses: pnpm/action-setup@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
version: 8 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Install dependencies | |||||||||||||||||||||||
run: pnpm install --frozen-lockfile | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Run unit tests | |||||||||||||||||||||||
run: | | |||||||||||||||||||||||
cd packages/admin | |||||||||||||||||||||||
pnpm test:unit | |||||||||||||||||||||||
env: | |||||||||||||||||||||||
CI: true | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Generate coverage report | |||||||||||||||||||||||
run: | | |||||||||||||||||||||||
cd packages/admin | |||||||||||||||||||||||
pnpm test:coverage | |||||||||||||||||||||||
env: | |||||||||||||||||||||||
CI: true | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Upload coverage reports | |||||||||||||||||||||||
uses: codecov/codecov-action@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
directory: packages/admin/coverage | |||||||||||||||||||||||
flags: admin-dashboard | |||||||||||||||||||||||
|
|||||||||||||||||||||||
integration-tests: | |||||||||||||||||||||||
runs-on: ubuntu-latest | |||||||||||||||||||||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |||||||||||||||||||||||
steps: | |||||||||||||||||||||||
- name: Checkout code | |||||||||||||||||||||||
uses: actions/checkout@v4 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Setup Node.js | |||||||||||||||||||||||
uses: actions/setup-node@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
node-version: '20' | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Setup pnpm | |||||||||||||||||||||||
uses: pnpm/action-setup@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
version: 8 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Install Foundry | |||||||||||||||||||||||
uses: foundry-rs/foundry-toolchain@v1 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Install dependencies | |||||||||||||||||||||||
run: pnpm install --frozen-lockfile | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Run integration tests | |||||||||||||||||||||||
run: | | |||||||||||||||||||||||
cd packages/admin | |||||||||||||||||||||||
pnpm test:integration | |||||||||||||||||||||||
env: | |||||||||||||||||||||||
CI: true | |||||||||||||||||||||||
VITEST_INTEGRATION: true | |||||||||||||||||||||||
VITE_BASE_SEPOLIA_RPC: ${{ secrets.BASE_SEPOLIA_RPC }} | |||||||||||||||||||||||
TEST_PRIVATE_KEY: ${{ secrets.TEST_PRIVATE_KEY }} | |||||||||||||||||||||||
|
|||||||||||||||||||||||
lint-and-format: | |||||||||||||||||||||||
Comment on lines
+54
to
+86
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 17 days ago To fix the problem, you should add a Where to change: permissions:
contents: read Additional info:
Suggested changeset
1
.github/workflows/admin-tests.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
|||||||||||||||||||||||
runs-on: ubuntu-latest | |||||||||||||||||||||||
steps: | |||||||||||||||||||||||
- name: Checkout code | |||||||||||||||||||||||
uses: actions/checkout@v4 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Setup Node.js | |||||||||||||||||||||||
uses: actions/setup-node@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
node-version: '20' | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Setup pnpm | |||||||||||||||||||||||
uses: pnpm/action-setup@v4 | |||||||||||||||||||||||
with: | |||||||||||||||||||||||
version: 8 | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Install dependencies | |||||||||||||||||||||||
run: pnpm install --frozen-lockfile | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Run linting | |||||||||||||||||||||||
run: | | |||||||||||||||||||||||
cd packages/admin | |||||||||||||||||||||||
pnpm lint | |||||||||||||||||||||||
|
|||||||||||||||||||||||
- name: Check formatting | |||||||||||||||||||||||
run: | | |||||||||||||||||||||||
cd packages/admin | |||||||||||||||||||||||
pnpm format --check | |||||||||||||||||||||||
Comment on lines
+87
to
+113
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Copilot AutofixAI 17 days ago The best way to fix this problem is to explicitly add a
Suggested changeset
1
.github/workflows/admin-tests.yml
Copilot is powered by AI and may make mistakes. Always verify output.
Positive FeedbackNegative Feedback
Refresh and try again.
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
|
||
# Ensure nvm is available and use Node 22 if possible | ||
export NVM_DIR="${NVM_DIR:-$HOME/.nvm}" | ||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" | ||
# Try to use project Node version (22) silently; ignore errors if nvm is missing | ||
nvm use --silent 22 >/dev/null 2>&1 || true | ||
|
||
# Ensure pnpm is available (via corepack if needed) | ||
if ! command -v pnpm >/dev/null 2>&1; then | ||
if command -v corepack >/dev/null 2>&1; then | ||
corepack enable >/dev/null 2>&1 || true | ||
corepack prepare pnpm@latest --activate >/dev/null 2>&1 || true | ||
fi | ||
fi | ||
|
||
# Run lint-staged using pnpm if present, otherwise fall back to npx | ||
if command -v pnpm >/dev/null 2>&1; then | ||
pnpm lint-staged | ||
else | ||
npx --no-install lint-staged | ||
fi | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env sh | ||
|
||
echo "🔍 Running format check and linting before push..." | ||
|
||
# Run format check first | ||
npx pnpm format:check | ||
|
||
# Run linting | ||
npx pnpm lint | ||
|
||
echo "✅ Pre-push checks passed!" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
v20 | ||
v22 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/crates/oxc_linter/src/config/oxlintrc.schema.json", | ||
"plugins": ["react", "typescript", "jsx-a11y"], | ||
"env": { | ||
"browser": true, | ||
"es2021": true, | ||
"node": true | ||
}, | ||
"ignorePatterns": [ | ||
"api/**", | ||
"dev-dist/**", | ||
"dist/**", | ||
"node_modules/**", | ||
"**/*.test.ts", | ||
"**/*.test.tsx", | ||
"**/__tests__/**" | ||
], | ||
"rules": { | ||
"react/react-in-jsx-scope": "off", | ||
"react/prop-types": "off", | ||
"react/jsx-uses-react": "error", | ||
"react/jsx-uses-vars": "error", | ||
"react/no-unescaped-entities": "warn", | ||
"react/no-unknown-property": "error", | ||
"@typescript-eslint/no-unused-vars": "warn", | ||
"@typescript-eslint/no-explicit-any": "warn", | ||
"@typescript-eslint/prefer-const": "error", | ||
"no-console": "warn", | ||
"no-debugger": "error", | ||
"no-unused-vars": "warn", | ||
"prefer-const": "error", | ||
"no-var": "error", | ||
"eqeqeq": "error", | ||
"no-duplicate-imports": "error" | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "detect" | ||
} | ||
} | ||
} |
Check warning
Code scanning / CodeQL
Workflow does not contain permissions Medium
Copilot Autofix
AI 17 days ago
To resolve this issue, add an explicit
permissions
block to the workflow YAML. This can be added at the root of the workflow (above or below thename:
andon:
keys, but beforejobs:
) to serve as the default for all jobs. Since the workflow only needs to check out code and upload coverage reports, the minimal permission needed is typicallycontents: read
. If thecodecov/codecov-action@v4
step or any other step requires additional permissions, these can be expanded appropriately. However, in almost all CI testing/coverage/linting jobs,contents: read
suffices.Change needed: Insert at the root of
.github/workflows/admin-tests.yml
(aftername:
and before or afteron:
), the following:No new methods, imports, or definitions are necessary—just this addition to the workflow file.