@augmenting-integrations/create-tenant 8.7.0 → 8.8.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@augmenting-integrations/create-tenant",
3
- "version": "8.7.0",
4
- "description": "Scaffold a new tenant apex app for an augint deployment. Generates a Next 16 + Auth.js v5 + Cognito apex with TenantConfig wired up, library-owned /api/apps registry handler, and /studio admin. Single command: pnpm dlx @augmenting-integrations/create-tenant my-tenant.",
3
+ "version": "8.8.0",
4
+ "description": "Scaffold a new tenant apex app for an augint deployment. Generates a Next 16 + Auth.js v5 + Cognito apex with TenantConfig wired up, library-owned /api/apps static-roster handler, and /studio admin. Single command: pnpm dlx @augmenting-integrations/create-tenant my-tenant.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -0,0 +1,20 @@
1
+ APP_DOMAIN=__TENANT_APEX__
2
+ APEX_DOMAIN=__TENANT_APEX__
3
+ AUTH_COOKIE_DOMAIN=__TENANT_PARENT__
4
+ AUTH_ALLOWED_PARENT_DOMAIN=__TENANT_PARENT__
5
+
6
+ # Cognito (apex-only; from your tenant infra stack)
7
+ AUTH_SECRET_ARN=
8
+ AUTH_COGNITO_SECRET_ARN=
9
+ AUTH_COGNITO_ID=
10
+ AUTH_COGNITO_ISSUER=
11
+
12
+ TENANT_SLUG=__TENANT_NAME__
13
+ STAGE=staging
14
+
15
+ AWS_REGION=us-east-1
16
+ ADMIN_EMAILS=
17
+
18
+ # Local-dev fallbacks
19
+ AUTH_SECRET=dev-only-fallback-not-for-prod
20
+ NODE_ENV=development
@@ -5,7 +5,8 @@ Next.js 16 app for a new augint tenant. It owns:
5
5
 
6
6
  - The OAuth callback (`/api/auth/[...nextauth]`) for the ENTIRE tenant
7
7
  - The session cookie scope (`Domain=__TENANT_PARENT__`)
8
- - The app registry (`/api/apps` for spoke auto-discovery)
8
+ - The runtime tenant app roster (`config/apps.json`, served by
9
+ `/api/apps`). Every spoke's `/api/apps` proxies to this endpoint.
9
10
  - The studio admin
10
11
 
11
12
  ## Local dev
@@ -25,20 +26,23 @@ The application code is portable; the AWS infra is tenant-specific:
25
26
  2. **Cognito User Pool** with one App Client + ONE callback URL:
26
27
  `https://__TENANT_APEX__/api/auth/callback/cognito`
27
28
  3. **Hosted zone + certs** for `__TENANT_APEX__` and `*.__TENANT_APEX__`.
28
- 4. **App registry DynamoDB table** (PK = `slug`). Apex owns CRUD; spokes
29
- read via `/api/apps`. Set `APP_REGISTRY_TABLE` env to the table name.
30
- 5. **Secrets Manager** rows for `AUTH_SECRET`, `AUTH_COGNITO_SECRET`.
31
- 6. **GitHub OIDC role** in each AWS account for CI deploys.
29
+ 4. **Secrets Manager** rows for `AUTH_SECRET`, `AUTH_COGNITO_SECRET`.
30
+ 5. **GitHub OIDC role** in each AWS account for CI deploys.
31
+ 6. **Tenant infra repo** (`__TENANT_NAME__-infra`) with `config/apps.yaml`
32
+ declaring this tenant's app roster (apex + every spoke). Mirror each
33
+ entry into this apex's `config/apps.json`.
32
34
 
33
35
  Copy `template.yaml` from an existing tenant (the example tenant ships one)
34
36
  and adapt the parameters.
35
37
 
36
- ## Adding spokes
38
+ ## Adding spokes after the apex exists
37
39
 
38
40
  ```bash
39
41
  pnpm dlx @augmenting-integrations/create-spoke my-product-spoke
40
42
  ```
41
43
 
42
- Then register the new spoke in this apex's app registry table (slug,
43
- subdomain, displayName, navOrder). The spoke shows up in every other
44
- spoke's AppShell ecosystem nav automatically.
44
+ Then add the new spoke's entry to `__TENANT_NAME__-infra/config/apps.yaml`
45
+ AND to this apex repo's `config/apps.json`. `pnpm exec augint
46
+ validate-app-roster` enforces the two files agree. The spoke's
47
+ `/api/apps` proxies here, so no per-spoke roster maintenance is needed
48
+ and existing spokes do NOT need to be redeployed.
@@ -0,0 +1,12 @@
1
+ {
2
+ "apps": [
3
+ {
4
+ "slug": "apex",
5
+ "role": "apex",
6
+ "subdomain": "",
7
+ "displayName": "__TENANT_NAME__ Portal",
8
+ "navOrder": 0,
9
+ "requiredIdentityGroups": []
10
+ }
11
+ ]
12
+ }
@@ -15,7 +15,6 @@
15
15
  "@augmenting-integrations/aws": "^8.0.0",
16
16
  "@augmenting-integrations/brand": "^8.0.0",
17
17
  "@augmenting-integrations/platform": "^8.0.0",
18
- "@augmenting-integrations/registry": "^8.0.0",
19
18
  "@augmenting-integrations/themes": "^8.0.0",
20
19
  "@augmenting-integrations/ui": "^8.0.0",
21
20
  "next": "^16.2.5",
@@ -24,6 +23,7 @@
24
23
  "react-dom": "^19.2.0"
25
24
  },
26
25
  "devDependencies": {
26
+ "@augmenting-integrations/deploy-tools": "^8.0.0",
27
27
  "@types/node": "^22.0.0",
28
28
  "@types/react": "^19.0.0",
29
29
  "@types/react-dom": "^19.0.0",
@@ -1,7 +1,18 @@
1
- // Auto-discovery endpoint consumed by every spoke's AppShell. Scans the
2
- // DynamoDB app registry table + filters by the caller's Cognito groups.
3
- import { createGetHandler } from "@augmenting-integrations/registry/api-route";
4
- import { auth } from "@/lib/auth";
1
+ // Apex-owned tenant app roster endpoint. Reads the static roster
2
+ // (config/apps.json), filters by the caller's Cognito identity groups,
3
+ // and returns the visible apps + their absolute URLs. Spokes proxy
4
+ // their /api/apps to this endpoint -- the apex is the single roster
5
+ // owner in the tenant ecosystem.
6
+
7
+ import { createAppsRouteHandler } from "@augmenting-integrations/platform/server";
8
+ import { auth, tenant } from "@/lib/auth";
9
+ import appsRoster from "../../../../config/apps.json";
5
10
 
6
- export const GET = createGetHandler({ authFn: auth });
7
11
  export const runtime = "nodejs";
12
+ export const dynamic = "force-dynamic";
13
+
14
+ export const { GET } = createAppsRouteHandler({
15
+ roster: appsRoster,
16
+ auth,
17
+ tenant,
18
+ });