14 Commits
Author SHA1 Message Date
Dylan M. Taylor 1ce37b5f28 Serve the API docs on storyteller-docs.artcraft.team from a Cloudflare Worker 2026-11-18 12:03:54 -05:00
Dylan M. Taylor 590ecaf9b1 Deploy artcraft-dashboard without the website's signing keys (#409)
## Why

`artcraft-dashboard` was documented (and configured) with the shared
Cloudflare
commands:

| Setting        | Value                             |
|----------------|-----------------------------------|
| Build command  | `npm run build`                   |
| Deploy command | `npm run deploy`                  |
| Build variable | `ARTCRAFT_APP=artcraft-dashboard` |

Both scripts fall back to `ARTCRAFT_APP=artcraft-website`, so a
dashboard deploy
that was missing the build variable did two wrong things:

- the build ran the website's static export, including
  `signLauncherCatalog()`, so the deployment failed without
  `LAUNCHER_CATALOG_SIGNING_KEY`;
- the deploy handed Wrangler the **root** config instead of the
dashboard's:

```
✘ [ERROR] The directory specified by the "assets.directory" field in your
  configuration file does not exist:
  /opt/buildhome/repo/frontend/apps/artcraft-website-next/out
```

## What changed

- The dashboard README now configures the Worker with `npm run
build:dashboard`
  and `npm run deploy:dashboard`. Those npm scripts set
  `ARTCRAFT_APP=artcraft-dashboard` inline and pass
`frontend/apps/artcraft-dashboard/wrangler.jsonc` to Wrangler, so the
Worker
  needs no build variable at all beyond `NODE_VERSION=22`.
- Added a "Build secrets" section stating the dashboard reads neither
  `LAUNCHER_CATALOG_SIGNING_KEY` nor `LINUX_SIGNING_KEY`, and that plain
  `npm run build` / `npm run deploy` must not be used for this Worker.
- The root README table now lists the per-app build/deploy commands
instead of an
  `ARTCRAFT_APP` column, and documents the same trap.
- `cloudflare_app.sh` header comment updated to match.
- Added the missing `deploy:website` script so all three apps have a
symmetric
  `build:<app>` / `deploy:<app>` pair.

No build logic changed: `artcraft-dashboard` never referenced the
signing keys
before this PR either. The change removes the misconfiguration path that
made
them appear to be required.

## Verification

- `env -u LAUNCHER_CATALOG_SIGNING_KEY -u LINUX_SIGNING_KEY pnpm install
--frozen-lockfile && pnpm build`
in `frontend/apps/artcraft-dashboard` — exit 0, `dist/` produced without
  `_redirects`.
- `wrangler deploy --dry-run --config
frontend/apps/artcraft-dashboard/wrangler.jsonc`
  — reads 5 files from `dist/`, binds `env.ASSETS`, clean exit.
- `node -e require('./package.json')` parses; `bash -n` on
`cloudflare_app.sh` and
  `build_cloudflare.sh` passes.

## After merge

In the Cloudflare `artcraft-dashboard` Worker, set build command
`npm run build:dashboard`, deploy command `npm run deploy:dashboard`,
and drop
the `ARTCRAFT_APP` build variable. Keep `NODE_VERSION=22`. No signing
secret
needs to be added to this Worker.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Clarified the app-specific Cloudflare build and deployment commands
for the website, webapp, and dashboard, including that the bare commands
default to the website and require `ARTCRAFT_APP` to select another app.
* Added dashboard Workers Builds guidance, including its Node.js version
requirement and app-specific Wrangler configuration.
* Clarified that only the website build uses signing credentials and its
launcher assets, and warned against deploying the dashboard with the
default Wrangler command.
* **Deployment**
  * Added a dedicated command for deploying the website.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-18 00:14:10 -05:00
