@hszrdm/create-commerce 1.3.0 → 1.5.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/README.md +92 -1
- package/package.json +1 -1
- package/templates/backend/.env.example +271 -91
- package/templates/backend/README.md +4 -0
- package/templates/backend/package.json +6 -2
- package/templates/backend/scripts/core-backup.mjs +281 -0
- package/templates/backend/scripts/core-restore.mjs +179 -0
- package/templates/backend/scripts/lib/core-backup-common.mjs +237 -0
- package/templates/backend/scripts/materialize-production.mjs +37 -0
- package/templates/backend/scripts/production-assets/backup.sh +56 -0
- package/templates/backend/scripts/production-assets/deploy.sh +68 -0
- package/templates/backend/scripts/production-assets/ecosystem.config.cjs.tpl +24 -0
- package/templates/backend/scripts/production-assets/install.sh +201 -0
- package/templates/backend/scripts/production-assets/restore.sh +71 -0
- package/templates/backend/scripts/verify-env-contract.mjs +58 -0
- package/templates/backend/src/scripts/core-init.ts +3 -1
- package/templates/storefront/src/app/cart-recovery/page.tsx +35 -0
- package/templates/storefront/src/app/ertekeles/page.tsx +25 -0
- package/templates/storefront/src/app/fiok-aktivalas/page.tsx +35 -0
- package/templates/storefront/src/components/abandoned-cart-recovery.tsx +139 -0
- package/templates/storefront/src/components/account-activation-form.tsx +333 -0
- package/templates/storefront/src/components/add-to-cart.tsx +56 -0
- package/templates/storefront/src/components/analytics.tsx +15 -2
- package/templates/storefront/src/components/review-request-form.tsx +419 -0
- package/templates/storefront/src/lib/core/abandoned-cart.ts +47 -0
- package/templates/storefront/src/lib/core/account-activation.ts +75 -0
- package/templates/storefront/src/lib/core/back-in-stock.ts +25 -0
- package/templates/storefront/src/lib/core/reviews.ts +37 -5
- package/templates/storefront/src/lib/storefront-routes.ts +3 -0
- package/templates/storefront/src/proxy.ts +4 -0
package/README.md
CHANGED
|
@@ -16,7 +16,98 @@ The generator creates:
|
|
|
16
16
|
- a publishable storefront API key linked to the Sales Channel;
|
|
17
17
|
- the first HSZRDM Commerce admin user;
|
|
18
18
|
- backend/storefront typecheck, test and build verification;
|
|
19
|
-
- Git initialization with generated build artifacts ignored
|
|
19
|
+
- Git initialization with generated build artifacts ignored;
|
|
20
|
+
- production deployment, backup and restore assets.
|
|
21
|
+
|
|
22
|
+
Generated project structure includes:
|
|
23
|
+
|
|
24
|
+
```text
|
|
25
|
+
my-shop/
|
|
26
|
+
├── backend/
|
|
27
|
+
├── storefront/
|
|
28
|
+
├── deploy/
|
|
29
|
+
│ ├── install.sh
|
|
30
|
+
│ ├── deploy.sh
|
|
31
|
+
│ ├── backup.sh
|
|
32
|
+
│ └── restore.sh
|
|
33
|
+
├── ecosystem.config.cjs
|
|
34
|
+
├── docker-compose.yml
|
|
35
|
+
├── hszrdm-commerce.json
|
|
36
|
+
├── package.json
|
|
37
|
+
└── README.md
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
The `deploy/` directory and `ecosystem.config.cjs` are materialized automatically during the first `npm install`. If the generator is run with `--skip-install`, running `npm install` later creates them.
|
|
41
|
+
|
|
42
|
+
## Production commands
|
|
43
|
+
|
|
44
|
+
### Fresh server install
|
|
45
|
+
|
|
46
|
+
On a new VPS/server, `deploy/install.sh` can bootstrap the production environment automatically.
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
bash deploy/install.sh
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
If `backend/.env` does not exist, the installer:
|
|
53
|
+
|
|
54
|
+
1. copies the canonical `backend/.env.example` to `backend/.env`;
|
|
55
|
+
2. reads project identity from `hszrdm-commerce.json`;
|
|
56
|
+
3. asks for PostgreSQL, Redis, public backend URL and public storefront URL;
|
|
57
|
+
4. generates fresh JWT, cookie, integration-encryption and shipping-webhook secrets;
|
|
58
|
+
5. fills store identity, CORS, SEO and default project e-mail values;
|
|
59
|
+
6. creates `storefront/.env.local` from the storefront env example;
|
|
60
|
+
7. runs `env:verify`, migrations and Core bootstrap;
|
|
61
|
+
8. creates a Store API publishable key when the storefront does not already have one;
|
|
62
|
+
9. builds and starts/reloads the apps through PM2;
|
|
63
|
+
10. runs backend/storefront healthchecks.
|
|
64
|
+
|
|
65
|
+
If `backend/.env` or `storefront/.env.local` already exists, the installer preserves them instead of regenerating secrets.
|
|
66
|
+
|
|
67
|
+
For non-interactive/server automation, supply the server-specific values through:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
HSZRDM_INSTALL_DATABASE_URL='postgres://...' \
|
|
71
|
+
HSZRDM_INSTALL_REDIS_URL='redis://...' \
|
|
72
|
+
HSZRDM_INSTALL_BACKEND_URL='https://api.example.com' \
|
|
73
|
+
HSZRDM_INSTALL_STOREFRONT_URL='https://example.com' \
|
|
74
|
+
HSZRDM_INSTALL_UPLOAD_DIR='/var/lib/hszrdm-commerce/my-shop/uploads' \
|
|
75
|
+
bash deploy/install.sh
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
`HSZRDM_INSTALL_UPLOAD_DIR` is optional. Its default is `/var/lib/hszrdm-commerce/<project-slug>/uploads`.
|
|
79
|
+
|
|
80
|
+
### Normal deployment
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
bash deploy/deploy.sh
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
The deploy script creates a backup first, pulls with `git pull --ff-only`, installs exact dependencies, verifies the env contract, runs migrations/Core init, builds, reloads PM2 and performs healthchecks.
|
|
87
|
+
|
|
88
|
+
### Manual backup
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
bash deploy/backup.sh
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Restore an existing webshop
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
bash deploy/restore.sh /path/to/hszrdm-commerce-YYYYMMDDTHHMMSSZ.tar.gz --yes
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
For an existing webshop moved to another VPS, use **restore**, not a fresh env bootstrap. Restore brings back the original backend/storefront env files, database, encrypted Core runtime state and uploads. This preserves encryption keys and existing integration credentials.
|
|
101
|
+
|
|
102
|
+
Backups contain the PostgreSQL dump, backend/storefront environment files, encrypted Core runtime state and uploaded files when present. Backup archives therefore contain secrets and customer data and must be stored securely.
|
|
103
|
+
|
|
104
|
+
The default local backup retention is 5 archives. It can be changed with:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
HSZRDM_BACKUP_RETENTION=10 bash deploy/backup.sh
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
A different backup directory can be supplied with `HSZRDM_BACKUP_DIR`.
|
|
20
111
|
|
|
21
112
|
## PostgreSQL and Redis
|
|
22
113
|
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# -----------------------------------------------------------------------------
|
|
2
|
-
# HSZRDM COMMERCE - environment
|
|
2
|
+
# HSZRDM COMMERCE - canonical environment template
|
|
3
3
|
# -----------------------------------------------------------------------------
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
7
|
-
#
|
|
8
|
-
#
|
|
9
|
-
#
|
|
10
|
-
#
|
|
4
|
+
# This is the single source of truth for environment variables used by the Core,
|
|
5
|
+
# the reference backend and generated shops.
|
|
6
|
+
#
|
|
7
|
+
# Required for every shop: DATABASE_URL, JWT_SECRET, COOKIE_SECRET,
|
|
8
|
+
# STORE_CORS, ADMIN_CORS, AUTH_CORS.
|
|
9
|
+
#
|
|
10
|
+
# External integrations are preferably configured in HSZRDM Commerce Admin
|
|
11
|
+
# (Settings -> Integrációk). Environment variables below are fallback/bootstrap
|
|
12
|
+
# options only. Do not copy unused integration secrets into production.
|
|
11
13
|
|
|
12
14
|
# -----------------------------------------------------------------------------
|
|
13
15
|
# Runtime / infrastructure
|
|
@@ -17,49 +19,37 @@ REDIS_URL=redis://localhost:6379
|
|
|
17
19
|
MEDUSA_BACKEND_URL=http://localhost:9000
|
|
18
20
|
STOREFRONT_URL=http://localhost:3000
|
|
19
21
|
MEDUSA_ADMIN_PATH=/app
|
|
20
|
-
|
|
21
|
-
# Local development can leave this empty. Production requires an absolute,
|
|
22
|
-
# durable path, for example /var/lib/hszrdm-commerce/uploads.
|
|
23
22
|
FILE_UPLOAD_DIR=
|
|
24
23
|
RELEASE_SHA=development
|
|
24
|
+
# APP_ENV=development
|
|
25
|
+
# NODE_ENV=development
|
|
26
|
+
# ALLOW_PRODUCTION_SANDBOX=false
|
|
25
27
|
|
|
26
28
|
# -----------------------------------------------------------------------------
|
|
27
|
-
#
|
|
29
|
+
# Required security
|
|
28
30
|
# -----------------------------------------------------------------------------
|
|
29
31
|
JWT_SECRET=replace-with-at-least-32-random-characters
|
|
30
32
|
COOKIE_SECRET=replace-with-at-least-32-random-characters
|
|
31
|
-
|
|
32
33
|
STORE_CORS=http://localhost:3000
|
|
33
34
|
ADMIN_CORS=http://localhost:9000,http://localhost:7001
|
|
34
35
|
AUTH_CORS=http://localhost:3000,http://localhost:9000,http://localhost:7001
|
|
35
36
|
|
|
36
|
-
#
|
|
37
|
-
# runtime snapshot. Use a separate, stable key in production.
|
|
37
|
+
# Encrypts secrets stored by Settings -> Integrációk.
|
|
38
38
|
INTEGRATION_SETTINGS_ENCRYPTION_KEY=replace-with-at-least-32-random-characters
|
|
39
|
-
# Optional explicit snapshot path. Empty = .core/ locally, or the durable upload
|
|
40
|
-
# directory parent when FILE_UPLOAD_DIR is configured.
|
|
41
39
|
INTEGRATION_SETTINGS_FILE=
|
|
42
|
-
|
|
43
|
-
# Shared secret for supported inbound shipping callbacks (currently FOXPOST/GLS).
|
|
44
|
-
# Required only when an integration using these callbacks is enabled.
|
|
40
|
+
# Shared inbound shipping callback secret. Required only for enabled callback-based providers.
|
|
45
41
|
SHIPPING_WEBHOOK_SECRET=
|
|
46
42
|
|
|
47
43
|
# -----------------------------------------------------------------------------
|
|
48
|
-
# Store identity
|
|
44
|
+
# Store identity / localization
|
|
49
45
|
# -----------------------------------------------------------------------------
|
|
50
46
|
STORE_NAME=Example Store
|
|
51
47
|
STORE_SLUG=example-store
|
|
52
|
-
# Medusa content locale. Native Translation Module is enabled by HSZRDM Core.
|
|
53
48
|
STORE_LOCALE=hu-HU
|
|
54
|
-
# Comma-separated Store locales provisioned by `core:init`.
|
|
55
49
|
STORE_SUPPORTED_LOCALES=hu-HU,en-US
|
|
56
50
|
STORE_DEFAULT_CURRENCY=HUF
|
|
57
|
-
# Commercial country/region context. This is intentionally separate from locale.
|
|
58
51
|
STORE_DEFAULT_COUNTRY=HU
|
|
59
|
-
# Direct/reference admin customization fallback.
|
|
60
52
|
VITE_ADMIN_BRAND_NAME=HSZRDM Commerce
|
|
61
|
-
# @hszrdm/core is a Medusa plugin, so plugin admin environment variables are
|
|
62
|
-
# provided by the host application with the PLUGIN_ prefix.
|
|
63
53
|
PLUGIN_ADMIN_BRAND_NAME=HSZRDM Commerce
|
|
64
54
|
|
|
65
55
|
ORDER_EMAIL=orders@example.com
|
|
@@ -68,25 +58,39 @@ BILLING_EMAIL=billing@example.com
|
|
|
68
58
|
SYSTEM_EMAIL=system@example.com
|
|
69
59
|
|
|
70
60
|
# -----------------------------------------------------------------------------
|
|
71
|
-
#
|
|
61
|
+
# HSZRDM Store MCP - optional read-only AI access
|
|
72
62
|
# -----------------------------------------------------------------------------
|
|
73
|
-
#
|
|
74
|
-
|
|
63
|
+
# Empty token = MCP disabled.
|
|
64
|
+
HSZRDM_MCP_TOKEN=
|
|
65
|
+
HSZRDM_MCP_ALLOWED_ORIGINS=
|
|
66
|
+
HSZRDM_MCP_ALLOWED_HOSTS=
|
|
67
|
+
HSZRDM_MCP_RATE_LIMIT_PER_MINUTE=120
|
|
75
68
|
|
|
76
|
-
#
|
|
77
|
-
#
|
|
78
|
-
#
|
|
69
|
+
# -----------------------------------------------------------------------------
|
|
70
|
+
# AI-assisted translations
|
|
71
|
+
# -----------------------------------------------------------------------------
|
|
72
|
+
# Suggestions are generated by AI; approved values remain in Medusa Translation.
|
|
73
|
+
AI_TRANSLATION_ENABLED=false
|
|
74
|
+
AI_TRANSLATION_PROVIDER=openai
|
|
75
|
+
AI_TRANSLATION_MODEL=gpt-6-astra
|
|
76
|
+
OPENAI_API_KEY=
|
|
77
|
+
OPENAI_BASE_URL=https://api.openai.com/v1
|
|
78
|
+
|
|
79
|
+
# -----------------------------------------------------------------------------
|
|
80
|
+
# Email Center / transactional email
|
|
81
|
+
# -----------------------------------------------------------------------------
|
|
82
|
+
EMAIL_CENTER_ENABLED=true
|
|
83
|
+
# Supported provider values: sendgrid, resend. Empty = local Medusa provider.
|
|
79
84
|
EMAIL_PROVIDER=
|
|
80
85
|
EMAIL_API_KEY=
|
|
81
86
|
EMAIL_FROM=
|
|
82
87
|
EMAIL_REPLY_TO=
|
|
83
|
-
#
|
|
88
|
+
# Optional provider-specific fallbacks.
|
|
84
89
|
RESEND_API_KEY=
|
|
85
90
|
RESEND_FROM_EMAIL=
|
|
91
|
+
SENDGRID_API_KEY=
|
|
92
|
+
SENDGRID_FROM_EMAIL=
|
|
86
93
|
|
|
87
|
-
# Optional per-event overrides. Empty means Email Center defaults apply; with
|
|
88
|
-
# EMAIL_CENTER_ENABLED=true the customer/order transactional contracts are on.
|
|
89
|
-
# Set a specific switch to false to disable only that event.
|
|
90
94
|
EMAIL_CUSTOMER_WELCOME_ENABLED=
|
|
91
95
|
EMAIL_REGISTRATION_VERIFICATION_ENABLED=
|
|
92
96
|
EMAIL_PASSWORD_RESET_ENABLED=
|
|
@@ -101,51 +105,53 @@ EMAIL_SHIPMENT_CREATED_ENABLED=
|
|
|
101
105
|
EMAIL_ORDER_CANCELED_ENABLED=
|
|
102
106
|
EMAIL_PAYMENT_REFUNDED_ENABLED=
|
|
103
107
|
|
|
104
|
-
# Optional public logo URL shown in the shared email layout.
|
|
105
108
|
EMAIL_LOGO_URL=
|
|
106
|
-
# Open/click tracking is signed. Empty EMAIL_TRACKING_SECRET falls back to the
|
|
107
|
-
# generated COOKIE_SECRET, then JWT_SECRET. Production has no weak built-in key.
|
|
108
109
|
EMAIL_TRACKING_ENABLED=true
|
|
109
110
|
EMAIL_TRACKING_BASE_URL=
|
|
110
111
|
EMAIL_TRACKING_SECRET=
|
|
111
|
-
# Optional secret for POST /hooks/email/status. A provider-specific adapter can
|
|
112
|
-
# normalize delivered/bounced/failed callbacks to this internal endpoint.
|
|
113
112
|
EMAIL_WEBHOOK_SECRET=
|
|
114
113
|
|
|
115
114
|
# -----------------------------------------------------------------------------
|
|
116
|
-
#
|
|
115
|
+
# Newsletter
|
|
116
|
+
# -----------------------------------------------------------------------------
|
|
117
|
+
NEWSLETTER_ENABLED=true
|
|
118
|
+
NEWSLETTER_DOUBLE_OPT_IN=false
|
|
119
|
+
NEWSLETTER_EMAIL_ENABLED=true
|
|
120
|
+
NEWSLETTER_CONSENT_VERSION=1
|
|
121
|
+
NEWSLETTER_CONSENT_URL=
|
|
122
|
+
NEWSLETTER_CONFIRM_TTL_HOURS=72
|
|
123
|
+
NEWSLETTER_CONFIRM_PATH=/newsletter/confirm
|
|
124
|
+
NEWSLETTER_UNSUBSCRIBE_PATH=/newsletter/unsubscribe
|
|
125
|
+
NEWSLETTER_TOKEN_SECRET=
|
|
126
|
+
|
|
127
|
+
# -----------------------------------------------------------------------------
|
|
128
|
+
# Product reviews
|
|
129
|
+
# -----------------------------------------------------------------------------
|
|
130
|
+
PRODUCT_REVIEWS_ENABLED=true
|
|
131
|
+
# false = any signed-in customer can review; true = verified purchase required.
|
|
132
|
+
PRODUCT_REVIEWS_REQUIRE_VERIFIED_PURCHASE=false
|
|
133
|
+
|
|
134
|
+
# -----------------------------------------------------------------------------
|
|
135
|
+
# Customer after-sales
|
|
117
136
|
# -----------------------------------------------------------------------------
|
|
118
|
-
# These switches expose customer endpoints backed by Medusa's native
|
|
119
|
-
# return/exchange/claim workflows. They do not auto-approve or auto-refund.
|
|
120
137
|
AFTER_SALES_ENABLED=true
|
|
121
138
|
AFTER_SALES_RETURNS_ENABLED=true
|
|
122
139
|
AFTER_SALES_EXCHANGES_ENABLED=true
|
|
123
140
|
AFTER_SALES_CLAIMS_ENABLED=true
|
|
124
|
-
|
|
125
|
-
# Optional merchant policy page and text inserted into approved return e-mails.
|
|
126
|
-
# The Core intentionally does not hard-code legal return windows or eligibility.
|
|
127
141
|
AFTER_SALES_POLICY_URL=
|
|
128
142
|
AFTER_SALES_RETURN_INSTRUCTIONS=
|
|
129
143
|
|
|
130
144
|
# -----------------------------------------------------------------------------
|
|
131
|
-
#
|
|
145
|
+
# Quote requests / RFQ
|
|
132
146
|
# -----------------------------------------------------------------------------
|
|
133
|
-
# Generic B2B / custom-product quote layer. The storefront may build any design
|
|
134
|
-
# on top of /store/quote-requests and /store/quote-requests/config.
|
|
135
147
|
QUOTE_REQUESTS_ENABLED=true
|
|
136
148
|
QUOTE_EMAIL_ENABLED=true
|
|
137
|
-
# One or more merchant recipients, separated with comma or semicolon.
|
|
138
149
|
QUOTE_ADMIN_EMAILS=
|
|
139
|
-
# Optional JSON array of additional fields exposed by the Core quote config.
|
|
140
|
-
# Supported types: text, textarea, number, boolean, select.
|
|
141
|
-
# Example:
|
|
142
|
-
# QUOTE_EXTRA_FIELDS_JSON=[{"key":"delivery_deadline","label":"Kért szállítási határidő","type":"text","required":false},{"key":"industry","label":"Iparág","type":"select","required":false,"options":["Élelmiszer","Ipar","Kereskedelem"]}]
|
|
143
150
|
QUOTE_EXTRA_FIELDS_JSON=
|
|
144
151
|
|
|
145
152
|
# -----------------------------------------------------------------------------
|
|
146
|
-
#
|
|
153
|
+
# Leads / forms
|
|
147
154
|
# -----------------------------------------------------------------------------
|
|
148
|
-
# Generic backend for contact, callback, B2B lead and project-specific forms.
|
|
149
155
|
LEADS_ENABLED=true
|
|
150
156
|
LEAD_EMAIL_ENABLED=true
|
|
151
157
|
LEAD_CUSTOMER_EMAIL_ENABLED=false
|
|
@@ -153,38 +159,24 @@ LEAD_ADMIN_EMAILS=
|
|
|
153
159
|
LEAD_HONEYPOT_FIELD=website
|
|
154
160
|
LEAD_RATE_LIMIT_MAX=8
|
|
155
161
|
LEAD_RATE_LIMIT_WINDOW_SECONDS=600
|
|
156
|
-
# Optional dedicated HMAC secret for anonymized request fingerprints. If empty,
|
|
157
|
-
# COOKIE_SECRET is used. Raw IP addresses are never persisted by the lead module.
|
|
158
162
|
LEAD_SPAM_HASH_SECRET=
|
|
159
|
-
# Optional Cloudflare Turnstile. Both values are required to enable it.
|
|
160
163
|
LEAD_TURNSTILE_SITE_KEY=
|
|
161
164
|
LEAD_TURNSTILE_SECRET_KEY=
|
|
162
165
|
LEAD_PRIVACY_POLICY_VERSION=1
|
|
163
166
|
LEAD_PRIVACY_POLICY_URL=
|
|
164
167
|
LEAD_PRIVACY_POLICY_LABEL=Elfogadom az adatkezelési tájékoztatót.
|
|
165
|
-
# Optional JSON array defining one or more forms and custom fields.
|
|
166
|
-
# Empty = built-in `contact` form with name, email and message required.
|
|
167
168
|
LEAD_FORMS_JSON=
|
|
168
169
|
|
|
169
170
|
# -----------------------------------------------------------------------------
|
|
170
|
-
# CMS / blog
|
|
171
|
+
# CMS / blog
|
|
171
172
|
# -----------------------------------------------------------------------------
|
|
172
|
-
# Generic content engine for blog posts, pages, guides, news and custom types.
|
|
173
173
|
CMS_ENABLED=true
|
|
174
|
-
# Empty = STORE_LOCALE, then hu-HU fallback.
|
|
175
174
|
CMS_DEFAULT_LOCALE=
|
|
176
|
-
# Optional JSON array of content types shown to storefront/admin integrations.
|
|
177
|
-
# Content entries still store a free-form content_type, so projects can add
|
|
178
|
-
# project-specific types without changing the Core schema.
|
|
179
|
-
# Example:
|
|
180
|
-
# CMS_CONTENT_TYPES_JSON=[{"key":"blog_post","label":"Blogbejegyzés"},{"key":"page","label":"Oldal"},{"key":"guide","label":"Tudástár"}]
|
|
181
175
|
CMS_CONTENT_TYPES_JSON=
|
|
182
176
|
|
|
183
177
|
# -----------------------------------------------------------------------------
|
|
184
|
-
# Technical SEO
|
|
178
|
+
# Technical SEO
|
|
185
179
|
# -----------------------------------------------------------------------------
|
|
186
|
-
# Country remains the commercial region country. Locale controls public language
|
|
187
|
-
# and localized URL segments independently.
|
|
188
180
|
SEO_STOREFRONT_URL=
|
|
189
181
|
SEO_STORE_NAME=
|
|
190
182
|
SEO_ORGANIZATION_NAME=
|
|
@@ -193,29 +185,217 @@ SEO_DEFAULT_COUNTRY=
|
|
|
193
185
|
SEO_DEFAULT_CURRENCY=
|
|
194
186
|
SEO_DEFAULT_LOCALE=hu
|
|
195
187
|
SEO_SUPPORTED_LOCALES=hu,en
|
|
196
|
-
|
|
197
|
-
# Optional explicit Medusa region / sales channel for Product Offer JSON-LD.
|
|
198
188
|
SEO_REGION_ID=
|
|
199
189
|
SEO_SALES_CHANNEL_ID=
|
|
200
|
-
|
|
201
|
-
# Defaults generate /hu/termekek/... and /en/products/... from the same template.
|
|
202
190
|
SEO_PRODUCT_PATH_TEMPLATE=/{locale}/{products_segment}/{handle}
|
|
203
191
|
SEO_CATEGORY_PATH_TEMPLATE=/{locale}/{categories_segment}/{handle}
|
|
204
|
-
|
|
205
|
-
# Empty = enabled only in NODE_ENV=production. Set explicitly only when needed.
|
|
206
192
|
SEO_ALLOW_INDEXING=
|
|
207
|
-
# Extra comma-separated Disallow paths. Core defaults already include both HU and
|
|
208
|
-
# EN account/cart/checkout paths plus the legacy aliases.
|
|
209
193
|
SEO_ROBOTS_DISALLOW=
|
|
210
194
|
|
|
211
195
|
# -----------------------------------------------------------------------------
|
|
212
|
-
#
|
|
196
|
+
# Payment fallback/bootstrap settings
|
|
197
|
+
# Prefer Admin -> Settings -> Integrációk.
|
|
213
198
|
# -----------------------------------------------------------------------------
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
199
|
+
STRIPE_ENABLED=false
|
|
200
|
+
STRIPE_API_KEY=
|
|
201
|
+
STRIPE_WEBHOOK_SECRET=
|
|
202
|
+
STRIPE_WEBHOOK_URL=http://localhost:9000/hooks/payment/stripe_stripe
|
|
203
|
+
|
|
204
|
+
SIMPLEPAY_ENABLED=false
|
|
205
|
+
SIMPLEPAY_SANDBOX=true
|
|
206
|
+
SIMPLEPAY_HUF_MERCHANT=
|
|
207
|
+
SIMPLEPAY_HUF_SECRET_KEY=
|
|
208
|
+
SIMPLEPAY_EUR_MERCHANT=
|
|
209
|
+
SIMPLEPAY_EUR_SECRET_KEY=
|
|
210
|
+
SIMPLEPAY_USD_MERCHANT=
|
|
211
|
+
SIMPLEPAY_USD_SECRET_KEY=
|
|
212
|
+
SIMPLEPAY_RETURN_BASE_URL=http://localhost:9000/store/simplepay/back
|
|
213
|
+
SIMPLEPAY_STOREFRONT_URL=http://localhost:3000
|
|
214
|
+
SIMPLEPAY_TIMEOUT_MS=15000
|
|
215
|
+
|
|
216
|
+
BANK_TRANSFER_ENABLED=false
|
|
217
|
+
BANK_TRANSFER_BANK_NAME=
|
|
218
|
+
BANK_TRANSFER_ACCOUNT_HOLDER=
|
|
219
|
+
BANK_TRANSFER_ACCOUNT_NUMBER=
|
|
220
|
+
BANK_TRANSFER_IBAN=
|
|
221
|
+
BANK_TRANSFER_BIC=
|
|
222
|
+
BANK_TRANSFER_DUE_DAYS=3
|
|
223
|
+
BANK_TRANSFER_REFERENCE_PREFIX=
|
|
224
|
+
BANK_TRANSFER_EMAIL_ENABLED=true
|
|
225
|
+
BANK_TRANSFER_BILLINGO_PROFORMA=false
|
|
226
|
+
BANK_TRANSFER_BILLINGO_PROFORMA_SEND=true
|
|
227
|
+
|
|
228
|
+
# -----------------------------------------------------------------------------
|
|
229
|
+
# Billingo fallback/bootstrap settings
|
|
230
|
+
# -----------------------------------------------------------------------------
|
|
231
|
+
BILLINGO_ENABLED=false
|
|
232
|
+
BILLINGO_API_URL=https://api.billingo.hu/v3
|
|
233
|
+
BILLINGO_API_KEY=
|
|
234
|
+
BILLINGO_DOCUMENT_BLOCK_ID=
|
|
235
|
+
BILLINGO_BANK_ACCOUNT_ID=
|
|
236
|
+
BILLINGO_PAYMENT_METHOD=stripe
|
|
237
|
+
BILLINGO_LANGUAGE=hu
|
|
238
|
+
BILLINGO_ELECTRONIC=true
|
|
239
|
+
BILLINGO_DUE_DAYS=0
|
|
240
|
+
BILLINGO_UNIT=db
|
|
241
|
+
BILLINGO_TIMEOUT_MS=15000
|
|
242
|
+
BILLINGO_AUTO_INVOICE=true
|
|
243
|
+
BILLINGO_AUTO_SEND=true
|
|
244
|
+
BILLINGO_AUTO_CANCEL_ON_ORDER_CANCELED=false
|
|
245
|
+
BILLINGO_INVOICE_TRIGGER=payment_captured
|
|
246
|
+
|
|
247
|
+
# -----------------------------------------------------------------------------
|
|
248
|
+
# Shipping fallback/bootstrap settings
|
|
249
|
+
# Prefer Admin -> Settings -> Integrációk.
|
|
250
|
+
# -----------------------------------------------------------------------------
|
|
251
|
+
FOXPOST_ENABLED=false
|
|
252
|
+
FOXPOST_API_URL=
|
|
253
|
+
FOXPOST_API_USERNAME=
|
|
254
|
+
FOXPOST_API_PASSWORD=
|
|
255
|
+
FOXPOST_API_KEY=
|
|
256
|
+
FOXPOST_SANDBOX=true
|
|
257
|
+
FOXPOST_LOCKER_FEED_URL=https://cdn.foxpost.hu/foxplus.json
|
|
258
|
+
FOXPOST_LOCKER_PRICE_HUF=1290
|
|
259
|
+
FOXPOST_HOME_DELIVERY_PRICE_HUF=1990
|
|
260
|
+
FOXPOST_FREE_SHIPPING_THRESHOLD_HUF=
|
|
261
|
+
FOXPOST_TIMEOUT_MS=10000
|
|
262
|
+
|
|
263
|
+
GLS_ENABLED=false
|
|
264
|
+
GLS_API_URL=https://api.test.mygls.hu
|
|
265
|
+
GLS_USERNAME=
|
|
266
|
+
GLS_PASSWORD=
|
|
267
|
+
GLS_CLIENT_NUMBER=
|
|
268
|
+
GLS_SANDBOX=true
|
|
269
|
+
GLS_DELIVERY_POINTS_URL=https://map.gls-hungary.com/data/deliveryPoints/hu.json
|
|
270
|
+
GLS_POINT_PRICE_HUF=1490
|
|
271
|
+
GLS_HOME_DELIVERY_PRICE_HUF=1990
|
|
272
|
+
GLS_FREE_SHIPPING_THRESHOLD_HUF=
|
|
273
|
+
GLS_TIMEOUT_MS=15000
|
|
274
|
+
GLS_PRINTER_TYPE=A4_2x2
|
|
275
|
+
GLS_WEBSHOP_ENGINE=HSZRDM Commerce
|
|
276
|
+
GLS_PICKUP_NAME=Example Store
|
|
277
|
+
GLS_PICKUP_STREET=
|
|
278
|
+
GLS_PICKUP_HOUSE_NUMBER=
|
|
279
|
+
GLS_PICKUP_HOUSE_NUMBER_INFO=
|
|
280
|
+
GLS_PICKUP_CITY=
|
|
281
|
+
GLS_PICKUP_POSTAL_CODE=
|
|
282
|
+
GLS_PICKUP_COUNTRY_CODE=HU
|
|
283
|
+
GLS_PICKUP_CONTACT_NAME=
|
|
284
|
+
GLS_PICKUP_PHONE=
|
|
285
|
+
GLS_PICKUP_EMAIL=
|
|
286
|
+
|
|
287
|
+
PACKETA_ENABLED=false
|
|
288
|
+
PACKETA_API_URL=https://www.zasilkovna.cz/api/rest
|
|
289
|
+
PACKETA_API_KEY=
|
|
290
|
+
PACKETA_API_PASSWORD=
|
|
291
|
+
PACKETA_SENDER_INDICATION=
|
|
292
|
+
PACKETA_HOME_CARRIER_ID=
|
|
293
|
+
PACKETA_POINT_PRICE_HUF=1290
|
|
294
|
+
PACKETA_HOME_DELIVERY_PRICE_HUF=1990
|
|
295
|
+
PACKETA_FREE_SHIPPING_THRESHOLD_HUF=
|
|
296
|
+
PACKETA_TIMEOUT_MS=15000
|
|
297
|
+
PACKETA_DEFAULT_WEIGHT_KG=1
|
|
298
|
+
PACKETA_LABEL_FORMAT=A6 on A6
|
|
299
|
+
PACKETA_LANGUAGE=hu
|
|
300
|
+
PACKETA_WEBHOOK_SIGNING_KEY=
|
|
301
|
+
|
|
302
|
+
DPD_ENABLED=false
|
|
303
|
+
DPD_SANDBOX=true
|
|
304
|
+
DPD_API_URL=
|
|
305
|
+
DPD_TOKEN=
|
|
306
|
+
DPD_BU_CODE=
|
|
307
|
+
DPD_CUSTOMER_ID=
|
|
308
|
+
DPD_SENDER_ADDRESS_ID=
|
|
309
|
+
DPD_HOME_SERVICE_CODE=
|
|
310
|
+
DPD_COD_PAYMENT_TYPE=Cash
|
|
311
|
+
DPD_PUDO_SOURCE=disabled
|
|
312
|
+
DPD_PUDO_SERVICE_CODE=
|
|
313
|
+
DPD_PUDO_LOCATOR_URL=
|
|
314
|
+
DPD_PUDO_DELIS_ID=
|
|
315
|
+
DPD_PUDO_PASSWORD=
|
|
316
|
+
DPD_PUDO_MESSAGE_LANGUAGE=en_US
|
|
317
|
+
DPD_POINT_PRICE_HUF=1490
|
|
318
|
+
DPD_HOME_DELIVERY_PRICE_HUF=1990
|
|
319
|
+
DPD_FREE_SHIPPING_THRESHOLD_HUF=
|
|
320
|
+
DPD_TIMEOUT_MS=15000
|
|
321
|
+
DPD_DEFAULT_WEIGHT_KG=1
|
|
322
|
+
DPD_LABEL_SIZE=A6
|
|
323
|
+
DPD_PRINT_FORMAT=PDF
|
|
324
|
+
DPD_LABEL_DPI=203
|
|
325
|
+
DPD_STATUSDATA_ENABLED=false
|
|
326
|
+
DPD_STATUSDATA_FTP_HOST=
|
|
327
|
+
DPD_STATUSDATA_FTP_PORT=21
|
|
328
|
+
DPD_STATUSDATA_FTP_USERNAME=
|
|
329
|
+
DPD_STATUSDATA_FTP_PASSWORD=
|
|
330
|
+
DPD_STATUSDATA_FTP_DIR=
|
|
331
|
+
DPD_STATUSDATA_FTP_TIMEOUT_MS=15000
|
|
332
|
+
|
|
333
|
+
MPL_ENABLED=false
|
|
334
|
+
MPL_SANDBOX=true
|
|
335
|
+
MPL_API_URL=
|
|
336
|
+
MPL_TRACKING_API_URL=
|
|
337
|
+
MPL_PUSH_TRACKING_API_URL=
|
|
338
|
+
MPL_PUSH_TRACKING_STREAM_URL=https://net.posta.hu/tracking/public/tracking/TrackingData
|
|
339
|
+
MPL_TOKEN_URL=
|
|
340
|
+
MPL_API_KEY=
|
|
341
|
+
MPL_API_SECRET=
|
|
342
|
+
MPL_AGREEMENT=
|
|
343
|
+
MPL_ACCOUNT_NO=
|
|
344
|
+
MPL_SENDER_NAME=Example Store
|
|
345
|
+
MPL_SENDER_EMAIL=orders@example.com
|
|
346
|
+
MPL_SENDER_PHONE=
|
|
347
|
+
MPL_SENDER_POST_CODE=
|
|
348
|
+
MPL_SENDER_CITY=
|
|
349
|
+
MPL_SENDER_ADDRESS=
|
|
350
|
+
MPL_DEVELOPER=HSZRDM Commerce
|
|
351
|
+
MPL_BASIC_SERVICE_CODE=
|
|
352
|
+
MPL_EXTRA_SERVICES=
|
|
353
|
+
MPL_PAYMENT_MODE=
|
|
354
|
+
MPL_TAG=
|
|
355
|
+
MPL_HOME_DELIVERY_MODE=HA
|
|
356
|
+
MPL_POINT_PRICE_HUF=1290
|
|
357
|
+
MPL_HOME_DELIVERY_PRICE_HUF=1990
|
|
358
|
+
MPL_FREE_SHIPPING_THRESHOLD_HUF=
|
|
359
|
+
MPL_TIMEOUT_MS=15000
|
|
360
|
+
MPL_DEFAULT_WEIGHT_KG=1
|
|
361
|
+
MPL_LABEL_TYPE=A6
|
|
362
|
+
MPL_PACKAGE_RETENTION=5
|
|
363
|
+
MPL_TRACKING_ENABLED=false
|
|
364
|
+
MPL_PUSH_TRACKING_ENABLED=false
|
|
365
|
+
MPL_TRACKING_ACCOUNT_CODE=
|
|
366
|
+
MPL_PUSH_READ_WINDOW_MS=8000
|
|
367
|
+
MPL_TRACKING_LANGUAGE=hu
|
|
368
|
+
|
|
369
|
+
# -----------------------------------------------------------------------------
|
|
370
|
+
# Product feeds / trust widgets - optional
|
|
371
|
+
# -----------------------------------------------------------------------------
|
|
372
|
+
GOOGLE_MERCHANT_ENABLED=false
|
|
373
|
+
GOOGLE_MERCHANT_COUNTRY_CODE=HU
|
|
374
|
+
GOOGLE_MERCHANT_CURRENCY_CODE=HUF
|
|
375
|
+
GOOGLE_MERCHANT_LOCALE=hu-HU
|
|
376
|
+
GOOGLE_MERCHANT_STOREFRONT_URL=
|
|
377
|
+
GOOGLE_MERCHANT_PRODUCT_PATH_TEMPLATE=/{locale}/{products_segment}/{handle}?v_id={variant_id}
|
|
378
|
+
GOOGLE_MERCHANT_SALES_CHANNEL_ID=
|
|
379
|
+
GOOGLE_MERCHANT_FEED_TITLE=
|
|
380
|
+
GOOGLE_MERCHANT_FEED_DESCRIPTION=
|
|
381
|
+
GOOGLE_MERCHANT_DEFAULT_BRAND=
|
|
382
|
+
GOOGLE_MERCHANT_DEFAULT_CONDITION=new
|
|
383
|
+
GOOGLE_MERCHANT_INCLUDE_OUT_OF_STOCK=true
|
|
384
|
+
|
|
385
|
+
ARUKERESO_ENABLED=false
|
|
386
|
+
ARUKERESO_STOREFRONT_URL=
|
|
387
|
+
ARUKERESO_PRODUCT_PATH_TEMPLATE=/hu/termekek/{handle}?v_id={variant_id}
|
|
388
|
+
ARUKERESO_SALES_CHANNEL_ID=
|
|
389
|
+
ARUKERESO_DEFAULT_MANUFACTURER=
|
|
390
|
+
ARUKERESO_USE_SKU_AS_PRODUCT_NUMBER=false
|
|
391
|
+
ARUKERESO_INCLUDE_OUT_OF_STOCK=true
|
|
392
|
+
ARUKERESO_DEFAULT_DELIVERY_TIME=
|
|
393
|
+
ARUKERESO_DEFAULT_DELIVERY_COST=
|
|
394
|
+
|
|
395
|
+
FOGYASZTOBARAT_ENABLED=false
|
|
396
|
+
FOGYASZTOBARAT_DATA_ID=
|
|
397
|
+
|
|
398
|
+
# -----------------------------------------------------------------------------
|
|
399
|
+
# Generator only (not used by a running shop)
|
|
400
|
+
# -----------------------------------------------------------------------------
|
|
401
|
+
# HSZRDM_MIN_FREE_GB=8
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Minimal Medusa v2 host application for `@hszrdm/core`.
|
|
4
4
|
|
|
5
|
+
This directory is the canonical backend skeleton used by `@hszrdm/create-commerce`. New shops are generated from this starter and receive the exact current `@hszrdm/core` package version during template preparation.
|
|
6
|
+
|
|
5
7
|
Shared commerce functionality comes from `@hszrdm/core`. Webshop-specific backend code belongs in `src/project/` only. `medusa-config.ts` deliberately stays thin and delegates shared configuration to `createHszrdmCommerceConfig()`.
|
|
6
8
|
|
|
9
|
+
The repository reference host in `apps/backend` intentionally has additional development/test tooling, but the shared host contract must stay identical for `instrumentation.ts`, `medusa-config.ts`, `src/project/**` and `src/scripts/**`. Run `npm run backend:parity` from the repository root to verify this contract.
|
|
10
|
+
|
|
7
11
|
Generated projects should create `.env` from `.env.example`, install dependencies, run `npm run db:migrate`, then `npm run core:init -- --yes`.
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
"version": "0.0.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
+
"postinstall": "node ./scripts/materialize-production.mjs",
|
|
6
7
|
"prepare:project": "node ./scripts/prepare-project.mjs",
|
|
8
|
+
"env:verify": "node ./scripts/verify-env-contract.mjs",
|
|
7
9
|
"dev": "npm run prepare:project && medusa develop",
|
|
8
10
|
"build": "npm run prepare:project && NODE_ENV=production medusa build",
|
|
9
11
|
"verify:build": "APP_ENV=test npm run build",
|
|
10
12
|
"start": "medusa start",
|
|
11
|
-
"typecheck": "npm run prepare:project && tsc --noEmit",
|
|
13
|
+
"typecheck": "npm run env:verify && npm run prepare:project && tsc --noEmit",
|
|
12
14
|
"core:init": "npm run prepare:project && medusa exec ./src/scripts/core-init.ts",
|
|
15
|
+
"core:backup": "node ./scripts/core-backup.mjs --project-dir .",
|
|
16
|
+
"core:restore": "node ./scripts/core-restore.mjs --project-dir .",
|
|
13
17
|
"storefront:key": "npm run prepare:project && medusa exec ./src/scripts/create-storefront-key.ts",
|
|
14
18
|
"bootstrap:assert": "npm run prepare:project && medusa exec ./src/scripts/verify-bootstrap.ts",
|
|
15
19
|
"db:migrate": "npm run prepare:project && medusa db:migrate",
|
|
@@ -17,7 +21,7 @@
|
|
|
17
21
|
"start:prod": "cd .medusa/server && medusa start"
|
|
18
22
|
},
|
|
19
23
|
"dependencies": {
|
|
20
|
-
"@hszrdm/core": "1.
|
|
24
|
+
"@hszrdm/core": "1.5.0",
|
|
21
25
|
"@medusajs/admin-sdk": "2.21.2",
|
|
22
26
|
"@medusajs/cli": "2.21.2",
|
|
23
27
|
"@medusajs/draft-order": "2.21.2",
|