create-nextblock 0.15.5 → 0.15.8
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 +50 -26
- package/templates/nextblock-template/app/api/cron/reset-sandbox/route.ts +14 -0
- package/templates/nextblock-template/app/layout.tsx +7 -3
- package/templates/nextblock-template/app/lib/seo.ts +319 -311
- package/templates/nextblock-template/docs/05-DEVELOPER-GUIDE.md +25 -19
- package/templates/nextblock-template/docs/06-CLI-AND-SCAFFOLDING.md +1 -1
- package/templates/nextblock-template/docs/08-NEXTBLOCK-CORTEX-AI-ARCHITECTURE.md +2 -2
- package/templates/nextblock-template/docs/12-VERCEL-DEPLOYMENT.md +32 -9
- package/templates/nextblock-template/docs/TECHNICAL_SPECIFICATION.md +540 -542
- package/templates/nextblock-template/docs/assets/lighthouse-scores.png +0 -0
- package/templates/nextblock-template/package.json +14 -1
- package/templates/nextblock-template/public/assets/nextblock-banner.jpg +0 -0
|
@@ -7,8 +7,8 @@ setup helper in `tools/scripts/setup.mjs`.
|
|
|
7
7
|
|
|
8
8
|
### Prerequisites
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
Configuration happens in the browser, not the terminal — but the wizard asks for
|
|
11
|
+
credentials from these services, so have them ready:
|
|
12
12
|
|
|
13
13
|
1. **Supabase project** (https://supabase.com/dashboard) — Reference ID
|
|
14
14
|
(Project Settings → General), connection string (Connect → Direct connection →
|
|
@@ -25,24 +25,30 @@ create them first:
|
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
npm install
|
|
28
|
-
npm run setup
|
|
29
|
-
npx nx serve nextblock
|
|
28
|
+
npm run setup # prints the next steps — it asks nothing
|
|
29
|
+
npx nx serve nextblock # then open http://localhost:4200/setup
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
|
|
32
|
+
`npm run setup` (`tools/scripts/setup.mjs`) is **informational only**. It writes
|
|
33
|
+
no files, prompts for nothing, and touches no database — it just points you at
|
|
34
|
+
the browser wizard. Terminal-based configuration was removed; everything below
|
|
35
|
+
now happens in the **First-Boot Setup Wizard** at `/setup`:
|
|
33
36
|
|
|
34
|
-
-
|
|
35
|
-
-
|
|
36
|
-
-
|
|
37
|
-
|
|
38
|
-
-
|
|
39
|
-
- applies the full schema baseline to the new database
|
|
40
|
-
(`npm run db:migrate:fresh`)
|
|
41
|
-
- syncs hosted Supabase Auth — custom SMTP and branded email templates
|
|
42
|
-
(`npm run configure:supabase-auth`)
|
|
37
|
+
- connecting Supabase and saving the credentials
|
|
38
|
+
- applying the schema to the new database
|
|
39
|
+
- configuring media storage (R2, or the connected Supabase project's storage)
|
|
40
|
+
and outbound email
|
|
41
|
+
- creating the first administrator
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
A fresh instance redirects every route to `/setup` until an admin exists, so you
|
|
44
|
+
cannot miss it.
|
|
45
|
+
|
|
46
|
+
> **Self-hosted Docker is the exception** — `npm run docker:setup` is a real,
|
|
47
|
+
> one-command, non-interactive bootstrap that brings up the whole stack and
|
|
48
|
+
> applies migrations. See [11-SELF-HOSTED-DOCKER.md](./11-SELF-HOSTED-DOCKER.md).
|
|
49
|
+
|
|
50
|
+
If you would rather configure by hand, the root sample file `.env.example` is the
|
|
51
|
+
reference template for a manual `.env.local`.
|
|
46
52
|
|
|
47
53
|
### First login
|
|
48
54
|
|
|
@@ -105,9 +111,9 @@ repo expects at least:
|
|
|
105
111
|
- `SUPABASE_PROJECT_ID` for Supabase CLI migration tooling
|
|
106
112
|
- `SUPABASE_ACCESS_TOKEN` for Supabase CLI linking
|
|
107
113
|
- `POSTGRES_URL` or `DATABASE_URL` for SQL fallback paths and db tooling
|
|
108
|
-
- `NEXT_PUBLIC_URL` —
|
|
114
|
+
- `NEXT_PUBLIC_URL` — set by the `/setup` wizard
|
|
109
115
|
- `CRON_SECRET`, `DRAFT_MODE_SECRET`, `REVALIDATE_SECRET_TOKEN` — auto-generated
|
|
110
|
-
by
|
|
116
|
+
by the `/setup` wizard
|
|
111
117
|
|
|
112
118
|
> **Supabase key aliases.** The names above are the local-dev canon, but the app also
|
|
113
119
|
> accepts the *new-style* names the hosted/Vercel Supabase Marketplace integration
|
|
@@ -120,7 +126,7 @@ repo expects at least:
|
|
|
120
126
|
> production — when unset they are derived from the service-role key (see
|
|
121
127
|
> `apps/nextblock/lib/app-secrets.ts`). See [12-VERCEL-DEPLOYMENT.md](./12-VERCEL-DEPLOYMENT.md).
|
|
122
128
|
|
|
123
|
-
Captured by
|
|
129
|
+
Captured by the `/setup` wizard and needed for a complete CMS:
|
|
124
130
|
|
|
125
131
|
- R2 credentials for media storage. The app builds and serves without them, but
|
|
126
132
|
uploads, image processing, and full-site backups return 500 until R2 is set.
|
|
@@ -87,7 +87,7 @@ It currently:
|
|
|
87
87
|
- copies `apps/nextblock` into `templates/nextblock-template`
|
|
88
88
|
- skips `node_modules`, `.next`, backups, and other generated folders
|
|
89
89
|
- copies the root `docs/` folder into the template docs directory
|
|
90
|
-
- copies `.env.example`
|
|
90
|
+
- copies `.env.example` (the legacy `.env.exemple` spelling is still accepted as a fallback)
|
|
91
91
|
- rewrites imports for packaged library consumption
|
|
92
92
|
- removes the copied `project.json`
|
|
93
93
|
- syncs package versions
|
|
@@ -75,7 +75,7 @@ Known incomplete or future work:
|
|
|
75
75
|
| `libs/utils/src/lib/nextblock-packages.ts` | Package registry. Contains `cortex-ai` metadata and Freemius product/plan ids. |
|
|
76
76
|
| `libs/cortex/src/lib/ai-config.ts` | Server-only Cortex AI constants and environment accessors. |
|
|
77
77
|
| `libs/cortex/src/lib/ai-key-crypto.ts` | AES-256-GCM encryption/decryption helpers for stored OpenRouter BYOK keys. |
|
|
78
|
-
| `.env.
|
|
78
|
+
| `.env.example` | Documents `FREEMIUS_AI_SANDBOX_KEY`, `OPENROUTER_API_KEY`, and `CORTEX_AI_ENCRYPTION_KEY`. |
|
|
79
79
|
| `libs/environment.d.ts` | Type declarations for Cortex AI environment variables. |
|
|
80
80
|
|
|
81
81
|
### Database and Sandbox
|
|
@@ -189,7 +189,7 @@ Current usage:
|
|
|
189
189
|
|
|
190
190
|
## Environment Variables
|
|
191
191
|
|
|
192
|
-
Environment variables are documented in `.env.
|
|
192
|
+
Environment variables are documented in `.env.example` and typed in `libs/environment.d.ts`.
|
|
193
193
|
|
|
194
194
|
```txt
|
|
195
195
|
FREEMIUS_AI_SANDBOX_KEY=
|
|
@@ -20,12 +20,33 @@ have to type (see "No environment variables required" below). The only interacti
|
|
|
20
20
|
Supabase integration's "create database" step, which can't be skipped because provisioning
|
|
21
21
|
a Postgres DB requires choosing a region/plan.
|
|
22
22
|
|
|
23
|
-
> **Why `stores`, not `integration-ids`?**
|
|
24
|
-
>
|
|
25
|
-
>
|
|
26
|
-
>
|
|
27
|
-
>
|
|
28
|
-
>
|
|
23
|
+
> **Why `stores`, not `integration-ids`?** Both parameters are current — neither is
|
|
24
|
+
> deprecated — but they do different jobs, and only one of them provisions a database.
|
|
25
|
+
>
|
|
26
|
+
> **`integration-ids=oac_…`** ([docs](https://vercel.com/docs/deploy-button/integrations))
|
|
27
|
+
> only forces an integration to be **installed and authorized before the project can be
|
|
28
|
+
> imported** (up to three per project). Vercel's documentation makes no promise about
|
|
29
|
+
> environment variables either way: whether credentials land in the project is a property
|
|
30
|
+
> of that integration's own OAuth flow, not of the parameter. Supabase's flow does set
|
|
31
|
+
> them — the `vercel/next.js` `with-supabase` example states that "all relevant environment
|
|
32
|
+
> variables will be assigned to the project" after installation — so this route can work.
|
|
33
|
+
> It just isn't Vercel guaranteeing it, and it says nothing about *when* they land.
|
|
34
|
+
>
|
|
35
|
+
> **`stores`** ([docs](https://vercel.com/docs/deploy-button/source)) is the native
|
|
36
|
+
> Marketplace path: it creates the store **as part of the deployment** and creates the
|
|
37
|
+
> environment variables for it. That timing is what NextBlock actually depends on — the
|
|
38
|
+
> build-time migration hook needs `POSTGRES_URL` to exist *during* the first build, not
|
|
39
|
+
> after it. See "Build configuration" below.
|
|
40
|
+
>
|
|
41
|
+
> The deciding evidence is Vercel's own Template Gallery entry for the Supabase Starter,
|
|
42
|
+
> which ships the **exact `stores` payload** used above.
|
|
43
|
+
>
|
|
44
|
+
> **If you ever add an `integration-ids` fallback, the only correct Supabase value is
|
|
45
|
+
> `oac_VqOgBHqhEoFTPzGkPd7L0iH6`** — confirmed in `supabase/supabase`'s own example READMEs
|
|
46
|
+
> and in the Vercel record behind `vercel.com/templates/next.js/supabase`. A plausible
|
|
47
|
+
> lookalike, `oac_VqOgBHqhvvqGe2YujqqiW0wo`, circulates in AI-generated snippets and is
|
|
48
|
+
> **not a real integration id**; it shares only the first twelve characters. An unknown id
|
|
49
|
+
> makes Vercel refuse the import outright, which breaks the deploy completely.
|
|
29
50
|
|
|
30
51
|
## Connect the database (Supabase integration)
|
|
31
52
|
|
|
@@ -88,9 +109,11 @@ imports the workspace libraries one level up, which a custom Root Directory woul
|
|
|
88
109
|
|
|
89
110
|
## No environment variables required
|
|
90
111
|
|
|
91
|
-
A Deploy-Button URL can
|
|
92
|
-
|
|
93
|
-
|
|
112
|
+
A Deploy-Button URL can carry environment variable **names** (`env`), and non-sensitive
|
|
113
|
+
**default values** (`envDefaults`) — but never secrets: Vercel's own docs warn that the URL
|
|
114
|
+
"is saved in the browser history, making it insecure" and to "never use default values for
|
|
115
|
+
sensitive data like passwords, API keys, tokens, database credentials." NextBlock sidesteps
|
|
116
|
+
the question entirely by resolving everything in-app, so the button prompts for nothing:
|
|
94
117
|
|
|
95
118
|
- **`NEXT_PUBLIC_URL`** — optional. When unset the app falls back to Vercel's
|
|
96
119
|
production URL (`VERCEL_PROJECT_PRODUCTION_URL` server-side /
|