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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ scripts
Dockerfile
.dockerignore
.DS_Store

node_modules
test-results
playwright-report
26 changes: 25 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: Deploy
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: deploy
group: ${{ github.event_name == 'pull_request' && format('checks-{0}', github.event.pull_request.number) || 'deploy' }}
cancel-in-progress: false

env:
Expand All @@ -19,7 +21,29 @@ env:
SERVICE: bitkit-watch

jobs:
checks:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci --ignore-scripts
- run: npx playwright install --with-deps chromium webkit
# PR checks remain useful after the demo ages. Deployments require a fresh snapshot.
- if: github.event_name == 'pull_request'
run: npm run verify -- --allow-stale-snapshot
- if: github.event_name != 'pull_request'
run: npm run verify
- run: npm run test:browser

deploy:
needs: checks
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store
node_modules/
test-results/
playwright-report/
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,23 @@ When blockchain or market data is refreshed, your browser connects directly to t

## Local Development

The browser app has no third-party JavaScript packages, CDN scripts, or build step. Release tooling uses Node.js 24.22.3, pinned in `.nvmrc`, plus Python 3, zsh, and ripgrep.
The browser app has no third-party JavaScript packages, CDN scripts, or build step. Release tooling uses Node.js 24.22.3, pinned in `.nvmrc`, plus Python 3, Bash, and OpenSSL. Playwright is a pinned development dependency for browser tests; it is not shipped to users.

With nvm installed, select the project's patched runtime:

```sh
nvm install
nvm use
node --test tests/*.test.mjs
npm ci --ignore-scripts
npx playwright install chromium webkit
npm test
npm run test:browser
```

Serve the project from localhost:

```sh
python3 -m http.server 8765 --bind 127.0.0.1
npm start
```

Then open:
Expand All @@ -43,8 +46,29 @@ Then open:
http://localhost:8765
```

For Safari-compatible local previews, use `npm start -- --https` and open `https://127.0.0.1:8765`. The local server generates a temporary self-signed certificate; it does not install a trusted certificate. Browser tests use this HTTPS mode to preserve the production security policy.

Bitkit Watch should be served from HTTPS in production or from `http://localhost` during local development. Address validation relies on the browser Web Crypto API and fails closed when checksum verification is unavailable.

## Code Layout

- `app.js`: UI, wallet actions, and refresh coordination.
- `assets/storage.js`: bounded persistence, cache recovery, and normalization.
- `assets/api.js`: validated provider requests, fallback, cancellation, and rate-limit cooldowns.
- `assets/portfolio.js`: balances, transaction activity, and timeline calculations.
- `assets/charts.js`: chart geometry, gaps, labels, and pointer interaction.
- `assets/market-history.js`: shared real-price coverage for the app and snapshot builder.

Modules receive explicit dependencies from `app.js`; browser scripts are served directly without bundling.

## Prepare a Release

```sh
npm run prepare:release -- 0.1.5
```

This refreshes the public Satoshi snapshot, updates the manifest, lockfile, visible version and asset URLs, then runs release and desktop/mobile Chromium and WebKit checks. Failed checks, Ctrl+C, and SIGTERM restore the previous release files after stopping child commands. Review the diff and personally sign and push your commit afterward.

## Deployment

See [docs/deployment.md](docs/deployment.md) for release checks, Satoshi demo snapshot updates, and production HTTP header recommendations.
Expand Down
Loading
Loading