Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2bb5eb0
feat(e2e): add Bitcoin and Lightning buy/sell tests (#866)
TaprootFreak Jan 7, 2026
26873f2
feat(e2e): add linked Ethereum address tests (buy/sell) (#869)
TaprootFreak Jan 7, 2026
2f8b0e3
feat(e2e): add Lightning sell flow tests (#868)
TaprootFreak Jan 7, 2026
bae3080
feat(e2e): add linked Lightning address tests (buy/sell) (#870)
TaprootFreak Jan 7, 2026
98a685c
fix: add targetBlockchains dependency to swap screen useEffect (#873)
TaprootFreak Jan 8, 2026
af676bc
fix: add userAddresses.length dependency to swap screen useEffect (#874)
TaprootFreak Jan 8, 2026
715c417
fix: respect assetOut URL parameter when selecting target blockchain …
TaprootFreak Jan 8, 2026
8ab447a
test(e2e): add swap Lightning URL parameter baseline screenshots (#876)
TaprootFreak Jan 8, 2026
7401493
feat(compliance): add country dropdown to bank tx return screen (#872)
bernd2022 Jan 8, 2026
71b654e
feat: added new quote error
davidleomay Jan 8, 2026
9d3e2d8
feat: enable Lightning as source asset in swap screen (#877)
TaprootFreak Jan 9, 2026
5237372
refactor(e2e): improve dialog handling and simplify sell flow (#879)
TaprootFreak Jan 9, 2026
9dcf61a
test: add Bitcoin↔Lightning swap E2E tests with baseline screenshots …
TaprootFreak Jan 9, 2026
853635e
fix: removed service worker
davidleomay Jan 9, 2026
b460b71
fix: allow address selection when session has no address (#882)
bernd2022 Jan 9, 2026
09b3f7c
chore(bank refund): refactoring
TaprootFreak Jan 9, 2026
003ae3a
test(e2e): add mail login and subpages E2E tests (#886)
TaprootFreak Jan 9, 2026
22f1907
fix: address connect state fix
davidleomay Jan 9, 2026
5c87166
refactor: consolidate environment files into single .env (#888)
TaprootFreak Jan 9, 2026
1fb32b4
fix(e2e): improve wallet selection detection in subpages tests (#889)
TaprootFreak Jan 9, 2026
04a0c26
fix: remove unused imports and variables (#890)
TaprootFreak Jan 9, 2026
d348a6a
fix(ci): correct widget chunk file paths in copy step (#892)
TaprootFreak Jan 9, 2026
ed89011
fix: remove unused variables in test files (#891)
TaprootFreak Jan 9, 2026
bbbe794
fix: resolve critical form-data vulnerability (#883)
bernd2022 Jan 9, 2026
6e63959
chore: add CODEOWNERS file (#897)
TaprootFreak Jan 9, 2026
68d89b9
fix(ci): correct WASM file path in widget copy step (#896)
TaprootFreak Jan 9, 2026
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
3 changes: 0 additions & 3 deletions .env.dev

This file was deleted.

3 changes: 0 additions & 3 deletions .env.e2e

This file was deleted.

3 changes: 0 additions & 3 deletions .env.loc

This file was deleted.

3 changes: 0 additions & 3 deletions .env.prd

This file was deleted.

29 changes: 29 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# DFX Services - Environment Configuration
# Copy this file to .env and adjust values as needed
#
# IMPORTANT: Never commit .env to git!

# === App Configuration ===
PORT=3001
REACT_APP_PUBLIC_URL=http://localhost:3001

# API URL - uncomment ONE of these:
REACT_APP_API_URL=http://localhost:3000 # Local API
# REACT_APP_API_URL=https://dev.api.dfx.swiss # Dev API
# REACT_APP_API_URL=https://api.dfx.swiss # Production API

# === E2E Test Configuration ===
# These are only needed when running Playwright tests

# Test wallet mnemonic (NEVER use for real funds!)
TEST_SEED="your twelve word test seed phrase here"

# Test IBAN for sell/refund operations
TEST_IBAN=CH9300762011623852957

# Test email for mail login flow
TEST_EMAIL=your-test-email@example.com

# === Widget Build (optional) ===
# BUILD_PATH=./widget
# GENERATE_SOURCEMAP=false
3 changes: 0 additions & 3 deletions .env.widget

This file was deleted.

5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code Owners for DFXswiss/services
# These users must approve all pull requests to protected branches

# Default owners for everything in the repo
* @davidleomay @TaprootFreak
12 changes: 5 additions & 7 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
NODE_VERSION: '16.x'
NODE_VERSION: '20.x'
AZURE_ACCOUNT_NAME: 'stdfxsrvdev'
AZURE_CDN_PROFILE: 'cdnp-dfx-srv-dev'
AZURE_CDN_ENDPOINT: 'cdne-dfx-srv-dev'
Expand Down Expand Up @@ -47,9 +47,7 @@ jobs:
- name: Build code
env:
REACT_APP_BUILD_ID: ${{ github.run_number }}-${{ github.run_id }}
run: |
echo "REACT_APP_BUILD_ID=$REACT_APP_BUILD_ID" >> .env.dev
npm run build:dev
run: npm run build:dev

- name: Build widget
run: |
Expand All @@ -63,8 +61,8 @@ jobs:
cp ./widget/static/js/main.*.js ./build/widget/$version
cp ./widget/static/css/main.*.css ./build/widget/$version.css
cp ./widget/$version-chunks/*.chunk.js ./build/widget/$version-chunks
cp ./widget/$version-chunks/*.chunk.css ./build/widget/$version-chunks || true
cp ./widget/$version-chunks/*.module.wasm ./build/widget/$version-chunks
cp ./widget/$version-chunks/*.chunk.css ./build/widget/$version-chunks
cp ./widget/$version-chunks/*.wasm ./build/widget/$version-chunks

sed -i "s|main-widget.css|https://dev.app.dfx.swiss/widget/$version.css|g" "./build/widget/$version"

Expand All @@ -82,7 +80,7 @@ jobs:
--overwrite

# Upload entry points with no-cache (must revalidate on every request)
for file in index.html manifest.json asset-manifest.json robots.txt custom-service-worker.js; do
for file in index.html manifest.json asset-manifest.json robots.txt; do
if [ -f "./build/$file" ]; then
az storage blob upload \
--account-name ${{ env.AZURE_ACCOUNT_NAME }} \
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
NODE_VERSION: '16.x'
NODE_VERSION: '20.x'

jobs:
build:
Expand Down Expand Up @@ -37,6 +37,4 @@ jobs:
- name: Build code
env:
REACT_APP_BUILD_ID: ${{ github.run_number }}-${{ github.run_id }}
run: |
echo "REACT_APP_BUILD_ID=$REACT_APP_BUILD_ID" >> .env.dev
npm run build:dev
run: npm run build:dev
12 changes: 5 additions & 7 deletions .github/workflows/prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
workflow_dispatch:

env:
NODE_VERSION: '16.x'
NODE_VERSION: '20.x'
AZURE_ACCOUNT_NAME: 'stdfxsrvprd'
AZURE_CDN_PROFILE: 'cdnp-dfx-srv-prd'
AZURE_CDN_ENDPOINT: 'cdne-dfx-srv-prd'
Expand Down Expand Up @@ -50,9 +50,7 @@ jobs:
- name: Build code
env:
REACT_APP_BUILD_ID: ${{ github.run_number }}-${{ github.run_id }}
run: |
echo "REACT_APP_BUILD_ID=$REACT_APP_BUILD_ID" >> .env.prd
npm run build
run: npm run build

- name: Build widget
run: |
Expand All @@ -69,8 +67,8 @@ jobs:
cp ./widget/static/js/main.*.js ./build/widget/$version
cp ./widget/static/css/main.*.css ./build/widget/$version.css
cp ./widget/$version-chunks/*.chunk.js ./build/widget/$version-chunks
cp ./widget/$version-chunks/*.chunk.css ./build/widget/$version-chunks || true
cp ./widget/$version-chunks/*.module.wasm ./build/widget/$version-chunks
cp ./widget/$version-chunks/*.chunk.css ./build/widget/$version-chunks
cp ./widget/$version-chunks/*.wasm ./build/widget/$version-chunks

sed -i "s|main-widget.css|https://app.dfx.swiss/widget/$version.css|g" "./build/widget/$version"

Expand All @@ -88,7 +86,7 @@ jobs:
--overwrite

# Upload entry points with no-cache (must revalidate on every request)
for file in index.html manifest.json asset-manifest.json robots.txt custom-service-worker.js; do
for file in index.html manifest.json asset-manifest.json robots.txt; do
if [ -f "./build/$file" ]; then
az storage blob upload \
--account-name ${{ env.AZURE_ACCOUNT_NAME }} \
Expand Down
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ dfx.swiss-*.tgz
playwright-report/
test-results/

# test environment (contains secrets)
.env.test
# environment files (contain secrets)
.env
.env.backup

# next.js
/.next/
Expand All @@ -36,8 +37,6 @@ yarn-debug.log*
yarn-error.log*
.pnpm-debug.log*

# local env files
.env*.local

# vercel
.vercel
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,29 @@ The services will be available at http://localhost:3001

### Configuration

The `.env.loc` file is used for local development:
Copy `.env.sample` to `.env` and adjust as needed:

| Variable | Value | Description |
|----------|-------|-------------|
```bash
cp .env.sample .env
```

| Variable | Default | Description |
|----------|---------|-------------|
| `PORT` | 3001 | Services port |
| `REACT_APP_API_URL` | http://localhost:3000 | Local API URL |
| `REACT_APP_API_URL` | http://localhost:3000 | API URL |
| `TEST_SEED` | - | Test wallet mnemonic (E2E tests) |
| `TEST_EMAIL` | - | Test email (E2E tests) |

### NPM Scripts

| Command | Description |
|---------|-------------|
| `npm run start` | Start with local config (`.env.loc`) |
| `npm start` | Start with local API (from `.env`) |
| `npm run start:dev` | Start with dev API |
| `npm run build` | Build for production |
| `npm run build:dev` | Build for dev environment |
| `npm run test:e2e` | Run E2E tests against dev API |
| `npm run test:e2e:local` | Run E2E tests against local API |

## Usage

Expand Down
14 changes: 0 additions & 14 deletions e2e/.env.test.example

This file was deleted.

7 changes: 0 additions & 7 deletions e2e/api-integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ test.describe('Static Assets', () => {
expect(response?.status()).toBe(200);
});

test('should load service worker', async ({ page }) => {
const response = await page.goto('/custom-service-worker.js');
expect(response?.status()).toBe(200);

const contentType = response?.headers()['content-type'];
expect(contentType).toContain('javascript');
});
});

test.describe('External Resources', () => {
Expand Down
6 changes: 3 additions & 3 deletions e2e/api-timing-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

dotenv.config({ path: path.join(__dirname, '../.env.test') });
dotenv.config({ path: path.join(__dirname, '../.env') });

const API_URL = process.env.API_URL || 'http://localhost:3000';
const API_URL = process.env.REACT_APP_API_URL || 'http://localhost:3000';
const TEST_SEED = process.env.TEST_SEED || '';

async function main() {
console.log('=== API Timing Test ===\n');
console.log(`API URL: ${API_URL}`);

if (!TEST_SEED) {
console.error('ERROR: TEST_SEED not in .env.test');
console.error('ERROR: TEST_SEED not in .env');
process.exit(1);
}

Expand Down
Loading
Loading