Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/catalog-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
workflow_dispatch: # Manual trigger

env:
# Centralized config: update these when URLs or versions change
PROD_API_URL: https://api.osc.earth/nemar
DEV_API_URL: https://nemar-api-dev.shirazi-10f.workers.dev
# Centralized config: update these when URLs or versions change.
PROD_API_URL: https://api.nemar.org
DEV_API_URL: https://nemar-api-dev.sccn-org.workers.dev
NEMAR_API_URL: https://nemar.org/api/dataexplorer/datapipeline

jobs:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/deploy-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# Dev has its own D1 database (nemar-db-dev) since v0.7.21
run: npx wrangler d1 migrations apply nemar-db-dev --remote --env dev
# Dev has its own D1 database (nemar-db-dev) since v0.7.21.
run: npx wrangler d1 migrations apply nemar-db-dev --remote --env dev -c wrangler-sccn.toml

- name: Deploy to Cloudflare Workers (dev)
working-directory: backend
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: npx wrangler deploy --env dev
run: npx wrangler deploy --env dev -c wrangler-sccn.toml

deploy-production:
needs: detect-environment
Expand Down Expand Up @@ -89,11 +89,11 @@ jobs:
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: npx wrangler d1 migrations apply nemar-db --remote
run: npx wrangler d1 migrations apply nemar-db --remote -c wrangler-sccn.toml

- name: Deploy to Cloudflare Workers (production)
working-directory: backend
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
run: npx wrangler deploy
run: npx wrangler deploy -c wrangler-sccn.toml
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ jobs:
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: pages deploy site --project-name=nemar-cli
# nemar-docs Pages project is bound to docs.nemar.org.
command: pages deploy site --project-name=nemar-docs
4 changes: 2 additions & 2 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ jobs:
if: steps.version.outputs.branch == 'dev'
run: |
echo "Replacing production API URL with dev API URL in dist/index.js"
sed -i 's|https://api.osc.earth/nemar|https://nemar-api-dev.shirazi-10f.workers.dev|g' dist/index.js
sed -i 's|https://api.nemar.org|https://nemar-api-dev.sccn-org.workers.dev|g' dist/index.js
echo "Verifying replacement:"
grep -c "nemar-api-dev.shirazi-10f.workers.dev" dist/index.js || (echo "ERROR: URL replacement failed" && exit 1)
grep -c "nemar-api-dev.sccn-org.workers.dev" dist/index.js || (echo "ERROR: URL replacement failed" && exit 1)
echo "✓ Dev backend URL injected successfully"

- name: Publish to npm
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ jobs:
- name: Run CLI unit tests
env:
# Use dev API - no rate limiting
TEST_API_URL: https://nemar-api-dev.shirazi-10f.workers.dev
TEST_API_URL: https://nemar-api-dev.sccn-org.workers.dev
TEST_ADMIN_API_KEY: ${{ secrets.TEST_ADMIN_API_KEY }}
TEST_USER_API_KEY: ${{ secrets.TEST_USER_API_KEY }}
run: bun test test/cli.test.ts
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- name: Run API tests against dev environment
env:
# Use dev API - no rate limiting
TEST_API_URL: https://nemar-api-dev.shirazi-10f.workers.dev
TEST_API_URL: https://nemar-api-dev.sccn-org.workers.dev
TEST_ADMIN_API_KEY: ${{ secrets.TEST_ADMIN_API_KEY }}
TEST_USER_API_KEY: ${{ secrets.TEST_USER_API_KEY }}
run: bun test test/api.test.ts
Expand Down Expand Up @@ -192,7 +192,7 @@ jobs:

- name: Run E2E sandbox tests
env:
TEST_API_URL: https://nemar-api-dev.shirazi-10f.workers.dev
TEST_API_URL: https://nemar-api-dev.sccn-org.workers.dev
TEST_USER_API_KEY: ${{ secrets.TEST_USER_API_KEY }}
NPM_TAG: ${{ steps.npm-tag.outputs.tag }}
run: bun test test/e2e-sandbox.test.ts
Expand Down Expand Up @@ -235,7 +235,7 @@ jobs:

- name: Run E2E upload tests against dev environment
env:
TEST_API_URL: https://nemar-api-dev.shirazi-10f.workers.dev
TEST_API_URL: https://nemar-api-dev.sccn-org.workers.dev
TEST_ADMIN_API_KEY: ${{ secrets.TEST_ADMIN_API_KEY }}
TEST_USER_API_KEY: ${{ secrets.TEST_USER_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
Expand Down Expand Up @@ -267,7 +267,7 @@ jobs:

- name: Run Zenodo sandbox tests
env:
TEST_API_URL: https://nemar-api-dev.shirazi-10f.workers.dev
TEST_API_URL: https://nemar-api-dev.sccn-org.workers.dev
TEST_ADMIN_API_KEY: ${{ secrets.TEST_ADMIN_API_KEY }}
RUN_ZENODO_TESTS: "true"
TEST_DATASET_ID: "nm099999"
Expand Down
9 changes: 7 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ The backend code (`ORG_NAME = "nemarDatasets"` in `backend/src/services/github.t
## Architecture Overview

### Backend Infrastructure
- **API URL:** `https://api.osc.earth/nemar` (production)
- **API URL:** `https://api.nemar.org` (canonical production, SCCN account)
- **Workers URL:** `https://nemar-api.sccn-org.workers.dev` (SCCN account fallback for the same worker)
- **Legacy URL:** `https://api.osc.earth/nemar` (personal account, MAINTENANCE_MODE=read-only buffer for old CLIs; sunset in Phase 11)
- **Platform:** Cloudflare Workers + D1 (SQLite)
- **Note:** Old `nemar-api.shirazi-10f.workers.dev` URL is disabled
- **Cloudflare accounts:** Managed via `npx cfman wrangler --account <name>`
- `neuromechanist` - Personal account (current production)
- `sccn` - SCCN institutional account (migration target, Epic #314)
- **Wrangler configs:** `backend/wrangler.toml` (personal), `backend/wrangler-sccn.toml` (SCCN)

### S3 Bucket Structure
```
Expand Down
Loading
Loading