Dylan M. Taylor 766ead6629 Configure artcraft-dashboard for Cloudflare at dashboard.artcraft.team (#408)
## Problem

The admin dashboard is deployed only to Netlify
(`artcraft-dashboard.netlify.app`), while the rest of the frontends
deploy to Cloudflare from this repository. Move it to Cloudflare and
serve it at `dashboard.artcraft.team`.

## Change

- **`frontend/apps/artcraft-dashboard/wrangler.jsonc`** —
`artcraft-dashboard` static-assets Worker: SPA `not_found_handling`,
`run_worker_first: ["/api/*"]`, custom domain `dashboard.artcraft.team`.
- **`cloudflare_worker/index.ts`** — same-origin `/api/*` proxy to
`https://api.storyteller.ai`. The dashboard calls the API with
`credentials: "include"`, so its session cookie has to stay first-party;
`api.storyteller.ai` is a different site than `dashboard.artcraft.team`,
so a direct cross-site call would have the cookie dropped by browsers.
This replaces Netlify's `/api/*` rewrite.
- **`script/website/cloudflare_app.sh` + root `package.json`** —
`ARTCRAFT_APP=artcraft-dashboard`, plus `npm run build:dashboard` / `npm
run deploy:dashboard`.
- **`_redirects`** moved from `public/` to the app root and copied into
`dist/` by `netlify_build.sh`, so the Cloudflare upload never contains
the `/* /index.html 200` loop or the external-host proxy that Workers
reject. Netlify keeps working unchanged as the rollback target.
- **CORS** — `https://dashboard.artcraft.team` allowlisted in
`artcraft_admin_dashboard.rs`, the regression table, and the production
product-origin test.
- **`tsconfig.app.json`** — excludes spec files. `DebugLogCard.spec.ts`
imports `vitest`, which only resolved through the parent workspace's
`node_modules`; the standalone Cloudflare build never installs those, so
`tsc -b` failed.
- Docs: dashboard README (deploy, proxy rationale, rollback) and the
root README Worker table.

## Cloudflare settings

| Setting        | Value                             |
|----------------|-----------------------------------|
| Build command  | `npm run build`                   |
| Deploy command | `npm run deploy`                  |
| Build variable | `ARTCRAFT_APP=artcraft-dashboard` |
| Build variable | `NODE_VERSION=22`                 |

`VITE_API_HOST` is deliberately not set: the dashboard keeps calling
`/api`, and the Worker proxies it.

## Checklist before cutover

- [ ] `artcraft.team` is a zone in the Cloudflare account (Workers
custom domains require the zone).
- [ ] `artcraft-dashboard` Worker created from this repo with the
settings above.
- [ ] Domain attached; log in and confirm the session works at
`https://dashboard.artcraft.team`. A `*.workers.dev` URL is not
CORS-allowlisted, so test through the domain (or add the test host to
the CORS config first).
- [ ] Netlify site kept for rollback; reverting is pointing the domain
back at it.

## Testing

- `cargo test -p actix_cors_configs` — 81 passed, including the new
`dashboard_domain` case and the allowlist regression table.
- `pnpm install --frozen-lockfile && pnpm build` in
`frontend/apps/artcraft-dashboard` — succeeds (9014 modules); `dist/`
has no `_redirects`.
- `wrangler deploy --dry-run --config
frontend/apps/artcraft-dashboard/wrangler.jsonc` — clean: 5 assets,
`env.ASSETS` binding, no config warnings.
- Not run: an actual deploy, since there are no Cloudflare credentials
or account access in this environment.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* The ArtCraft Admin Dashboard is now available at
`dashboard.artcraft.team`, with dashboard API requests routed through
the new deployment.
* The dashboard’s production origin is now allowed for cross-origin
requests.
* **Documentation**
* Added deployment and build guidance for the dashboard, including its
Cloudflare hosting and API routing details.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-17 23:51:08 -05:00
Dylan M. Taylor 896824e56f Build the webapp on Cloudflare without the website's signing keys (#407)
## Problem

app.getartcraft.com serves `Hello world`. Its `artcraft-webapp` Worker
builds this repository with `npm run build`, which always built
**artcraft-website-next** and failed on the website's
`LAUNCHER_CATALOG_SIGNING_KEY`. The Worker never got a successful
deploy, so it kept its placeholder.

## Change

- `npm run build` / `npm run deploy` choose the app from the
`ARTCRAFT_APP` build variable via `script/website/cloudflare_app.sh`.
The default, `artcraft-website`, is the old behaviour, so the website
Worker needs no changes.
- `ARTCRAFT_APP=artcraft-webapp` builds only the Nx webapp. It needs
**no signing keys**.
- `frontend/apps/artcraft-webapp/wrangler.jsonc` is now a static-assets
Worker (`artcraft-webapp`). It uses SPA `not_found_handling` and the
`app.getartcraft.com` custom domain, replacing the unused Pages
`app-new` config.
- The Cloudflare `public/_redirects` no longer has the `/* /index.html
200` fallback, since Workers assets reject it as a loop. Netlify's
`_redirects` is untouched.
- `nx build --skipSync` plus the `nx sync` output for
pagedraw/pagescene. Nx refused to build in CI without those references,
and that also fails on current `main`.

## Cloudflare settings for the artcraft-webapp Worker

| Setting        | Value                                   |
|----------------|-----------------------------------------|
| Build command  | `npm run build`                         |
| Deploy command | `npm run deploy`                        |
| Build variable | `ARTCRAFT_APP=artcraft-webapp`          |
| Build variable | `VITE_GOOGLE_CLIENT_ID` (as on Netlify) |

## Testing

- `ARTCRAFT_APP=artcraft-webapp CI=true npm run build` with no signing
keys in the environment: succeeds, 239 files, none over 25 MiB.
- `wrangler deploy --config frontend/apps/artcraft-webapp/wrangler.jsonc
--dry-run`: clean, no `_redirects` warnings.
- An unknown `ARTCRAFT_APP` exits 1 with usage.
- Not run: the website build path, which is the unchanged command moved
into the script.
2026-11-17 18:34:12 -05:00
Dylan M. Taylor d903ff2e2c Sonar: [[ ]] in scripts, npm install --ignore-scripts, retired local-dev setup out of scope (#373)
- **shell:S7688 (43)**: `[[ ]]` in place of `[ ]` in
`script/metrics/apply_{dashboards,metric_configs,monitors}.sh`,
`script/common/frontend_preflight.sh` and
`script/website/unix_frontend_dashboard_dev.sh`. Every script has a bash
shebang and `bash -n` passes. No test uses `-a`/`-o`, escaped
parentheses or an unquoted pattern on the right of `=`. The numeric
operands are `$#`, internal flags, exit codes, a parsed Node major
version and curl's status code, so `[[ ]]`'s arithmetic reading changes
nothing.
- **shell:S6505 (4)**: `npm install --ignore-scripts` in
`frontend_preflight.sh`, `unix_frontend_webapp_dev.sh` and
`frontend/build_modules.sh`. The frontend has no install scripts of its
own, and this repo's CI already builds with `npm ci --ignore-scripts`.
Same change as storytold/artcraft#2818.
- **Scope**: `_docs/old/**` joins `sonar.exclusions`. It's the retired
local-dev setup (an old Dockerfile, `kubernetes.yml`, nginx config) that
nothing references, and it held the docker and kubernetes findings under
`_docs/old/old_localdev_setup`.

Same as the other PRs here: not merged without the owner's go-ahead
(production service).

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
* Frontend dependency installation now skips package-provided lifecycle
scripts, including during development setup. This changes which scripts
run during installation but does not change the frontend’s intended
features or behavior.
* Updated internal checks used by dashboard, metric, and monitor scripts
without changing their conditions or outcomes.
* Expanded static-analysis exclusions to include archived documentation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-11 07:34:01 -05:00
Brandon Thomas 17373314ae remove old website (#63) 2026-10-09 11:31:28 -04:00
Brandon Thomas fc78787f30 better website hero text (#46) 2026-10-01 20:22:51 -04:00
Brandon Thomas ef2710fcc8 wip 2026-09-14 15:40:33 -04:00
hanashi ea4563c1a8 Frontend dev exp (#1866) 2026-08-08 19:17:34 -04:00
Brandon Thomas 35add74498 payment informatics 3 (#1706) 2026-06-30 08:19:52 -04:00
Brandon Thomas 9104faf806 fix frontend dev scripts (#1625) 2026-06-10 09:28:25 -04:00
Brandon Thomas 436d6d18a0 more dashboards 2026-05-23 15:55:20 -04:00
Brandon Thomas 1cd2900b98 webapp launch script 2026-05-18 23:19:33 -04:00
Brandon Thomasandbflatastic da859fc2f8 marketing updates for the website (#722)
This is currently a draft / work in progress.

---------

Co-authored-by: bflatastic <bombayapirat@gmail.com>
2025-07-17 10:49:14 -04:00