Skip to content

Admin

Not documented in the repository's own README or infrastructure notes

Real, deployed, automatically shipped by CI - see Architecture → Applications "What the existing docs don't mention".

Purpose

Internal admin app - the only app whose entire path space runs through its own Worker (run_worker_first: true), not just specific routes.

Source directory

apps/admin-web/src/ (React frontend), worker/ (handles every request, including /api/bootstrap).

Framework

React 18 + TypeScript + Vite. Does not depend on @akshaya/ui or @akshaya/shared - the one app in this monorepo that's deliberately isolated from the shared packages.

Commands

npm run dev:admin
npm run build:admin     # tsc -b -> vite build -> tsc -p worker/tsconfig.json

Output

apps/admin-web/dist/.

Deployment mechanism

Cloudflare Worker, name akshaya-admin, run_worker_first: true for every path. wrangler deploy --config apps/admin-web/wrangler.jsonc. Domain: admin.akshayagroupglobal.com.

Environment variables / secrets

No VITE_* build-time variables. Uses a Cloudflare Worker secret, ADMIN_BOOTSTRAP_TOKEN, set via:

npm run configure:admin:bootstrap    # wrangler secret put ADMIN_BOOTSTRAP_TOKEN --config apps/admin-web/wrangler.jsonc
Required before the very first Admin account can be created on a fresh database - see CI/CD → Secrets.

admin.akshayagroupglobal.com

Dependencies on shared packages

None (see above).

/api/bootstrap - handled by this app's own Worker (not the central API Worker), gated on ADMIN_BOOTSTRAP_TOKEN.

Troubleshooting

  • Any path 404s or behaves unexpectedly, including what looks like a static asset: because run_worker_first: true applies to every path, a bug in worker/index.ts can affect the whole app, not just an API route - check the Worker's own logs first (wrangler tail --config apps/admin-web/wrangler.jsonc) before assuming it's a static-asset/routing issue.
  • Cannot create the first Admin account: confirm ADMIN_BOOTSTRAP_TOKEN has actually been set (npm run configure:admin:bootstrap) - see CI/CD → Secrets.
  • Not deployed automatically by deploy-cloudflare.yml's manual dispatch - only ci.yml's automatic deploy-production job (and npm run deploy:admin locally) redeploy this app. See CI/CD → Deployment.