@nextblock-cms/db 0.2.32 → 0.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.
Files changed (75) hide show
  1. package/cache-Bb4TkKGq.js +38 -0
  2. package/cache-D0Q6YeSV.mjs +10150 -0
  3. package/index.cjs.js +1 -1
  4. package/index.es.js +66 -61
  5. package/package.json +1 -1
  6. package/server.cjs.js +1 -1
  7. package/server.es.js +48 -43
  8. package/supabase/config.toml +330 -319
  9. package/supabase/functions/import_map.json +6 -0
  10. package/supabase/functions/nextblock-migration-ingest/index.d.ts +1 -0
  11. package/supabase/functions/nextblock-migration-ingest/index.js +519 -0
  12. package/supabase/functions/nextblock-migration-ingest/index.js.map +7 -0
  13. package/supabase/functions/nextblock-migration-ingest/index.ts +646 -0
  14. package/supabase/migrations/00000000000000_setup_foundation_and_enums.sql +40 -0
  15. package/supabase/migrations/00000000000001_setup_cms_core.sql +124 -0
  16. package/supabase/migrations/00000000000002_setup_content_tables.sql +138 -0
  17. package/supabase/migrations/00000000000003_setup_catalog_and_licensing.sql +160 -0
  18. package/supabase/migrations/00000000000004_setup_fulfillment_shipping_taxes_and_currencies.sql +797 -0
  19. package/supabase/migrations/00000000000005_setup_functions_and_triggers.sql +767 -0
  20. package/supabase/migrations/00000000000006_setup_rls_and_grants.sql +872 -0
  21. package/supabase/migrations/00000000000007_setup_indexes.sql +158 -0
  22. package/supabase/migrations/00000000000008_seed_platform_defaults.sql +155 -0
  23. package/supabase/migrations/00000000000009_seed_translations.sql +801 -0
  24. package/supabase/migrations/00000000000010_seed_content_scaffold.sql +1088 -0
  25. package/supabase/migrations/00000000000011_setup_cortex_ai_settings.sql +81 -0
  26. package/supabase/migrations/00000000000012_setup_commerce_coupons.sql +275 -0
  27. package/supabase/migrations/00000000000013_setup_cortex_ai_db_mutation_audit.sql +47 -0
  28. package/supabase/migrations/00000000000014_setup_content_drafts.sql +119 -0
  29. package/supabase/migrations/00000000000015_setup_product_drafts.sql +97 -0
  30. package/supabase/migrations/00000000000016_add_feature_image_to_pages.sql +8 -0
  31. package/supabase/migrations/00000000000017_add_product_blocks.sql +118 -0
  32. package/supabase/migrations/00000000000018_setup_bot_protection_settings.sql +77 -0
  33. package/supabase/migrations/00000000000019_add_product_categories.sql +64 -0
  34. package/supabase/migrations/00000000000020_add_category_translations.sql +10 -0
  35. package/supabase/migrations/00000000000021_migrate_hero_blocks_to_sections.sql +29 -0
  36. package/supabase/migrations/00000000000022_seed_cortex_ai_guide_post.sql +184 -0
  37. package/supabase/migrations/00000000000023_setup_custom_block_definitions.sql +183 -0
  38. package/supabase/migrations/00000000000024_setup_ucp_cart_sessions.sql +72 -0
  39. package/supabase/migrations/00000000000025_add_sale_schedule_columns.sql +406 -0
  40. package/supabase/migrations/00000000000026_seed_on_sale_translation.sql +9 -0
  41. package/supabase/migrations/00000000000027_setup_privacy_and_mfa.sql +479 -0
  42. package/supabase/migrations/00000000000028_clear_advisor_warnings.sql +93 -0
  43. package/supabase/migrations/00000000000029_refresh_setup_article.sql +252 -0
  44. package/supabase/templates/confirmation.html +54 -0
  45. package/supabase/templates/email_change.html +53 -0
  46. package/supabase/templates/invite.html +53 -0
  47. package/supabase/templates/magic_link.html +53 -0
  48. package/supabase/templates/reauthentication.html +45 -0
  49. package/supabase/templates/recovery.html +54 -0
  50. package/index.d.ts +0 -4
  51. package/lib/supabase/client.d.ts +0 -9
  52. package/lib/supabase/middleware.d.ts +0 -2
  53. package/lib/supabase/server.d.ts +0 -7
  54. package/lib/supabase/ssg-client.d.ts +0 -2
  55. package/lib/supabase/types.d.ts +0 -635
  56. package/server.d.ts +0 -2
  57. package/ssg-client-CiaENGEv.js +0 -1
  58. package/ssg-client-DgUYZgPq.mjs +0 -8
  59. package/supabase/migrations/00000000000000_setup_extensions_and_roles.sql +0 -54
  60. package/supabase/migrations/00000000000001_setup_site_settings.sql +0 -19
  61. package/supabase/migrations/00000000000002_setup_profiles.sql +0 -87
  62. package/supabase/migrations/00000000000003_setup_languages.sql +0 -43
  63. package/supabase/migrations/00000000000004_setup_media.sql +0 -54
  64. package/supabase/migrations/00000000000005_setup_posts.sql +0 -56
  65. package/supabase/migrations/00000000000006_setup_pages.sql +0 -51
  66. package/supabase/migrations/00000000000007_setup_blocks.sql +0 -47
  67. package/supabase/migrations/00000000000008_setup_navigation.sql +0 -51
  68. package/supabase/migrations/00000000000009_setup_logos.sql +0 -13
  69. package/supabase/migrations/00000000000010_setup_translations.sql +0 -29
  70. package/supabase/migrations/00000000000011_setup_revisions.sql +0 -38
  71. package/supabase/migrations/00000000000012_setup_rls_policies.sql +0 -239
  72. package/supabase/migrations/00000000000013_seed_data.sql +0 -149
  73. package/supabase/migrations/00000000000014_seed_homepage_blocks.sql +0 -661
  74. package/supabase/migrations/00000000000015_seed_how_it_works.sql +0 -89
  75. package/supabase/migrations/00000000000016_sandbox_setup.sql +0 -834
