@mesh-tech/mesh-cli 0.1.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/intent/agents-fence.md +10 -0
- package/assets/intent/intent-claude-gate.mjs +255 -0
- package/assets/log-shipper.mjs +94 -0
- package/bin/mesh.mjs +80 -0
- package/dist/bin/mesh.d.ts +7 -9
- package/dist/bin/mesh.d.ts.map +1 -1
- package/dist/bin/mesh.js +20826 -37
- package/dist/bin/mesh.js.map +7 -1
- package/dist/build-info.json +4 -0
- package/dist/src/commands/agent-api-client.d.ts +79 -0
- package/dist/src/commands/agent-api-client.d.ts.map +1 -0
- package/dist/src/commands/agent-api-client.js +170 -0
- package/dist/src/commands/agent-api-client.js.map +1 -0
- package/dist/src/commands/artifacts.d.ts +13 -0
- package/dist/src/commands/artifacts.d.ts.map +1 -0
- package/dist/src/commands/artifacts.js +140 -0
- package/dist/src/commands/artifacts.js.map +1 -0
- package/dist/src/commands/cluster.d.ts +45 -0
- package/dist/src/commands/cluster.d.ts.map +1 -0
- package/dist/src/commands/cluster.js +259 -0
- package/dist/src/commands/cluster.js.map +1 -0
- package/dist/src/commands/conversations.d.ts +61 -0
- package/dist/src/commands/conversations.d.ts.map +1 -0
- package/dist/src/commands/conversations.js +239 -0
- package/dist/src/commands/conversations.js.map +1 -0
- package/dist/src/commands/create-app.d.ts +26 -3
- package/dist/src/commands/create-app.d.ts.map +1 -1
- package/dist/src/commands/create-app.js +465 -107
- package/dist/src/commands/create-app.js.map +1 -1
- package/dist/src/commands/deploy.d.ts +19 -0
- package/dist/src/commands/deploy.d.ts.map +1 -1
- package/dist/src/commands/deploy.js +83 -142
- package/dist/src/commands/deploy.js.map +1 -1
- package/dist/src/commands/dev-doctor.d.ts +137 -0
- package/dist/src/commands/dev-doctor.d.ts.map +1 -0
- package/dist/src/commands/dev-doctor.js +671 -0
- package/dist/src/commands/dev-doctor.js.map +1 -0
- package/dist/src/commands/dev-launch.d.ts +59 -0
- package/dist/src/commands/dev-launch.d.ts.map +1 -0
- package/dist/src/commands/dev-launch.js +118 -0
- package/dist/src/commands/dev-launch.js.map +1 -0
- package/dist/src/commands/dev-token-server.d.ts +32 -0
- package/dist/src/commands/dev-token-server.d.ts.map +1 -0
- package/dist/src/commands/dev-token-server.js +68 -0
- package/dist/src/commands/dev-token-server.js.map +1 -0
- package/dist/src/commands/dev.d.ts +289 -2
- package/dist/src/commands/dev.d.ts.map +1 -1
- package/dist/src/commands/dev.js +2501 -574
- package/dist/src/commands/dev.js.map +1 -1
- package/dist/src/commands/docs.d.ts +3 -0
- package/dist/src/commands/docs.d.ts.map +1 -0
- package/dist/src/commands/docs.js +262 -0
- package/dist/src/commands/docs.js.map +1 -0
- package/dist/src/commands/hub/index.d.ts +99 -0
- package/dist/src/commands/hub/index.d.ts.map +1 -0
- package/dist/src/commands/hub/index.js +452 -0
- package/dist/src/commands/hub/index.js.map +1 -0
- package/dist/src/commands/init.d.ts +65 -0
- package/dist/src/commands/init.d.ts.map +1 -0
- package/dist/src/commands/init.js +370 -0
- package/dist/src/commands/init.js.map +1 -0
- package/dist/src/commands/install-shim.d.ts +21 -0
- package/dist/src/commands/install-shim.d.ts.map +1 -0
- package/dist/src/commands/install-shim.js +132 -0
- package/dist/src/commands/install-shim.js.map +1 -0
- package/dist/src/commands/local/auth-provision.d.ts +71 -0
- package/dist/src/commands/local/auth-provision.d.ts.map +1 -0
- package/dist/src/commands/local/auth-provision.js +286 -0
- package/dist/src/commands/local/auth-provision.js.map +1 -0
- package/dist/src/commands/local/dev-local.d.ts +97 -0
- package/dist/src/commands/local/dev-local.d.ts.map +1 -0
- package/dist/src/commands/local/dev-local.js +306 -0
- package/dist/src/commands/local/dev-local.js.map +1 -0
- package/dist/src/commands/local/docker-runner.d.ts +37 -0
- package/dist/src/commands/local/docker-runner.d.ts.map +1 -0
- package/dist/src/commands/local/docker-runner.js +104 -0
- package/dist/src/commands/local/docker-runner.js.map +1 -0
- package/dist/src/commands/local/helpers.d.ts +22 -0
- package/dist/src/commands/local/helpers.d.ts.map +1 -0
- package/dist/src/commands/local/helpers.js +46 -0
- package/dist/src/commands/local/helpers.js.map +1 -0
- package/dist/src/commands/local/hub-local.d.ts +51 -0
- package/dist/src/commands/local/hub-local.d.ts.map +1 -0
- package/dist/src/commands/local/hub-local.js +197 -0
- package/dist/src/commands/local/hub-local.js.map +1 -0
- package/dist/src/commands/local/index.d.ts +23 -0
- package/dist/src/commands/local/index.d.ts.map +1 -0
- package/dist/src/commands/local/index.js +386 -0
- package/dist/src/commands/local/index.js.map +1 -0
- package/dist/src/commands/local/mocks.d.ts +361 -0
- package/dist/src/commands/local/mocks.d.ts.map +1 -0
- package/dist/src/commands/local/mocks.js +756 -0
- package/dist/src/commands/local/mocks.js.map +1 -0
- package/dist/src/commands/local/seed-zitadel.d.ts +151 -0
- package/dist/src/commands/local/seed-zitadel.d.ts.map +1 -0
- package/dist/src/commands/local/seed-zitadel.js +408 -0
- package/dist/src/commands/local/seed-zitadel.js.map +1 -0
- package/dist/src/commands/local/seed.d.ts +106 -0
- package/dist/src/commands/local/seed.d.ts.map +1 -0
- package/dist/src/commands/local/seed.js +252 -0
- package/dist/src/commands/local/seed.js.map +1 -0
- package/dist/src/commands/local/stack.d.ts +173 -0
- package/dist/src/commands/local/stack.d.ts.map +1 -0
- package/dist/src/commands/local/stack.js +499 -0
- package/dist/src/commands/local/stack.js.map +1 -0
- package/dist/src/commands/login.d.ts +256 -12
- package/dist/src/commands/login.d.ts.map +1 -1
- package/dist/src/commands/login.js +978 -50
- package/dist/src/commands/login.js.map +1 -1
- package/dist/src/commands/peer-addressing.d.ts +51 -0
- package/dist/src/commands/peer-addressing.d.ts.map +1 -0
- package/dist/src/commands/peer-addressing.js +64 -0
- package/dist/src/commands/peer-addressing.js.map +1 -0
- package/dist/src/commands/port-ownership.d.ts +69 -0
- package/dist/src/commands/port-ownership.d.ts.map +1 -0
- package/dist/src/commands/port-ownership.js +161 -0
- package/dist/src/commands/port-ownership.js.map +1 -0
- package/dist/src/commands/registry-publish.d.ts +3 -0
- package/dist/src/commands/registry-publish.d.ts.map +1 -0
- package/dist/src/commands/registry-publish.js +161 -0
- package/dist/src/commands/registry-publish.js.map +1 -0
- package/dist/src/commands/registry.d.ts +146 -2
- package/dist/src/commands/registry.d.ts.map +1 -1
- package/dist/src/commands/registry.js +541 -85
- package/dist/src/commands/registry.js.map +1 -1
- package/dist/src/commands/secrets/index.d.ts.map +1 -1
- package/dist/src/commands/secrets/index.js +15 -1
- package/dist/src/commands/secrets/index.js.map +1 -1
- package/dist/src/commands/secrets/migrate-config.d.ts +24 -0
- package/dist/src/commands/secrets/migrate-config.d.ts.map +1 -0
- package/dist/src/commands/secrets/migrate-config.js +277 -0
- package/dist/src/commands/secrets/migrate-config.js.map +1 -0
- package/dist/src/commands/secrets/set.d.ts +4 -0
- package/dist/src/commands/secrets/set.d.ts.map +1 -1
- package/dist/src/commands/secrets/set.js +243 -64
- package/dist/src/commands/secrets/set.js.map +1 -1
- package/dist/src/commands/skills.d.ts +34 -0
- package/dist/src/commands/skills.d.ts.map +1 -0
- package/dist/src/commands/skills.js +207 -0
- package/dist/src/commands/skills.js.map +1 -0
- package/dist/src/commands/stack.d.ts.map +1 -1
- package/dist/src/commands/stack.js +361 -23
- package/dist/src/commands/stack.js.map +1 -1
- package/dist/src/commands/temporal.d.ts +15 -0
- package/dist/src/commands/temporal.d.ts.map +1 -0
- package/dist/src/commands/temporal.js +781 -0
- package/dist/src/commands/temporal.js.map +1 -0
- package/dist/src/commands/tenant.d.ts +56 -0
- package/dist/src/commands/tenant.d.ts.map +1 -0
- package/dist/src/commands/tenant.js +233 -0
- package/dist/src/commands/tenant.js.map +1 -0
- package/dist/src/commands/tunnel/index.d.ts +49 -3
- package/dist/src/commands/tunnel/index.d.ts.map +1 -1
- package/dist/src/commands/tunnel/index.js +331 -8
- package/dist/src/commands/tunnel/index.js.map +1 -1
- package/dist/src/commands/vcs/clone.d.ts +3 -0
- package/dist/src/commands/vcs/clone.d.ts.map +1 -0
- package/dist/src/commands/vcs/clone.js +20 -0
- package/dist/src/commands/vcs/clone.js.map +1 -0
- package/dist/src/commands/vcs/common.d.ts +21 -0
- package/dist/src/commands/vcs/common.d.ts.map +1 -0
- package/dist/src/commands/vcs/common.js +62 -0
- package/dist/src/commands/vcs/common.js.map +1 -0
- package/dist/src/commands/vcs/drafts.d.ts +13 -0
- package/dist/src/commands/vcs/drafts.d.ts.map +1 -0
- package/dist/src/commands/vcs/drafts.js +45 -0
- package/dist/src/commands/vcs/drafts.js.map +1 -0
- package/dist/src/commands/vcs/get.d.ts +8 -0
- package/dist/src/commands/vcs/get.d.ts.map +1 -0
- package/dist/src/commands/vcs/get.js +61 -0
- package/dist/src/commands/vcs/get.js.map +1 -0
- package/dist/src/commands/vcs/index.d.ts +3 -0
- package/dist/src/commands/vcs/index.d.ts.map +1 -0
- package/dist/src/commands/vcs/index.js +58 -0
- package/dist/src/commands/vcs/index.js.map +1 -0
- package/dist/src/commands/vcs/propose.d.ts +23 -0
- package/dist/src/commands/vcs/propose.d.ts.map +1 -0
- package/dist/src/commands/vcs/propose.js +94 -0
- package/dist/src/commands/vcs/propose.js.map +1 -0
- package/dist/src/commands/vcs/review.d.ts +15 -0
- package/dist/src/commands/vcs/review.d.ts.map +1 -0
- package/dist/src/commands/vcs/review.js +35 -0
- package/dist/src/commands/vcs/review.js.map +1 -0
- package/dist/src/commands/vcs-enrich.d.ts +15 -0
- package/dist/src/commands/vcs-enrich.d.ts.map +1 -0
- package/dist/src/commands/vcs-enrich.js +28 -0
- package/dist/src/commands/vcs-enrich.js.map +1 -0
- package/dist/src/commands/vpn/index.d.ts +24 -0
- package/dist/src/commands/vpn/index.d.ts.map +1 -0
- package/dist/src/commands/vpn/index.js +543 -0
- package/dist/src/commands/vpn/index.js.map +1 -0
- package/dist/src/commands/vpn/tunnel.d.ts +11 -0
- package/dist/src/commands/vpn/tunnel.d.ts.map +1 -0
- package/dist/src/commands/vpn/tunnel.js +188 -0
- package/dist/src/commands/vpn/tunnel.js.map +1 -0
- package/dist/src/commands/workflow.d.ts +24 -0
- package/dist/src/commands/workflow.d.ts.map +1 -0
- package/dist/src/commands/workflow.js +577 -0
- package/dist/src/commands/workflow.js.map +1 -0
- package/dist/src/docs/assemble.d.ts +217 -0
- package/dist/src/docs/assemble.d.ts.map +1 -0
- package/dist/src/docs/assemble.js +739 -0
- package/dist/src/docs/assemble.js.map +1 -0
- package/dist/src/docs/cli-reference.d.ts +93 -0
- package/dist/src/docs/cli-reference.d.ts.map +1 -0
- package/dist/src/docs/cli-reference.js +256 -0
- package/dist/src/docs/cli-reference.js.map +1 -0
- package/dist/src/docs/discover.d.ts +60 -0
- package/dist/src/docs/discover.d.ts.map +1 -0
- package/dist/src/docs/discover.js +233 -0
- package/dist/src/docs/discover.js.map +1 -0
- package/dist/src/docs/portal.d.ts +79 -0
- package/dist/src/docs/portal.d.ts.map +1 -0
- package/dist/src/docs/portal.js +242 -0
- package/dist/src/docs/portal.js.map +1 -0
- package/dist/src/docs/registry-docs.d.ts +43 -0
- package/dist/src/docs/registry-docs.d.ts.map +1 -0
- package/dist/src/docs/registry-docs.js +138 -0
- package/dist/src/docs/registry-docs.js.map +1 -0
- package/dist/src/docs/schema.d.ts +48 -0
- package/dist/src/docs/schema.d.ts.map +1 -0
- package/dist/src/docs/schema.js +96 -0
- package/dist/src/docs/schema.js.map +1 -0
- package/dist/src/docs/serve.d.ts +27 -0
- package/dist/src/docs/serve.d.ts.map +1 -0
- package/dist/src/docs/serve.js +102 -0
- package/dist/src/docs/serve.js.map +1 -0
- package/dist/src/docs/start.d.ts +80 -0
- package/dist/src/docs/start.d.ts.map +1 -0
- package/dist/src/docs/start.js +313 -0
- package/dist/src/docs/start.js.map +1 -0
- package/dist/src/eval/agent-eval.d.mts +14 -0
- package/dist/src/eval/agent-eval.d.mts.map +1 -0
- package/dist/src/eval/agent-eval.mjs +273 -0
- package/dist/src/eval/agent-eval.mjs.map +1 -0
- package/dist/src/index.js +624 -7
- package/dist/src/index.js.map +7 -1
- package/dist/src/program.d.ts +26 -0
- package/dist/src/program.d.ts.map +1 -0
- package/dist/src/program.js +76 -0
- package/dist/src/program.js.map +1 -0
- package/dist/src/utils/auth-preflight.d.ts +159 -0
- package/dist/src/utils/auth-preflight.d.ts.map +1 -0
- package/dist/src/utils/auth-preflight.js +298 -0
- package/dist/src/utils/auth-preflight.js.map +1 -0
- package/dist/src/utils/aws-auth.d.ts +181 -0
- package/dist/src/utils/aws-auth.d.ts.map +1 -0
- package/dist/src/utils/aws-auth.js +527 -0
- package/dist/src/utils/aws-auth.js.map +1 -0
- package/dist/src/utils/bastion.d.ts +1 -1
- package/dist/src/utils/bastion.d.ts.map +1 -1
- package/dist/src/utils/bastion.js +29 -8
- package/dist/src/utils/bastion.js.map +1 -1
- package/dist/src/utils/build-info.d.ts +33 -0
- package/dist/src/utils/build-info.d.ts.map +1 -0
- package/dist/src/utils/build-info.js +102 -0
- package/dist/src/utils/build-info.js.map +1 -0
- package/dist/src/utils/capture-history.d.ts +62 -0
- package/dist/src/utils/capture-history.d.ts.map +1 -0
- package/dist/src/utils/capture-history.js +94 -0
- package/dist/src/utils/capture-history.js.map +1 -0
- package/dist/src/utils/deploy-preflight.d.ts +52 -0
- package/dist/src/utils/deploy-preflight.d.ts.map +1 -0
- package/dist/src/utils/deploy-preflight.js +183 -0
- package/dist/src/utils/deploy-preflight.js.map +1 -0
- package/dist/src/utils/errors.d.ts +75 -0
- package/dist/src/utils/errors.d.ts.map +1 -0
- package/dist/src/utils/errors.js +106 -0
- package/dist/src/utils/errors.js.map +1 -0
- package/dist/src/utils/first-party-contexts.d.ts +40 -0
- package/dist/src/utils/first-party-contexts.d.ts.map +1 -0
- package/dist/src/utils/first-party-contexts.js +53 -0
- package/dist/src/utils/first-party-contexts.js.map +1 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/index.js +2 -0
- package/dist/src/utils/index.js.map +1 -1
- package/dist/src/utils/kubeconfig.d.ts +62 -0
- package/dist/src/utils/kubeconfig.d.ts.map +1 -0
- package/dist/src/utils/kubeconfig.js +118 -0
- package/dist/src/utils/kubeconfig.js.map +1 -0
- package/dist/src/utils/log.d.ts +27 -1
- package/dist/src/utils/log.d.ts.map +1 -1
- package/dist/src/utils/log.js +59 -5
- package/dist/src/utils/log.js.map +1 -1
- package/dist/src/utils/pid.d.ts +47 -0
- package/dist/src/utils/pid.d.ts.map +1 -0
- package/dist/src/utils/pid.js +83 -0
- package/dist/src/utils/pid.js.map +1 -0
- package/dist/src/utils/pulumi-run.d.ts +23 -0
- package/dist/src/utils/pulumi-run.d.ts.map +1 -0
- package/dist/src/utils/pulumi-run.js +112 -0
- package/dist/src/utils/pulumi-run.js.map +1 -0
- package/dist/src/utils/pulumi.d.ts +15 -0
- package/dist/src/utils/pulumi.d.ts.map +1 -1
- package/dist/src/utils/pulumi.js +35 -0
- package/dist/src/utils/pulumi.js.map +1 -1
- package/dist/src/utils/reachability.d.ts +29 -0
- package/dist/src/utils/reachability.d.ts.map +1 -0
- package/dist/src/utils/reachability.js +81 -0
- package/dist/src/utils/reachability.js.map +1 -0
- package/dist/src/utils/recover-conversation.d.ts +154 -0
- package/dist/src/utils/recover-conversation.d.ts.map +1 -0
- package/dist/src/utils/recover-conversation.js +314 -0
- package/dist/src/utils/recover-conversation.js.map +1 -0
- package/dist/src/utils/registry-broker.d.ts +148 -0
- package/dist/src/utils/registry-broker.d.ts.map +1 -0
- package/dist/src/utils/registry-broker.js +180 -0
- package/dist/src/utils/registry-broker.js.map +1 -0
- package/dist/src/utils/socks-forward.d.ts +40 -0
- package/dist/src/utils/socks-forward.d.ts.map +1 -0
- package/dist/src/utils/socks-forward.js +97 -0
- package/dist/src/utils/socks-forward.js.map +1 -0
- package/dist/src/utils/stack-flag.d.ts +23 -0
- package/dist/src/utils/stack-flag.d.ts.map +1 -0
- package/dist/src/utils/stack-flag.js +41 -0
- package/dist/src/utils/stack-flag.js.map +1 -0
- package/dist/src/utils/tailscale-targets.d.ts +52 -0
- package/dist/src/utils/tailscale-targets.d.ts.map +1 -0
- package/dist/src/utils/tailscale-targets.js +93 -0
- package/dist/src/utils/tailscale-targets.js.map +1 -0
- package/dist/src/utils/tailscale.d.ts +277 -0
- package/dist/src/utils/tailscale.d.ts.map +1 -0
- package/dist/src/utils/tailscale.js +1007 -0
- package/dist/src/utils/tailscale.js.map +1 -0
- package/dist/src/utils/temporal-auth.d.ts +43 -0
- package/dist/src/utils/temporal-auth.d.ts.map +1 -0
- package/dist/src/utils/temporal-auth.js +176 -0
- package/dist/src/utils/temporal-auth.js.map +1 -0
- package/dist/src/utils/temporal-codec.d.ts +101 -0
- package/dist/src/utils/temporal-codec.d.ts.map +1 -0
- package/dist/src/utils/temporal-codec.js +319 -0
- package/dist/src/utils/temporal-codec.js.map +1 -0
- package/dist/src/utils/tunnel-ownership.d.ts +130 -0
- package/dist/src/utils/tunnel-ownership.d.ts.map +1 -0
- package/dist/src/utils/tunnel-ownership.js +274 -0
- package/dist/src/utils/tunnel-ownership.js.map +1 -0
- package/dist/src/utils/vpn-join.d.ts +32 -0
- package/dist/src/utils/vpn-join.d.ts.map +1 -0
- package/dist/src/utils/vpn-join.js +62 -0
- package/dist/src/utils/vpn-join.js.map +1 -0
- package/dist/src/utils/vpn.d.ts +62 -0
- package/dist/src/utils/vpn.d.ts.map +1 -0
- package/dist/src/utils/vpn.js +183 -0
- package/dist/src/utils/vpn.js.map +1 -0
- package/dist/src/utils/workflow-fingerprint.d.ts +49 -0
- package/dist/src/utils/workflow-fingerprint.d.ts.map +1 -0
- package/dist/src/utils/workflow-fingerprint.js +135 -0
- package/dist/src/utils/workflow-fingerprint.js.map +1 -0
- package/dist/src/utils/worktree-identity.d.ts +86 -0
- package/dist/src/utils/worktree-identity.d.ts.map +1 -0
- package/dist/src/utils/worktree-identity.js +164 -0
- package/dist/src/utils/worktree-identity.js.map +1 -0
- package/fragments/agents/AGENTS.md.hbs +92 -0
- package/fragments/agents/CLAUDE.md.hbs +8 -0
- package/fragments/base/Pulumi.dev.yaml.hbs +10 -0
- package/fragments/base/Pulumi.yaml.hbs +9 -0
- package/fragments/base/index.ts.hbs +107 -0
- package/fragments/base/package.json.hbs +22 -0
- package/{templates/api-web-db/api → fragments/base}/tsconfig.json +3 -4
- package/fragments/bucket/api/src/storage.ts.hbs +81 -0
- package/fragments/database/api/src/db.ts.hbs +23 -0
- package/fragments/database/prisma/schema.prisma.hbs +18 -0
- package/{templates/api-web-db → fragments/service}/api/.dockerignore +2 -0
- package/fragments/service/api/package.json.hbs +40 -0
- package/fragments/service/api/src/index.ts.hbs +58 -0
- package/{templates/api-web-db → fragments/service/api}/tsconfig.json +5 -3
- package/fragments/temporal/worker/.dockerignore +4 -0
- package/fragments/temporal/worker/Dockerfile +15 -0
- package/{templates/temporal-api-worker → fragments/temporal}/worker/package.json.hbs +3 -2
- package/fragments/temporal/worker/src/activities.ts.hbs +14 -0
- package/fragments/temporal/worker/src/worker.ts.hbs +27 -0
- package/fragments/temporal/worker/src/workflows.ts.hbs +24 -0
- package/fragments/temporal/worker/tsconfig.json +13 -0
- package/package.json +35 -21
- package/skills/core/SKILL.md +365 -0
- package/skills/pull-remote-agent-context/SKILL.md +194 -0
- package/stack/docker-compose.hub.yml +134 -0
- package/stack/docker-compose.yml +447 -0
- package/stack/hub/Dockerfile.api +18 -0
- package/stack/hub/Dockerfile.auth +10 -0
- package/stack/hub/Dockerfile.ui +10 -0
- package/stack/init/01-databases.sql +12 -0
- package/stack/observability/blackbox.yml +20 -0
- package/stack/observability/otel-collector.yaml +73 -0
- package/stack/observability/prometheus.yml +36 -0
- package/stack/observability/tempo.yaml +25 -0
- package/stack/temporal/local.yaml +44 -0
- package/templates/api-auth/AGENTS.md.hbs +16 -0
- package/templates/api-auth/Pulumi.dev.yaml.hbs +8 -0
- package/templates/api-auth/Pulumi.yaml.hbs +8 -0
- package/templates/api-auth/README.md.hbs +67 -0
- package/templates/api-auth/api/package.json.hbs +28 -0
- package/templates/api-auth/api/src/index.ts.hbs +96 -0
- package/templates/api-auth/api/src/schema.ts.hbs +35 -0
- package/templates/api-auth/api/src/seed-authz.ts.hbs +48 -0
- package/templates/api-auth/api/src/spicedb-http-provider.ts.hbs +89 -0
- package/templates/api-auth/index.ts.hbs +65 -0
- package/templates/api-auth/package.json.hbs +20 -0
- package/templates/api-auth/skills/develop/SKILL.md.hbs +32 -0
- package/templates/api-role-gating/AGENTS.md.hbs +20 -0
- package/templates/api-role-gating/Pulumi.dev.yaml.hbs +8 -0
- package/templates/api-role-gating/Pulumi.yaml.hbs +8 -0
- package/templates/api-role-gating/README.md.hbs +64 -0
- package/templates/api-role-gating/api/Dockerfile +17 -0
- package/templates/api-role-gating/api/package.json.hbs +28 -0
- package/templates/api-role-gating/api/src/authn.ts.hbs +29 -0
- package/templates/api-role-gating/api/src/authz.ts.hbs +12 -0
- package/templates/api-role-gating/api/src/main.ts.hbs +58 -0
- package/templates/api-role-gating/api/src/schema.ts.hbs +22 -0
- package/templates/api-role-gating/api/tsconfig.json +13 -0
- package/templates/api-role-gating/index.ts.hbs +107 -0
- package/templates/api-role-gating/package.json.hbs +21 -0
- package/templates/api-role-gating/skills/develop/SKILL.md.hbs +60 -0
- package/templates/api-role-gating/tsconfig.json +10 -0
- package/templates/apps-repo/README.md.hbs +24 -0
- package/templates/apps-repo/gitignore +41 -0
- package/templates/apps-repo/npmrc.hbs +7 -0
- package/templates/apps-repo/package.json.hbs +15 -0
- package/templates/apps-repo/pnpm-workspace.yaml +3 -0
- package/templates/apps-repo/tsconfig.json +18 -0
- package/templates/external-service/AGENTS.md.hbs +20 -0
- package/templates/external-service/Pulumi.dev.yaml.hbs +8 -0
- package/templates/external-service/Pulumi.yaml.hbs +8 -0
- package/templates/external-service/README.md.hbs +56 -0
- package/templates/external-service/api/Dockerfile +15 -0
- package/templates/external-service/api/package.json.hbs +25 -0
- package/templates/external-service/api/src/index.ts.hbs +81 -0
- package/templates/external-service/index.ts.hbs +82 -0
- package/templates/external-service/mocks/vendorpay/package.json.hbs +9 -0
- package/templates/external-service/mocks/vendorpay/server.mjs.hbs +61 -0
- package/templates/external-service/package.json.hbs +34 -0
- package/templates/external-service/skills/develop/SKILL.md.hbs +55 -0
- package/templates/external-service/tsconfig.json +10 -0
- package/templates/platform-repo/AGENTS.md.hbs +18 -0
- package/templates/platform-repo/README.md.hbs +38 -0
- package/templates/platform-repo/core/Pulumi.yaml.hbs +12 -0
- package/templates/platform-repo/core/Pulumi.{{tenant}}-{{env}}.yaml.hbs +57 -0
- package/templates/platform-repo/core/index.ts +62 -0
- package/templates/platform-repo/core/package.json.hbs +22 -0
- package/templates/platform-repo/core/tsconfig.json +8 -0
- package/templates/platform-repo/package.json.hbs +15 -0
- package/templates/platform-repo/platform/Pulumi.yaml.hbs +12 -0
- package/templates/platform-repo/platform/Pulumi.{{tenant}}-{{env}}.yaml.hbs +59 -0
- package/templates/platform-repo/platform/index.ts +95 -0
- package/templates/platform-repo/platform/package.json.hbs +26 -0
- package/templates/platform-repo/platform/tsconfig.json +8 -0
- package/templates/platform-repo/pnpm-workspace.yaml +3 -0
- package/templates/workflow/AGENTS.md.hbs +15 -0
- package/templates/workflow/Pulumi.dev.yaml.hbs +8 -0
- package/templates/workflow/Pulumi.yaml.hbs +8 -0
- package/templates/workflow/README.md.hbs +45 -0
- package/templates/workflow/api/.dockerignore +4 -0
- package/templates/workflow/api/Dockerfile +15 -0
- package/templates/{temporal-api-worker → workflow}/api/package.json.hbs +8 -6
- package/templates/workflow/api/src/index.ts.hbs +130 -0
- package/templates/workflow/api/tsconfig.json +14 -0
- package/templates/workflow/index.ts.hbs +67 -0
- package/templates/workflow/package.json.hbs +20 -0
- package/templates/workflow/skills/develop/SKILL.md.hbs +32 -0
- package/templates/workflow/tsconfig.json +10 -0
- package/templates/workflow/worker/.dockerignore +4 -0
- package/templates/workflow/worker/Dockerfile +13 -0
- package/templates/workflow/worker/package.json.hbs +25 -0
- package/templates/workflow/worker/src/worker.ts.hbs +24 -0
- package/templates/workflow/worker/tsconfig.json +14 -0
- package/dist/src/commands/devbox.d.ts +0 -22
- package/dist/src/commands/devbox.d.ts.map +0 -1
- package/dist/src/commands/devbox.js +0 -463
- package/dist/src/commands/devbox.js.map +0 -1
- package/templates/api-web-db/api/Dockerfile +0 -16
- package/templates/api-web-db/api/package.json.hbs +0 -21
- package/templates/api-web-db/api/src/index.ts.hbs +0 -123
- package/templates/api-web-db/package.json.hbs +0 -27
- package/templates/api-web-db/sst.config.ts.hbs +0 -151
- package/templates/api-web-db/web/.dockerignore +0 -3
- package/templates/api-web-db/web/Dockerfile +0 -17
- package/templates/api-web-db/web/app/lib/db.server.ts +0 -36
- package/templates/api-web-db/web/app/root.tsx +0 -29
- package/templates/api-web-db/web/app/routes/home.tsx.hbs +0 -114
- package/templates/api-web-db/web/app/routes.ts +0 -3
- package/templates/api-web-db/web/package.json.hbs +0 -30
- package/templates/api-web-db/web/prisma/schema.prisma +0 -25
- package/templates/api-web-db/web/prisma.config.ts +0 -18
- package/templates/api-web-db/web/react-router.config.ts +0 -5
- package/templates/api-web-db/web/tsconfig.json +0 -19
- package/templates/api-web-db/web/vite.config.ts +0 -9
- package/templates/temporal-api-worker/README.md.hbs +0 -133
- package/templates/temporal-api-worker/api/src/index.ts.hbs +0 -145
- package/templates/temporal-api-worker/package.json.hbs +0 -29
- package/templates/temporal-api-worker/sst.config.ts.hbs +0 -161
- package/templates/temporal-api-worker/worker/Dockerfile +0 -11
- package/templates/temporal-api-worker/worker/src/bundle-workflows.ts +0 -38
- package/templates/temporal-api-worker/worker/src/worker.ts.hbs +0 -93
- /package/templates/{temporal-api-worker → api-auth}/api/.dockerignore +0 -0
- /package/templates/{temporal-api-worker → api-auth}/api/Dockerfile +0 -0
- /package/templates/{temporal-api-worker → api-auth}/api/tsconfig.json +0 -0
- /package/templates/{temporal-api-worker → api-auth}/tsconfig.json +0 -0
- /package/templates/{temporal-api-worker/worker → api-role-gating/api}/.dockerignore +0 -0
- /package/templates/{temporal-api-worker/worker → external-service/api}/tsconfig.json +0 -0
- /package/templates/{temporal-api-worker → workflow}/api/src/encryption-codec.ts +0 -0
- /package/templates/{temporal-api-worker → workflow}/worker/src/activities.ts.hbs +0 -0
- /package/templates/{temporal-api-worker → workflow}/worker/src/encryption-codec.ts +0 -0
- /package/templates/{temporal-api-worker → workflow}/worker/src/workflows.ts.hbs +0 -0
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
import { serve } from "@hono/node-server";
|
|
2
|
-
import { Hono } from "hono";
|
|
3
|
-
import { cors } from "hono/cors";
|
|
4
|
-
import { logger } from "hono/logger";
|
|
5
|
-
import { Pool } from "pg";
|
|
6
|
-
import {
|
|
7
|
-
SecretsManagerClient,
|
|
8
|
-
GetSecretValueCommand,
|
|
9
|
-
} from "@aws-sdk/client-secrets-manager";
|
|
10
|
-
|
|
11
|
-
const app = new Hono();
|
|
12
|
-
|
|
13
|
-
// Middleware
|
|
14
|
-
app.use("*", logger());
|
|
15
|
-
app.use("*", cors());
|
|
16
|
-
|
|
17
|
-
// =============================================================================
|
|
18
|
-
// Database Connection
|
|
19
|
-
// =============================================================================
|
|
20
|
-
|
|
21
|
-
let dbPool: Pool | null = null;
|
|
22
|
-
|
|
23
|
-
async function getDbPassword(): Promise<string> {
|
|
24
|
-
const secretArn = process.env.DB_SECRET_ARN;
|
|
25
|
-
if (!secretArn) {
|
|
26
|
-
throw new Error("DB_SECRET_ARN not configured");
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const client = new SecretsManagerClient({ region: "us-east-1" });
|
|
30
|
-
const response = await client.send(
|
|
31
|
-
new GetSecretValueCommand({ SecretId: secretArn })
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
if (!response.SecretString) {
|
|
35
|
-
throw new Error("No secret value found");
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const secret = JSON.parse(response.SecretString);
|
|
39
|
-
return secret.password;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function getDbPool(): Promise<Pool> {
|
|
43
|
-
if (dbPool) return dbPool;
|
|
44
|
-
|
|
45
|
-
const password = await getDbPassword();
|
|
46
|
-
|
|
47
|
-
dbPool = new Pool({
|
|
48
|
-
host: process.env.DB_HOST || "localhost",
|
|
49
|
-
port: parseInt(process.env.DB_PORT || "5432", 10),
|
|
50
|
-
database: process.env.DB_NAME || "postgres",
|
|
51
|
-
user: process.env.DB_USER || "postgres",
|
|
52
|
-
password,
|
|
53
|
-
ssl: { rejectUnauthorized: false },
|
|
54
|
-
max: 10,
|
|
55
|
-
idleTimeoutMillis: 30000,
|
|
56
|
-
connectionTimeoutMillis: 5000,
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
return dbPool;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// =============================================================================
|
|
63
|
-
// Routes
|
|
64
|
-
// =============================================================================
|
|
65
|
-
|
|
66
|
-
// Root - API info
|
|
67
|
-
app.get("/", (c) =>
|
|
68
|
-
c.json({
|
|
69
|
-
name: "{{name}}-api",
|
|
70
|
-
version: "1.0.0",
|
|
71
|
-
endpoints: ["/health", "/hello", "/db"],
|
|
72
|
-
})
|
|
73
|
-
);
|
|
74
|
-
|
|
75
|
-
// Health check (required for ALB)
|
|
76
|
-
app.get("/health", (c) => c.json({ status: "ok" }));
|
|
77
|
-
|
|
78
|
-
// Hello endpoint
|
|
79
|
-
app.get("/hello", (c) => {
|
|
80
|
-
return c.json({
|
|
81
|
-
message: "Hello from {{name}} API!",
|
|
82
|
-
stage: process.env.STAGE || "unknown",
|
|
83
|
-
timestamp: new Date().toISOString(),
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
// Database endpoint
|
|
88
|
-
app.get("/db", async (c) => {
|
|
89
|
-
try {
|
|
90
|
-
const pool = await getDbPool();
|
|
91
|
-
const result = await pool.query(
|
|
92
|
-
"SELECT version(), current_database(), current_user"
|
|
93
|
-
);
|
|
94
|
-
const row = result.rows[0];
|
|
95
|
-
|
|
96
|
-
return c.json({
|
|
97
|
-
status: "connected",
|
|
98
|
-
database: row.current_database,
|
|
99
|
-
user: row.current_user,
|
|
100
|
-
version: row.version,
|
|
101
|
-
timestamp: new Date().toISOString(),
|
|
102
|
-
});
|
|
103
|
-
} catch (error) {
|
|
104
|
-
return c.json(
|
|
105
|
-
{
|
|
106
|
-
status: "error",
|
|
107
|
-
message: error instanceof Error ? error.message : "Unknown error",
|
|
108
|
-
},
|
|
109
|
-
500
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
// =============================================================================
|
|
115
|
-
// Start Server
|
|
116
|
-
// =============================================================================
|
|
117
|
-
|
|
118
|
-
const port = parseInt(process.env.PORT || "3001", 10);
|
|
119
|
-
console.log(`API server starting on port ${port}...`);
|
|
120
|
-
|
|
121
|
-
serve({ fetch: app.fetch, port });
|
|
122
|
-
|
|
123
|
-
console.log(`API server running at http://localhost:${port}`);
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}",
|
|
3
|
-
"private": true,
|
|
4
|
-
"type": "module",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"typecheck": "tsc --noEmit",
|
|
7
|
-
"sst:patch": "patch-sst-pulumi .",
|
|
8
|
-
"dev": "pnpm run sst:patch && sst dev",
|
|
9
|
-
"deploy": "pnpm run sst:patch && sst deploy",
|
|
10
|
-
"deploy:dev": "pnpm run sst:patch && sst deploy --stage dev",
|
|
11
|
-
"deploy:prod": "pnpm run sst:patch && sst deploy --stage prod",
|
|
12
|
-
"remove": "sst remove"
|
|
13
|
-
},
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@mesh-tech/infra-components": "workspace:*",
|
|
16
|
-
"@pulumi/aws": "6.66.2",
|
|
17
|
-
"@pulumi/docker-build": "^0.0.15",
|
|
18
|
-
"@pulumi/eks": "4.2.0",
|
|
19
|
-
"@pulumi/kubernetes": "4.24.1",
|
|
20
|
-
"@pulumi/pulumi": "3.214.1",
|
|
21
|
-
"sst": "^3.3.61"
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@aws-sdk/credential-providers": "^3.964.0",
|
|
25
|
-
"typescript": "^5.7.2"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/// <reference path="./.sst/platform/config.d.ts" />
|
|
2
|
-
|
|
3
|
-
export default $config({
|
|
4
|
-
app(input) {
|
|
5
|
-
return {
|
|
6
|
-
name: "{{name}}",
|
|
7
|
-
removal: input?.stage === "prod" ? "retain" : "remove",
|
|
8
|
-
protect: ["prod"].includes(input?.stage ?? ""),
|
|
9
|
-
home: "aws",
|
|
10
|
-
providers: {
|
|
11
|
-
aws: {
|
|
12
|
-
region: "us-east-1",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
},
|
|
17
|
-
async run() {
|
|
18
|
-
// Dynamic imports (SST requirement for non-SST packages)
|
|
19
|
-
const { mesh } = await import("@mesh-tech/infra-components");
|
|
20
|
-
const { config, getPlatform } = await import("../config.js");
|
|
21
|
-
|
|
22
|
-
const stage = $app.stage;
|
|
23
|
-
const tenant = config.tenant;
|
|
24
|
-
const platform = getPlatform(stage);
|
|
25
|
-
|
|
26
|
-
// Create tenant environment (isolated per-app namespace)
|
|
27
|
-
// DevCommand enables unified dev tunnel (mesh tunnel dev) for DB access
|
|
28
|
-
const env = new mesh.apps.AppEnvironment("env", {
|
|
29
|
-
tenant,
|
|
30
|
-
platform,
|
|
31
|
-
stage,
|
|
32
|
-
appName: "{{name}}",
|
|
33
|
-
dev: $dev,
|
|
34
|
-
namespace: true,
|
|
35
|
-
DevCommand: sst.x.DevCommand,
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
// Create database
|
|
39
|
-
// Credentials are injected at runtime via envFromSecrets:
|
|
40
|
-
// - Dev mode: mesh db exec fetches from Secrets Manager
|
|
41
|
-
// - K8s mode: ExternalSecrets syncs to K8s Secret, envFrom injects
|
|
42
|
-
const db = new mesh.apps.Database("db", {
|
|
43
|
-
env,
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
// Prisma DevCommand for migrations and Studio
|
|
47
|
-
// Usage: npx sst shell --target Prisma -- npx prisma <command>
|
|
48
|
-
// Uses mesh db exec to load DATABASE_URL from secret (same as web/api)
|
|
49
|
-
new sst.x.DevCommand("Prisma", {
|
|
50
|
-
dev: {
|
|
51
|
-
title: "prisma",
|
|
52
|
-
command: $interpolate`pnpm exec mesh db exec --secret=${db.secretArn} --ssl=require -- npx prisma studio`,
|
|
53
|
-
directory: "./web",
|
|
54
|
-
autostart: false,
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
// ==========================================================================
|
|
59
|
-
// API Service (Hono)
|
|
60
|
-
// ==========================================================================
|
|
61
|
-
const api = new mesh.apps.Service(
|
|
62
|
-
"api",
|
|
63
|
-
{
|
|
64
|
-
dev: $dev,
|
|
65
|
-
tenant,
|
|
66
|
-
stage,
|
|
67
|
-
appName: "{{name}}",
|
|
68
|
-
namespace: env.namespace!,
|
|
69
|
-
rootDir: $cli.paths.root,
|
|
70
|
-
src: "./api",
|
|
71
|
-
port: 3001,
|
|
72
|
-
devCommand: ["pnpm", "dev"],
|
|
73
|
-
environment: {
|
|
74
|
-
APP_NAME: "api",
|
|
75
|
-
STAGE: stage,
|
|
76
|
-
NODE_ENV: $dev ? "development" : "production",
|
|
77
|
-
},
|
|
78
|
-
// Inject DB credentials via envFromSecrets (works in both dev and K8s mode)
|
|
79
|
-
// Dev: mesh db exec fetches from Secrets Manager at runtime
|
|
80
|
-
// K8s: ExternalSecret syncs to K8s Secret, envFrom injects
|
|
81
|
-
envFromSecrets: $dev ? [db.secretArn] : [db.k8sSecretName!],
|
|
82
|
-
ingress: env.buildIngress({
|
|
83
|
-
subdomain: "{{name}}-api",
|
|
84
|
-
healthCheckPath: "/health",
|
|
85
|
-
}),
|
|
86
|
-
waitForDns: true,
|
|
87
|
-
replicas: 1,
|
|
88
|
-
resources: {
|
|
89
|
-
cpu: $dev ? "50m" : "100m",
|
|
90
|
-
memory: "128Mi",
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
providers: env.providers,
|
|
95
|
-
parent: env,
|
|
96
|
-
},
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
// ==========================================================================
|
|
100
|
-
// Web Service (React Router v7)
|
|
101
|
-
// ==========================================================================
|
|
102
|
-
const web = new mesh.apps.Service(
|
|
103
|
-
"web",
|
|
104
|
-
{
|
|
105
|
-
dev: $dev,
|
|
106
|
-
tenant,
|
|
107
|
-
stage,
|
|
108
|
-
appName: "{{name}}",
|
|
109
|
-
namespace: env.namespace!,
|
|
110
|
-
rootDir: $cli.paths.root,
|
|
111
|
-
src: "./web",
|
|
112
|
-
port: 3000,
|
|
113
|
-
devCommand: ["pnpm", "dev"],
|
|
114
|
-
environment: {
|
|
115
|
-
APP_NAME: "web",
|
|
116
|
-
STAGE: stage,
|
|
117
|
-
NODE_ENV: $dev ? "development" : "production",
|
|
118
|
-
API_URL: api.serviceEndpoint ?? api.url,
|
|
119
|
-
PUBLIC_API_URL: api.url,
|
|
120
|
-
},
|
|
121
|
-
// Inject DB credentials via envFromSecrets (works in both dev and K8s mode)
|
|
122
|
-
// Dev: mesh db exec fetches from Secrets Manager at runtime
|
|
123
|
-
// K8s: ExternalSecret syncs to K8s Secret, envFrom injects
|
|
124
|
-
envFromSecrets: $dev ? [db.secretArn] : [db.k8sSecretName!],
|
|
125
|
-
ingress: env.buildIngress({
|
|
126
|
-
subdomain: "{{name}}",
|
|
127
|
-
healthCheckPath: "/",
|
|
128
|
-
}),
|
|
129
|
-
waitForDns: true,
|
|
130
|
-
replicas: 1,
|
|
131
|
-
resources: {
|
|
132
|
-
cpu: $dev ? "50m" : "200m",
|
|
133
|
-
memory: $dev ? "128Mi" : "256Mi",
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
providers: env.providers,
|
|
138
|
-
parent: env,
|
|
139
|
-
dependsOn: [api],
|
|
140
|
-
},
|
|
141
|
-
);
|
|
142
|
-
|
|
143
|
-
return {
|
|
144
|
-
namespace: env.namespace,
|
|
145
|
-
apiUrl: api.url,
|
|
146
|
-
webUrl: web.url,
|
|
147
|
-
databaseUrl: db.url,
|
|
148
|
-
databaseName: db.name,
|
|
149
|
-
};
|
|
150
|
-
},
|
|
151
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
FROM node:22-alpine AS builder
|
|
2
|
-
WORKDIR /app
|
|
3
|
-
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
4
|
-
COPY package.json pnpm-lock.yaml* ./
|
|
5
|
-
RUN pnpm install
|
|
6
|
-
COPY . .
|
|
7
|
-
RUN pnpm build
|
|
8
|
-
|
|
9
|
-
FROM node:22-alpine
|
|
10
|
-
WORKDIR /app
|
|
11
|
-
RUN corepack enable && corepack prepare pnpm@latest --activate
|
|
12
|
-
COPY package.json pnpm-lock.yaml* ./
|
|
13
|
-
RUN pnpm install --prod --frozen-lockfile || pnpm install --prod
|
|
14
|
-
COPY --from=builder /app/build ./build
|
|
15
|
-
ENV NODE_ENV=production PORT=3000
|
|
16
|
-
EXPOSE 3000
|
|
17
|
-
CMD ["pnpm", "start"]
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Database connection for server-side code (loaders/actions)
|
|
3
|
-
*
|
|
4
|
-
* Uses Prisma v7 adapter pattern with DATABASE_URL from environment.
|
|
5
|
-
* - Dev mode: DATABASE_URL includes password (set by mesh db exec from SecretImport)
|
|
6
|
-
* - K8s mode: DATABASE_URL comes from ExternalSecret via envFrom
|
|
7
|
-
*
|
|
8
|
-
* This pattern eliminates runtime Secrets Manager calls.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import { Pool } from "pg";
|
|
12
|
-
import { PrismaClient } from "../../src/generated/prisma/client";
|
|
13
|
-
import { PrismaPg } from "@prisma/adapter-pg";
|
|
14
|
-
|
|
15
|
-
let prisma: PrismaClient | null = null;
|
|
16
|
-
|
|
17
|
-
export function getDb(): PrismaClient {
|
|
18
|
-
if (!prisma) {
|
|
19
|
-
// Create pg Pool with SSL for RDS (required even through SSM tunnel)
|
|
20
|
-
const pool = new Pool({
|
|
21
|
-
connectionString: process.env.DATABASE_URL,
|
|
22
|
-
ssl: { rejectUnauthorized: false },
|
|
23
|
-
});
|
|
24
|
-
const adapter = new PrismaPg(pool);
|
|
25
|
-
prisma = new PrismaClient({ adapter });
|
|
26
|
-
}
|
|
27
|
-
return prisma;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Cleanup function for graceful shutdown
|
|
31
|
-
export async function closeDb(): Promise<void> {
|
|
32
|
-
if (prisma) {
|
|
33
|
-
await prisma.$disconnect();
|
|
34
|
-
prisma = null;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Links,
|
|
3
|
-
Meta,
|
|
4
|
-
Outlet,
|
|
5
|
-
Scripts,
|
|
6
|
-
ScrollRestoration,
|
|
7
|
-
} from "react-router";
|
|
8
|
-
|
|
9
|
-
export function Layout({ children }: { children: React.ReactNode }) {
|
|
10
|
-
return (
|
|
11
|
-
<html lang="en">
|
|
12
|
-
<head>
|
|
13
|
-
<meta charSet="utf-8" />
|
|
14
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
15
|
-
<Meta />
|
|
16
|
-
<Links />
|
|
17
|
-
</head>
|
|
18
|
-
<body style={{ fontFamily: "system-ui, sans-serif", margin: 0 }}>
|
|
19
|
-
{children}
|
|
20
|
-
<ScrollRestoration />
|
|
21
|
-
<Scripts />
|
|
22
|
-
</body>
|
|
23
|
-
</html>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export default function App() {
|
|
28
|
-
return <Outlet />;
|
|
29
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import type { Route } from "./+types/home";
|
|
2
|
-
|
|
3
|
-
export function meta({}: Route.MetaArgs) {
|
|
4
|
-
return [
|
|
5
|
-
{ title: "{{titleCase name}}" },
|
|
6
|
-
{ name: "description", content: "{{titleCase name}} - Mesh App" },
|
|
7
|
-
];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export async function loader({}: Route.LoaderArgs) {
|
|
11
|
-
const apiUrl = process.env.API_URL || "http://localhost:3001";
|
|
12
|
-
|
|
13
|
-
// Fetch API hello endpoint
|
|
14
|
-
let apiData = { message: "API unavailable", timestamp: null };
|
|
15
|
-
try {
|
|
16
|
-
const response = await fetch(`${apiUrl}/hello`);
|
|
17
|
-
apiData = await response.json();
|
|
18
|
-
} catch (error) {
|
|
19
|
-
console.error("API fetch error:", error);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// Fetch database status
|
|
23
|
-
let dbData = { status: "unknown", database: null, user: null, version: null };
|
|
24
|
-
try {
|
|
25
|
-
const response = await fetch(`${apiUrl}/db`);
|
|
26
|
-
dbData = await response.json();
|
|
27
|
-
} catch (error) {
|
|
28
|
-
console.error("DB fetch error:", error);
|
|
29
|
-
dbData = { status: "error", database: null, user: null, version: null };
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
return {
|
|
33
|
-
message: apiData.message,
|
|
34
|
-
timestamp: apiData.timestamp,
|
|
35
|
-
stage: process.env.STAGE || "unknown",
|
|
36
|
-
db: dbData,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export default function Home({ loaderData }: Route.ComponentProps) {
|
|
41
|
-
const { message, timestamp, stage, db } = loaderData;
|
|
42
|
-
const dbConnected = db?.status === "connected";
|
|
43
|
-
|
|
44
|
-
return (
|
|
45
|
-
<div style=\{{ padding: "2rem", maxWidth: "600px", margin: "0 auto" }}>
|
|
46
|
-
<h1 style=\{{ fontSize: "2rem", marginBottom: "1rem" }}>{{titleCase name}}</h1>
|
|
47
|
-
|
|
48
|
-
<div
|
|
49
|
-
style=\{{
|
|
50
|
-
background: "#f0f9ff",
|
|
51
|
-
border: "1px solid #0ea5e9",
|
|
52
|
-
borderRadius: "8px",
|
|
53
|
-
padding: "1rem",
|
|
54
|
-
marginBottom: "1rem",
|
|
55
|
-
}}
|
|
56
|
-
>
|
|
57
|
-
<h2 style=\{{ margin: "0 0 0.5rem 0", fontSize: "1rem" }}>
|
|
58
|
-
Web (React Router v7)
|
|
59
|
-
</h2>
|
|
60
|
-
<p style=\{{ margin: 0, color: "#666" }}>Stage: {stage}</p>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<div
|
|
64
|
-
style=\{{
|
|
65
|
-
background: "#f0fdf4",
|
|
66
|
-
border: "1px solid #22c55e",
|
|
67
|
-
borderRadius: "8px",
|
|
68
|
-
padding: "1rem",
|
|
69
|
-
marginBottom: "1rem",
|
|
70
|
-
}}
|
|
71
|
-
>
|
|
72
|
-
<h2 style=\{{ margin: "0 0 0.5rem 0", fontSize: "1rem" }}>
|
|
73
|
-
API Response (Hono)
|
|
74
|
-
</h2>
|
|
75
|
-
<p style=\{{ margin: "0 0 0.25rem 0" }}>Message: {message}</p>
|
|
76
|
-
{timestamp && (
|
|
77
|
-
<p style=\{{ margin: 0, color: "#666", fontSize: "0.875rem" }}>
|
|
78
|
-
Timestamp: {timestamp}
|
|
79
|
-
</p>
|
|
80
|
-
)}
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div
|
|
84
|
-
style=\{{
|
|
85
|
-
background: dbConnected ? "#fdf4ff" : "#fef2f2",
|
|
86
|
-
border: `1px solid ${dbConnected ? "#a855f7" : "#ef4444"}`,
|
|
87
|
-
borderRadius: "8px",
|
|
88
|
-
padding: "1rem",
|
|
89
|
-
}}
|
|
90
|
-
>
|
|
91
|
-
<h2 style=\{{ margin: "0 0 0.5rem 0", fontSize: "1rem" }}>
|
|
92
|
-
Database (RDS)
|
|
93
|
-
</h2>
|
|
94
|
-
<p style=\{{ margin: "0 0 0.25rem 0" }}>
|
|
95
|
-
Status: {dbConnected ? "Connected" : `${db?.status || "Unknown"}`}
|
|
96
|
-
</p>
|
|
97
|
-
{dbConnected && (
|
|
98
|
-
<>
|
|
99
|
-
<p style=\{{ margin: "0 0 0.25rem 0", color: "#666", fontSize: "0.875rem" }}>
|
|
100
|
-
Database: {db.database}
|
|
101
|
-
</p>
|
|
102
|
-
<p style=\{{ margin: 0, color: "#666", fontSize: "0.875rem" }}>
|
|
103
|
-
User: {db.user}
|
|
104
|
-
</p>
|
|
105
|
-
</>
|
|
106
|
-
)}
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<p style=\{{ marginTop: "1.5rem", color: "#666", fontSize: "0.875rem" }}>
|
|
110
|
-
Edit files in <code>web/</code> or <code>api/</code> to see live reload!
|
|
111
|
-
</p>
|
|
112
|
-
</div>
|
|
113
|
-
);
|
|
114
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "{{name}}-web",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"scripts": {
|
|
5
|
-
"dev": "react-router dev",
|
|
6
|
-
"build": "react-router build",
|
|
7
|
-
"start": "react-router-serve ./build/server/index.js"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@prisma/adapter-pg": "^7.0.0",
|
|
11
|
-
"@prisma/client": "^7.0.0",
|
|
12
|
-
"@react-router/node": "^7.1.1",
|
|
13
|
-
"@react-router/serve": "^7.1.1",
|
|
14
|
-
"isbot": "^5.1.17",
|
|
15
|
-
"pg": "^8.13.0",
|
|
16
|
-
"prisma": "^7.0.0",
|
|
17
|
-
"react": "^19.0.0",
|
|
18
|
-
"react-dom": "^19.0.0",
|
|
19
|
-
"react-router": "^7.1.1"
|
|
20
|
-
},
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@react-router/dev": "^7.1.1",
|
|
23
|
-
"@types/node": "^22.10.5",
|
|
24
|
-
"@types/pg": "^8.11.0",
|
|
25
|
-
"@types/react": "^19.0.2",
|
|
26
|
-
"@types/react-dom": "^19.0.2",
|
|
27
|
-
"typescript": "^5.7.2",
|
|
28
|
-
"vite": "^6.0.7"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Prisma v7 Schema
|
|
2
|
-
// Docs: https://www.prisma.io/docs
|
|
3
|
-
|
|
4
|
-
generator client {
|
|
5
|
-
provider = "prisma-client"
|
|
6
|
-
output = "../src/generated/prisma"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
datasource db {
|
|
10
|
-
provider = "postgresql"
|
|
11
|
-
// Note: url is configured in prisma.config.ts (Prisma v7 pattern)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// =============================================================================
|
|
15
|
-
// Example Model - Replace with your domain models
|
|
16
|
-
// =============================================================================
|
|
17
|
-
|
|
18
|
-
model Example {
|
|
19
|
-
id String @id @default(cuid())
|
|
20
|
-
name String
|
|
21
|
-
createdAt DateTime @default(now())
|
|
22
|
-
updatedAt DateTime @updatedAt
|
|
23
|
-
|
|
24
|
-
@@map("examples")
|
|
25
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prisma v7 configuration for CLI commands (migrations, db push, etc.)
|
|
3
|
-
*
|
|
4
|
-
* Usage with SST:
|
|
5
|
-
* npx sst shell --target Prisma -- npx prisma db push
|
|
6
|
-
* npx sst shell --target Prisma -- npx prisma migrate dev --name <name>
|
|
7
|
-
* npx sst shell --target Prisma -- npx prisma studio
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { defineConfig } from "prisma/config";
|
|
11
|
-
|
|
12
|
-
export default defineConfig({
|
|
13
|
-
schema: "prisma/schema.prisma",
|
|
14
|
-
|
|
15
|
-
datasource: {
|
|
16
|
-
url: process.env.DATABASE_URL!,
|
|
17
|
-
},
|
|
18
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"include": [
|
|
3
|
-
"**/*.ts",
|
|
4
|
-
"**/*.tsx",
|
|
5
|
-
".react-router/types/**/*"
|
|
6
|
-
],
|
|
7
|
-
"compilerOptions": {
|
|
8
|
-
"target": "ES2022",
|
|
9
|
-
"lib": ["DOM", "DOM.Iterable", "ES2022"],
|
|
10
|
-
"types": ["node", "@react-router/node", "vite/client"],
|
|
11
|
-
"module": "ESNext",
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"jsx": "react-jsx",
|
|
14
|
-
"strict": true,
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"noEmit": true,
|
|
17
|
-
"rootDirs": [".", "./.react-router/types"]
|
|
18
|
-
}
|
|
19
|
-
}
|