@@ -0,0 +1,252 @@
1
+ -- Refresh the seeded "How to Setup NextBlock" tutorial (EN + FR) so it matches the
2
+ -- current installer flow:
3
+ -- * `npm run setup` now requires Supabase + Cloudflare R2 + SMTP up front,
4
+ -- * `npx nx serve nextblock` serves on http://localhost:4200, and
5
+ -- * the first account to sign up automatically becomes the admin (email confirmation on).
6
+ --
7
+ -- Forward-only and idempotent: it replaces the single text block of the two setup-article
8
+ -- posts seeded in 00000000000010_seed_content_scaffold.sql. Safe to re-run; a no-op if the
9
+ -- posts do not exist.
10
+
11
+ WITH target_posts AS (
12
+ SELECT id, language_id, slug
13
+ FROM public.posts
14
+ WHERE slug IN ('how-to-setup-nextblock', 'comment-configurer-nextblock')
15
+ ),
16
+ purged AS (
17
+ DELETE FROM public.blocks
18
+ WHERE post_id IN (SELECT id FROM target_posts)
19
+ )
20
+ INSERT INTO public.blocks (post_id, language_id, block_type, content, "order")
21
+
22
+ -- EN: How to Setup NextBlock
23
+ SELECT tp.id, tp.language_id, 'text', jsonb_build_object('html_content',
24
+ $$<p class='text-lg leading-8 text-slate-700 dark:text-slate-300'>There are two strong ways to start with NextBlock: clone the full monorepo if you want the whole platform, or scaffold a standalone app if you want to ship quickly. Both paths land you on the same editorial model, design system, and CMS foundation.</p>
25
+
26
+ <div class='rounded-[2rem] border border-blue-200 bg-blue-50/80 p-6 my-10 dark:border-blue-500/20 dark:bg-blue-500/10'>
27
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-blue-700 dark:text-blue-200'>Choose your path</p>
28
+ <div class='grid gap-6 md:grid-cols-2 mt-5'>
29
+ <div class='rounded-2xl border border-blue-100 bg-white p-5 dark:border-blue-500/10 dark:bg-slate-900/40'>
30
+ <h3 class='mt-0 text-xl text-slate-900 dark:text-white'>Monorepo</h3>
31
+ <p class='text-sm text-slate-600 dark:text-slate-300'>Best for contributors, plugin authors, and teams that want direct access to every app and shared package.</p>
32
+ </div>
33
+ <div class='rounded-2xl border border-blue-100 bg-white p-5 dark:border-blue-500/10 dark:bg-slate-900/40'>
34
+ <h3 class='mt-0 text-xl text-slate-900 dark:text-white'>CLI starter</h3>
35
+ <p class='text-sm text-slate-600 dark:text-slate-300'>Best for launching a production-ready Next.js project with NextBlock&trade; already wired in and easy to deploy.</p>
36
+ </div>
37
+ </div>
38
+ </div>
39
+
40
+ <figure class='my-12 overflow-hidden rounded-[2rem] border border-slate-200/80 bg-slate-950 shadow-2xl dark:border-white/10'>
41
+ <img src='/images/included.webp' alt='NextBlock&trade; platform artwork showing the CMS, blocks, and integrations that ship together' class='w-full h-auto object-cover' />
42
+ <figcaption class='border-t border-white/10 px-6 py-4 text-sm text-slate-300'>Whichever path you choose, you still inherit the same block editor, CMS shell, and shared product language.</figcaption>
43
+ </figure>
44
+
45
+ <div class='rounded-[2rem] border border-amber-200 bg-amber-50/80 p-6 my-10 dark:border-amber-500/20 dark:bg-amber-500/10'>
46
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-amber-700 dark:text-amber-200'>Before you start</p>
47
+ <p class='mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200'>The setup wizard asks for credentials from three services, so create them first:</p>
48
+ <ul class='mt-4 list-disc pl-6 space-y-2 text-sm text-slate-700 dark:text-slate-200'>
49
+ <li><strong>Supabase project</strong> &ndash; Reference ID (Project Settings &gt; General), connection string (Connect &gt; Direct connection &gt; URI), the anon and service_role keys, and a Personal Access Token (Account &gt; Access Tokens).</li>
50
+ <li><strong>Cloudflare R2 bucket</strong> &ndash; create a bucket, enable its Public Development URL, and create an Account API token with Object Read &amp; Write. Copy the Access Key ID and Secret Access Key (shown only once).</li>
51
+ <li><strong>SMTP credentials</strong> &ndash; SMTP2GO works very well; required so Supabase can email the confirmation link your first admin needs to sign in.</li>
52
+ </ul>
53
+ </div>
54
+
55
+ <h2>Path 1: Clone the Monorepo</h2>
56
+ <p>This route is ideal when you want the full Nx workspace and every internal package available locally.</p>
57
+
58
+ <div class='grid gap-6 md:grid-cols-2 my-8'>
59
+ <div class='rounded-3xl border border-slate-200/80 bg-slate-50 p-6 dark:border-white/10 dark:bg-white/5'>
60
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-slate-500 dark:text-slate-400'>You get</p>
61
+ <ul class='mt-4 list-disc pl-5 space-y-2 text-sm'>
62
+ <li>The public site, CMS app, CLI source, and shared libraries</li>
63
+ <li>Direct access to <code>libs/</code> for custom block and package work</li>
64
+ <li>Workspace tools like <code>nx graph</code> for dependency visibility</li>
65
+ </ul>
66
+ </div>
67
+ <div class='rounded-3xl border border-slate-200/80 bg-slate-50 p-6 dark:border-white/10 dark:bg-white/5'>
68
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-slate-500 dark:text-slate-400'>Good fit for</p>
69
+ <ul class='mt-4 list-disc pl-5 space-y-2 text-sm'>
70
+ <li>Core contributors and maintainers</li>
71
+ <li>Teams building custom modules or premium extensions</li>
72
+ <li>Agencies that want end-to-end control over the platform</li>
73
+ </ul>
74
+ </div>
75
+ </div>
76
+
77
+ <pre><code>git clone https://github.com/nextblock-cms/nextblock.git
78
+ cd nextblock
79
+ npm install
80
+ npm run setup</code></pre>
81
+
82
+ <p>The <code>npm run setup</code> wizard creates <code>.env.local</code>, collects your Supabase, Cloudflare R2, and SMTP details, generates local secrets (<code>CRON_SECRET</code>, <code>DRAFT_MODE_SECRET</code>, <code>REVALIDATE_SECRET_TOKEN</code>), links the Supabase CLI, and applies the full schema to your database with <code>npm run db:migrate:fresh</code>.</p>
83
+
84
+ <p>Then start the app:</p>
85
+ <pre><code>npx nx serve nextblock</code></pre>
86
+
87
+ <div class='rounded-3xl border border-emerald-200 bg-emerald-50/80 p-6 my-8 dark:border-emerald-500/20 dark:bg-emerald-500/10'>
88
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-emerald-700 dark:text-emerald-200'>First login</p>
89
+ <p class='mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200'>The dev server runs at <code>http://localhost:4200</code>. Open <code>/sign-up</code> and create your account &ndash; the first account to register automatically becomes the admin. Confirm your email (or confirm the user in Supabase &gt; Authentication &gt; Users), then sign in to reach the CMS at <code>/cms/dashboard</code>.</p>
90
+ </div>
91
+
92
+ <p>Useful monorepo commands:</p>
93
+ <pre><code># Build every workspace package
94
+ npm run all-builds
95
+
96
+ # Lint the main application
97
+ npm run nx:lint:nextblock
98
+
99
+ # Regenerate database types
100
+ npm run db:types
101
+
102
+ # Inspect workspace relationships
103
+ npx nx graph</code></pre>
104
+
105
+ <h2>Path 2: Use the CLI Starter</h2>
106
+ <p>If your goal is to launch quickly, the CLI gives you a standalone Next.js app with NextBlock&trade; already embedded.</p>
107
+
108
+ <pre><code>npm create nextblock@latest my-site
109
+ cd my-site</code></pre>
110
+
111
+ <p>The CLI copies a production-ready template, rewrites workspace imports to published packages, and can run the same setup flow for you. Your result is a normal Next.js app with no Nx requirement, so <code>npm run dev</code> serves it on <code>http://localhost:3000</code>.</p>
112
+
113
+ <p>Configure your environment in <code>.env.local</code>:</p>
114
+ <pre><code>NEXT_PUBLIC_SUPABASE_URL=your-project-url
115
+ NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
116
+ SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
117
+ NEXT_PUBLIC_URL=http://localhost:3000</code></pre>
118
+
119
+ <p>Push the schema and start developing:</p>
120
+ <pre><code>npm run db:push
121
+ npm run dev</code></pre>
122
+
123
+ <div class='rounded-3xl border border-amber-200 bg-amber-50/80 p-6 my-8 dark:border-amber-500/20 dark:bg-amber-500/10'>
124
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-amber-700 dark:text-amber-200'>Tip</p>
125
+ <p class='mb-0 text-sm text-slate-700 dark:text-slate-200'>The CLI path is the fastest way to evaluate NextBlock&trade; with your own content model before you decide whether you need the full workspace.</p>
126
+ </div>
127
+
128
+ <h2>Activating Premium Modules</h2>
129
+ <p>For CLI-generated projects, the commerce package can be activated with a single command:</p>
130
+ <pre><code>npx create-nextblock activate ecommerce</code></pre>
131
+ <p>This injects wrappers for <code>/cms/orders</code>, <code>/cms/products</code>, <code>/checkout</code>, and the checkout API, all gated through <code>verifyPackageOnline()</code> so premium routes stay aligned with your license.</p>
132
+
133
+ <h2>Deployment</h2>
134
+ <p>NextBlock&trade; deploys like a standard Next.js app. Push to Vercel, Netlify, or any Node.js host, then make sure your server-side environment variables such as the Supabase service role, R2 credentials, SMTP, and <code>CRON_SECRET</code> are configured in that environment, and set <code>NEXT_PUBLIC_URL</code> to your production domain.</p>$$
135
+ ), 0 FROM target_posts tp WHERE tp.slug = 'how-to-setup-nextblock'
136
+
137
+ UNION ALL
138
+
139
+ -- FR: Comment configurer NextBlock
140
+ SELECT tp.id, tp.language_id, 'text', jsonb_build_object('html_content',
141
+ $$<p class='text-lg leading-8 text-slate-700 dark:text-slate-300'>Il existe deux bonnes facons de lancer NextBlock&trade; : cloner le monorepo complet si vous voulez toute la plateforme, ou partir du CLI si vous voulez aller vite. Dans les deux cas, vous retrouvez le meme modele editorial, le meme shell CMS et la meme base produit.</p>
142
+
143
+ <div class='rounded-[2rem] border border-blue-200 bg-blue-50/80 p-6 my-10 dark:border-blue-500/20 dark:bg-blue-500/10'>
144
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-blue-700 dark:text-blue-200'>Choisissez votre chemin</p>
145
+ <div class='grid gap-6 md:grid-cols-2 mt-5'>
146
+ <div class='rounded-2xl border border-blue-100 bg-white p-5 dark:border-blue-500/10 dark:bg-slate-900/40'>
147
+ <h3 class='mt-0 text-xl text-slate-900 dark:text-white'>Monorepo</h3>
148
+ <p class='text-sm text-slate-600 dark:text-slate-300'>Ideal pour les contributeurs, auteurs de plugins et equipes qui veulent travailler directement dans tous les packages partages.</p>
149
+ </div>
150
+ <div class='rounded-2xl border border-blue-100 bg-white p-5 dark:border-blue-500/10 dark:bg-slate-900/40'>
151
+ <h3 class='mt-0 text-xl text-slate-900 dark:text-white'>Starter CLI</h3>
152
+ <p class='text-sm text-slate-600 dark:text-slate-300'>Ideal pour demarrer une app Next.js prete a deployer avec NextBlock&trade; deja integre.</p>
153
+ </div>
154
+ </div>
155
+ </div>
156
+
157
+ <figure class='my-12 overflow-hidden rounded-[2rem] border border-slate-200/80 bg-slate-950 shadow-2xl dark:border-white/10'>
158
+ <img src='/images/included.webp' alt='Visuel NextBlock&trade; montrant le CMS, les blocs et les integrations qui arrivent ensemble' class='w-full h-auto object-cover' />
159
+ <figcaption class='border-t border-white/10 px-6 py-4 text-sm text-slate-300'>Quel que soit le chemin choisi, vous heritez du meme editeur de blocs, du meme shell CMS et du meme langage produit.</figcaption>
160
+ </figure>
161
+
162
+ <div class='rounded-[2rem] border border-amber-200 bg-amber-50/80 p-6 my-10 dark:border-amber-500/20 dark:bg-amber-500/10'>
163
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-amber-700 dark:text-amber-200'>Avant de commencer</p>
164
+ <p class='mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200'>L'assistant de configuration demande des identifiants de trois services, alors creez-les d'abord :</p>
165
+ <ul class='mt-4 list-disc pl-6 space-y-2 text-sm text-slate-700 dark:text-slate-200'>
166
+ <li><strong>Projet Supabase</strong> &ndash; Reference ID (Project Settings &gt; General), chaine de connexion (Connect &gt; Direct connection &gt; URI), les cles anon et service_role, et un Personal Access Token (Account &gt; Access Tokens).</li>
167
+ <li><strong>Bucket Cloudflare R2</strong> &ndash; creez un bucket, activez son Public Development URL, et creez un Account API token avec Object Read &amp; Write. Copiez l'Access Key ID et la Secret Access Key (affichee une seule fois).</li>
168
+ <li><strong>Identifiants SMTP</strong> &ndash; SMTP2GO fonctionne tres bien ; requis pour que Supabase envoie le lien de confirmation dont votre premier admin a besoin pour se connecter.</li>
169
+ </ul>
170
+ </div>
171
+
172
+ <h2>Chemin 1 : cloner le monorepo</h2>
173
+ <p>Cette option est la meilleure si vous voulez tout le workspace Nx et chaque package interne disponible en local.</p>
174
+
175
+ <div class='grid gap-6 md:grid-cols-2 my-8'>
176
+ <div class='rounded-3xl border border-slate-200/80 bg-slate-50 p-6 dark:border-white/10 dark:bg-white/5'>
177
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-slate-500 dark:text-slate-400'>Vous obtenez</p>
178
+ <ul class='mt-4 list-disc pl-5 space-y-2 text-sm'>
179
+ <li>Le site public, l'app CMS, le code du CLI et les librairies partagees</li>
180
+ <li>Un acces direct a <code>libs/</code> pour les blocs et modules personnalises</li>
181
+ <li>Les outils de workspace comme <code>nx graph</code> pour visualiser les dependances</li>
182
+ </ul>
183
+ </div>
184
+ <div class='rounded-3xl border border-slate-200/80 bg-slate-50 p-6 dark:border-white/10 dark:bg-white/5'>
185
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-slate-500 dark:text-slate-400'>Bon choix pour</p>
186
+ <ul class='mt-4 list-disc pl-5 space-y-2 text-sm'>
187
+ <li>Les mainteneurs et contributeurs coeur</li>
188
+ <li>Les equipes qui construisent des extensions sur mesure</li>
189
+ <li>Les agences qui veulent un controle complet de la plateforme</li>
190
+ </ul>
191
+ </div>
192
+ </div>
193
+
194
+ <pre><code>git clone https://github.com/nextblock-cms/nextblock.git
195
+ cd nextblock
196
+ npm install
197
+ npm run setup</code></pre>
198
+
199
+ <p>L'assistant <code>npm run setup</code> cree <code>.env.local</code>, collecte vos identifiants Supabase, Cloudflare R2 et SMTP, genere les secrets locaux (<code>CRON_SECRET</code>, <code>DRAFT_MODE_SECRET</code>, <code>REVALIDATE_SECRET_TOKEN</code>), lie le CLI Supabase et applique le schema complet a votre base avec <code>npm run db:migrate:fresh</code>.</p>
200
+
201
+ <p>Puis lancez l'application :</p>
202
+ <pre><code>npx nx serve nextblock</code></pre>
203
+
204
+ <div class='rounded-3xl border border-emerald-200 bg-emerald-50/80 p-6 my-8 dark:border-emerald-500/20 dark:bg-emerald-500/10'>
205
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-emerald-700 dark:text-emerald-200'>Premiere connexion</p>
206
+ <p class='mt-3 mb-0 text-sm text-slate-700 dark:text-slate-200'>Le serveur de dev tourne sur <code>http://localhost:4200</code>. Ouvrez <code>/sign-up</code> et creez votre compte &ndash; le premier compte inscrit devient automatiquement l'administrateur. Confirmez votre email (ou confirmez l'utilisateur dans Supabase &gt; Authentication &gt; Users), puis connectez-vous pour acceder au CMS sur <code>/cms/dashboard</code>.</p>
207
+ </div>
208
+
209
+ <p>Commandes utiles dans le monorepo :</p>
210
+ <pre><code># Build de tous les packages
211
+ npm run all-builds
212
+
213
+ # Lint de l'application principale
214
+ npm run nx:lint:nextblock
215
+
216
+ # Regenerer les types base de donnees
217
+ npm run db:types
218
+
219
+ # Inspecter les relations du workspace
220
+ npx nx graph</code></pre>
221
+
222
+ <h2>Chemin 2 : utiliser le starter CLI</h2>
223
+ <p>Si votre but est d'aller vite, le CLI vous donne une app Next.js autonome avec NextBlock&trade; deja integre.</p>
224
+
225
+ <pre><code>npm create nextblock@latest mon-site
226
+ cd mon-site</code></pre>
227
+
228
+ <p>Le CLI copie un template pret pour la production, remplace les imports workspace par les packages publies, et peut lancer la meme configuration initiale. Le resultat reste une app Next.js classique, sans dependance a Nx, donc <code>npm run dev</code> la sert sur <code>http://localhost:3000</code>.</p>
229
+
230
+ <p>Configurez votre environnement dans <code>.env.local</code> :</p>
231
+ <pre><code>NEXT_PUBLIC_SUPABASE_URL=your-project-url
232
+ NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
233
+ SUPABASE_SERVICE_ROLE_KEY=your-service-role-key
234
+ NEXT_PUBLIC_URL=http://localhost:3000</code></pre>
235
+
236
+ <p>Poussez le schema puis demarrez :</p>
237
+ <pre><code>npm run db:push
238
+ npm run dev</code></pre>
239
+
240
+ <div class='rounded-3xl border border-amber-200 bg-amber-50/80 p-6 my-8 dark:border-amber-500/20 dark:bg-amber-500/10'>
241
+ <p class='text-xs font-semibold uppercase tracking-[0.22em] text-amber-700 dark:text-amber-200'>Conseil</p>
242
+ <p class='mb-0 text-sm text-slate-700 dark:text-slate-200'>Le chemin CLI est le moyen le plus rapide d'evaluer NextBlock&trade; avec votre propre modele de contenu avant de passer, si besoin, au workspace complet.</p>
243
+ </div>
244
+
245
+ <h2>Activer les modules premium</h2>
246
+ <p>Pour un projet genere via le CLI, le package commerce peut etre active avec une seule commande :</p>
247
+ <pre><code>npx create-nextblock activate ecommerce</code></pre>
248
+ <p>Cette commande injecte les wrappers pour <code>/cms/orders</code>, <code>/cms/products</code>, <code>/checkout</code> et l'API checkout, le tout protege par <code>verifyPackageOnline()</code> afin de garder les routes premium alignees avec la licence.</p>
249
+
250
+ <h2>Deploiement</h2>
251
+ <p>NextBlock&trade; se deploie comme une app Next.js standard. Publiez sur Vercel, Netlify ou tout hebergeur Node.js, puis configurez les variables serveur comme la cle service role Supabase, les identifiants R2, le SMTP et <code>CRON_SECRET</code>, et definissez <code>NEXT_PUBLIC_URL</code> sur votre domaine de production.</p>$$
252
+ ), 0 FROM target_posts tp WHERE tp.slug = 'comment-configurer-nextblock';
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Confirm your email</title>
7
+ </head>
8
+ <body style="margin:0;background:#f5f7fb;font-family:Arial,sans-serif;color:#0f172a;">
9
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="padding:32px 16px;">
10
+ <tr>
11
+ <td align="center">
12
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;background:#ffffff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;">
13
+ <tr>
14
+ <td style="padding:32px 32px 8px;text-align:center;">
15
+ <img src="https://nextblock.dev/images/nextblock-logo-small.webp" alt="Site logo" width="88" style="display:block;margin:0 auto 20px;" />
16
+ <p style="margin:0 0 12px;font-size:12px;letter-spacing:0.16em;text-transform:uppercase;color:#64748b;">Email confirmation</p>
17
+ <h1 style="margin:0;font-size:30px;line-height:1.2;">Confirm your email</h1>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="padding:8px 32px 0;">
22
+ <p style="margin:0 0 16px;font-size:16px;line-height:1.7;color:#334155;">
23
+ Thanks for creating an account. Please confirm your email address to continue.
24
+ </p>
25
+ <p style="margin:0 0 28px;font-size:16px;line-height:1.7;color:#334155;">
26
+ Once confirmed, we will bring you back into the site.
27
+ </p>
28
+ <p style="margin:0 0 32px;text-align:center;">
29
+ <a href="{{ .ConfirmationURL }}" style="display:inline-block;padding:14px 28px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:999px;font-weight:700;">
30
+ Confirm your email
31
+ </a>
32
+ </p>
33
+ <p style="margin:0 0 10px;font-size:14px;line-height:1.7;color:#64748b;">
34
+ If the button does not work, copy and paste this link into your browser:
35
+ </p>
36
+ <p style="margin:0 0 24px;font-size:13px;line-height:1.7;word-break:break-all;color:#0f172a;">
37
+ {{ .ConfirmationURL }}
38
+ </p>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td style="padding:20px 32px 32px;border-top:1px solid #e2e8f0;">
43
+ <p style="margin:0;font-size:13px;line-height:1.7;color:#64748b;">
44
+ You are receiving this because a new account was created at
45
+ <a href="{{ .SiteURL }}" style="color:#0f172a;">{{ .SiteURL }}</a>.
46
+ </p>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ </body>
54
+ </html>
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Confirm your email change</title>
7
+ </head>
8
+ <body style="margin:0;background:#f5f7fb;font-family:Arial,sans-serif;color:#0f172a;">
9
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="padding:32px 16px;">
10
+ <tr>
11
+ <td align="center">
12
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;background:#ffffff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;">
13
+ <tr>
14
+ <td style="padding:32px 32px 8px;text-align:center;">
15
+ <img src="https://nextblock.dev/images/nextblock-logo-small.webp" alt="Site logo" width="88" style="display:block;margin:0 auto 20px;" />
16
+ <p style="margin:0 0 12px;font-size:12px;letter-spacing:0.16em;text-transform:uppercase;color:#64748b;">Email change</p>
17
+ <h1 style="margin:0;font-size:30px;line-height:1.2;">Confirm your new email</h1>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="padding:8px 32px 0;">
22
+ <p style="margin:0 0 16px;font-size:16px;line-height:1.7;color:#334155;">
23
+ We received a request to update your account email to {{ .NewEmail }}.
24
+ </p>
25
+ <p style="margin:0 0 28px;font-size:16px;line-height:1.7;color:#334155;">
26
+ Confirm the new address below to complete the change.
27
+ </p>
28
+ <p style="margin:0 0 32px;text-align:center;">
29
+ <a href="{{ .ConfirmationURL }}" style="display:inline-block;padding:14px 28px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:999px;font-weight:700;">
30
+ Confirm new email
31
+ </a>
32
+ </p>
33
+ <p style="margin:0 0 10px;font-size:14px;line-height:1.7;color:#64748b;">
34
+ If the button does not work, copy and paste this link into your browser:
35
+ </p>
36
+ <p style="margin:0 0 24px;font-size:13px;line-height:1.7;word-break:break-all;color:#0f172a;">
37
+ {{ .ConfirmationURL }}
38
+ </p>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td style="padding:20px 32px 32px;border-top:1px solid #e2e8f0;">
43
+ <p style="margin:0;font-size:13px;line-height:1.7;color:#64748b;">
44
+ If you did not request this change, ignore this email and review your account security.
45
+ </p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </body>
53
+ </html>
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>You're invited</title>
7
+ </head>
8
+ <body style="margin:0;background:#f5f7fb;font-family:Arial,sans-serif;color:#0f172a;">
9
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="padding:32px 16px;">
10
+ <tr>
11
+ <td align="center">
12
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;background:#ffffff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;">
13
+ <tr>
14
+ <td style="padding:32px 32px 8px;text-align:center;">
15
+ <img src="https://nextblock.dev/images/nextblock-logo-small.webp" alt="Site logo" width="88" style="display:block;margin:0 auto 20px;" />
16
+ <p style="margin:0 0 12px;font-size:12px;letter-spacing:0.16em;text-transform:uppercase;color:#64748b;">Invitation</p>
17
+ <h1 style="margin:0;font-size:30px;line-height:1.2;">You have been invited</h1>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="padding:8px 32px 0;">
22
+ <p style="margin:0 0 16px;font-size:16px;line-height:1.7;color:#334155;">
23
+ Someone invited {{ .Email }} to join <a href="{{ .SiteURL }}" style="color:#0f172a;">{{ .SiteURL }}</a>.
24
+ </p>
25
+ <p style="margin:0 0 28px;font-size:16px;line-height:1.7;color:#334155;">
26
+ Accept the invitation to create your account and get started.
27
+ </p>
28
+ <p style="margin:0 0 32px;text-align:center;">
29
+ <a href="{{ .ConfirmationURL }}" style="display:inline-block;padding:14px 28px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:999px;font-weight:700;">
30
+ Accept invitation
31
+ </a>
32
+ </p>
33
+ <p style="margin:0 0 10px;font-size:14px;line-height:1.7;color:#64748b;">
34
+ If the button does not work, copy and paste this link into your browser:
35
+ </p>
36
+ <p style="margin:0 0 24px;font-size:13px;line-height:1.7;word-break:break-all;color:#0f172a;">
37
+ {{ .ConfirmationURL }}
38
+ </p>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td style="padding:20px 32px 32px;border-top:1px solid #e2e8f0;">
43
+ <p style="margin:0;font-size:13px;line-height:1.7;color:#64748b;">
44
+ If you were not expecting this invitation, you can safely ignore this email.
45
+ </p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </body>
53
+ </html>
@@ -0,0 +1,53 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Your sign-in link</title>
7
+ </head>
8
+ <body style="margin:0;background:#f5f7fb;font-family:Arial,sans-serif;color:#0f172a;">
9
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="padding:32px 16px;">
10
+ <tr>
11
+ <td align="center">
12
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;background:#ffffff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;">
13
+ <tr>
14
+ <td style="padding:32px 32px 8px;text-align:center;">
15
+ <img src="https://nextblock.dev/images/nextblock-logo-small.webp" alt="Site logo" width="88" style="display:block;margin:0 auto 20px;" />
16
+ <p style="margin:0 0 12px;font-size:12px;letter-spacing:0.16em;text-transform:uppercase;color:#64748b;">Passwordless sign-in</p>
17
+ <h1 style="margin:0;font-size:30px;line-height:1.2;">Your sign-in link is ready</h1>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="padding:8px 32px 0;">
22
+ <p style="margin:0 0 16px;font-size:16px;line-height:1.7;color:#334155;">
23
+ Use the button below to sign in to your account.
24
+ </p>
25
+ <p style="margin:0 0 28px;font-size:16px;line-height:1.7;color:#334155;">
26
+ This link is one-time use and is meant only for you.
27
+ </p>
28
+ <p style="margin:0 0 32px;text-align:center;">
29
+ <a href="{{ .ConfirmationURL }}" style="display:inline-block;padding:14px 28px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:999px;font-weight:700;">
30
+ Sign in now
31
+ </a>
32
+ </p>
33
+ <p style="margin:0 0 10px;font-size:14px;line-height:1.7;color:#64748b;">
34
+ If the button does not work, copy and paste this link into your browser:
35
+ </p>
36
+ <p style="margin:0 0 24px;font-size:13px;line-height:1.7;word-break:break-all;color:#0f172a;">
37
+ {{ .ConfirmationURL }}
38
+ </p>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td style="padding:20px 32px 32px;border-top:1px solid #e2e8f0;">
43
+ <p style="margin:0;font-size:13px;line-height:1.7;color:#64748b;">
44
+ If you did not request this sign-in link, you can ignore this email.
45
+ </p>
46
+ </td>
47
+ </tr>
48
+ </table>
49
+ </td>
50
+ </tr>
51
+ </table>
52
+ </body>
53
+ </html>
@@ -0,0 +1,45 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Confirm it's you</title>
7
+ </head>
8
+ <body style="margin:0;background:#f5f7fb;font-family:Arial,sans-serif;color:#0f172a;">
9
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="padding:32px 16px;">
10
+ <tr>
11
+ <td align="center">
12
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;background:#ffffff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;">
13
+ <tr>
14
+ <td style="padding:32px 32px 8px;text-align:center;">
15
+ <img src="https://nextblock.dev/images/nextblock-logo-small.webp" alt="Site logo" width="88" style="display:block;margin:0 auto 20px;" />
16
+ <p style="margin:0 0 12px;font-size:12px;letter-spacing:0.16em;text-transform:uppercase;color:#64748b;">Security check</p>
17
+ <h1 style="margin:0;font-size:30px;line-height:1.2;">Confirm it's really you</h1>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="padding:8px 32px 0;">
22
+ <p style="margin:0 0 16px;font-size:16px;line-height:1.7;color:#334155;">
23
+ Use the one-time verification code below to continue with your account request.
24
+ </p>
25
+ <p style="margin:0 0 28px;font-size:36px;line-height:1.2;font-weight:700;letter-spacing:0.24em;text-align:center;color:#0f172a;">
26
+ {{ .Token }}
27
+ </p>
28
+ <p style="margin:0 0 24px;font-size:14px;line-height:1.7;color:#64748b;">
29
+ Enter this code back on the site. Never share it with anyone.
30
+ </p>
31
+ </td>
32
+ </tr>
33
+ <tr>
34
+ <td style="padding:20px 32px 32px;border-top:1px solid #e2e8f0;">
35
+ <p style="margin:0;font-size:13px;line-height:1.7;color:#64748b;">
36
+ If you did not request this code, ignore this email and review your account security.
37
+ </p>
38
+ </td>
39
+ </tr>
40
+ </table>
41
+ </td>
42
+ </tr>
43
+ </table>
44
+ </body>
45
+ </html>
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <title>Reset your password</title>
7
+ </head>
8
+ <body style="margin:0;background:#f5f7fb;font-family:Arial,sans-serif;color:#0f172a;">
9
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="padding:32px 16px;">
10
+ <tr>
11
+ <td align="center">
12
+ <table role="presentation" cellpadding="0" cellspacing="0" width="100%" style="max-width:600px;background:#ffffff;border:1px solid #e2e8f0;border-radius:20px;overflow:hidden;">
13
+ <tr>
14
+ <td style="padding:32px 32px 8px;text-align:center;">
15
+ <img src="https://nextblock.dev/images/nextblock-logo-small.webp" alt="Site logo" width="88" style="display:block;margin:0 auto 20px;" />
16
+ <p style="margin:0 0 12px;font-size:12px;letter-spacing:0.16em;text-transform:uppercase;color:#64748b;">Password recovery</p>
17
+ <h1 style="margin:0;font-size:30px;line-height:1.2;">Reset your password</h1>
18
+ </td>
19
+ </tr>
20
+ <tr>
21
+ <td style="padding:8px 32px 0;">
22
+ <p style="margin:0 0 16px;font-size:16px;line-height:1.7;color:#334155;">
23
+ We received a request to reset the password for {{ .Email }}.
24
+ </p>
25
+ <p style="margin:0 0 28px;font-size:16px;line-height:1.7;color:#334155;">
26
+ Use the secure link below to choose a new password. If you did not request this, you can safely ignore this email.
27
+ </p>
28
+ <p style="margin:0 0 32px;text-align:center;">
29
+ <a href="{{ .ConfirmationURL }}" style="display:inline-block;padding:14px 28px;background:#0f172a;color:#ffffff;text-decoration:none;border-radius:999px;font-weight:700;">
30
+ Choose a new password
31
+ </a>
32
+ </p>
33
+ <p style="margin:0 0 10px;font-size:14px;line-height:1.7;color:#64748b;">
34
+ If the button does not work, copy and paste this link into your browser:
35
+ </p>
36
+ <p style="margin:0 0 24px;font-size:13px;line-height:1.7;word-break:break-all;color:#0f172a;">
37
+ {{ .ConfirmationURL }}
38
+ </p>
39
+ </td>
40
+ </tr>
41
+ <tr>
42
+ <td style="padding:20px 32px 32px;border-top:1px solid #e2e8f0;">
43
+ <p style="margin:0;font-size:13px;line-height:1.7;color:#64748b;">
44
+ Security note: this link is intended only for the account owner at
45
+ <a href="{{ .SiteURL }}" style="color:#0f172a;">{{ .SiteURL }}</a>.
46
+ </p>
47
+ </td>
48
+ </tr>
49
+ </table>
50
+ </td>
51
+ </tr>
52
+ </table>
53
+ </body>
54
+ </html>
package/index.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export * from './lib/supabase/client';
2
- export * from './lib/supabase/middleware';
3
- export * from './lib/supabase/ssg-client';
4
- export * from './lib/supabase/types';
@@ -1,9 +0,0 @@
1
- import { SupabaseClient } from '@supabase/supabase-js';
2
- import { Database } from './types';
3
- type Profile = Database['public']['Tables']['profiles']['Row'];
4
- type Language = Database['public']['Tables']['languages']['Row'];
5
- export declare const createClient: () => SupabaseClient<any, "public", "public", any, any>;
6
- export declare function getProfileWithRoleClientSide(supabase: SupabaseClient, // Accept the client instance
7
- userId: string): Promise<Profile | null>;
8
- export declare function getActiveLanguagesClientSide(): Promise<Language[]>;
9
- export {};
@@ -1,2 +0,0 @@
1
- import { NextRequest, NextResponse } from 'next/server';
2
- export declare const updateSession: (request: NextRequest) => Promise<NextResponse<unknown>>;
@@ -1,7 +0,0 @@
1
- import { Database } from './types';
2
- type Profile = Database['public']['Tables']['profiles']['Row'];
3
- type Language = Database['public']['Tables']['languages']['Row'];
4
- export declare const createClient: () => import('@supabase/supabase-js').SupabaseClient<any, "public", "public", any, any>;
5
- export declare function getProfileWithRoleServerSide(userId: string): Promise<Profile | null>;
6
- export declare function getActiveLanguagesServerSide(): Promise<Language[]>;
7
- export {};
@@ -1,2 +0,0 @@
1
- import { SupabaseClient } from '@supabase/supabase-js';
2
- export declare const getSsgSupabaseClient: () => SupabaseClient;