@hszrdm/create-commerce 1.2.0 → 1.4.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 +2 -2
- package/templates/backend/.env.example +288 -76
- package/templates/backend/package.json +5 -3
- 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 +67 -0
- package/templates/backend/scripts/production-assets/ecosystem.config.cjs.tpl +24 -0
- package/templates/backend/scripts/production-assets/install.sh +200 -0
- package/templates/backend/scripts/production-assets/restore.sh +68 -0
- package/templates/backend/scripts/verify-env-contract.mjs +58 -0
- package/templates/storefront/README.md +14 -1
- package/templates/storefront/src/app/[countryCode]/products/[handle]/page.tsx +2 -0
- package/templates/storefront/src/app/blog/[slug]/page.tsx +36 -0
- package/templates/storefront/src/app/blog/page.tsx +25 -0
- package/templates/storefront/src/app/contact/page.tsx +25 -0
- package/templates/storefront/src/app/customer-capabilities.css +60 -0
- package/templates/storefront/src/app/knowledge-base/[slug]/page.tsx +35 -0
- package/templates/storefront/src/app/knowledge-base/page.tsx +25 -0
- package/templates/storefront/src/app/layout.tsx +11 -2
- package/templates/storefront/src/app/pages/[slug]/page.tsx +35 -0
- package/templates/storefront/src/app/quote-request/page.tsx +20 -0
- package/templates/storefront/src/components/cms-content.tsx +75 -0
- package/templates/storefront/src/components/lead-form.tsx +203 -0
- package/templates/storefront/src/components/newsletter-signup.tsx +107 -0
- package/templates/storefront/src/components/product-reviews.tsx +150 -0
- package/templates/storefront/src/components/quote-request-form.tsx +212 -0
- package/templates/storefront/src/lib/core/cms.ts +5 -4
- package/templates/storefront/src/lib/storefront-routes.ts +30 -0
- package/templates/storefront/src/proxy.ts +22 -28
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hszrdm/create-commerce",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "Create a complete HSZRDM Commerce webshop project.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"scripts": {
|
|
17
17
|
"prepare:templates": "node ./scripts/prepare-templates.mjs",
|
|
18
18
|
"prepack": "npm run prepare:templates",
|
|
19
|
-
"test": "node --test"
|
|
19
|
+
"test": "npm run prepare:templates && node --test"
|
|
20
20
|
},
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=22"
|
|
@@ -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,39 +58,100 @@ 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
|
|
62
|
+
# -----------------------------------------------------------------------------
|
|
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
|
|
68
|
+
|
|
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.
|
|
84
|
+
EMAIL_PROVIDER=
|
|
85
|
+
EMAIL_API_KEY=
|
|
86
|
+
EMAIL_FROM=
|
|
87
|
+
EMAIL_REPLY_TO=
|
|
88
|
+
# Optional provider-specific fallbacks.
|
|
89
|
+
RESEND_API_KEY=
|
|
90
|
+
RESEND_FROM_EMAIL=
|
|
91
|
+
SENDGRID_API_KEY=
|
|
92
|
+
SENDGRID_FROM_EMAIL=
|
|
93
|
+
|
|
94
|
+
EMAIL_CUSTOMER_WELCOME_ENABLED=
|
|
95
|
+
EMAIL_REGISTRATION_VERIFICATION_ENABLED=
|
|
96
|
+
EMAIL_PASSWORD_RESET_ENABLED=
|
|
97
|
+
EMAIL_CHANGE_VERIFICATION_ENABLED=
|
|
98
|
+
EMAIL_PASSWORD_CHANGED_ENABLED=
|
|
99
|
+
EMAIL_CHANGED_ENABLED=
|
|
100
|
+
EMAIL_ACCOUNT_DELETED_ENABLED=
|
|
101
|
+
EMAIL_ORDER_PLACED_ENABLED=
|
|
102
|
+
EMAIL_PAYMENT_CAPTURED_ENABLED=
|
|
103
|
+
EMAIL_FULFILLMENT_CREATED_ENABLED=
|
|
104
|
+
EMAIL_SHIPMENT_CREATED_ENABLED=
|
|
105
|
+
EMAIL_ORDER_CANCELED_ENABLED=
|
|
106
|
+
EMAIL_PAYMENT_REFUNDED_ENABLED=
|
|
107
|
+
|
|
108
|
+
EMAIL_LOGO_URL=
|
|
109
|
+
EMAIL_TRACKING_ENABLED=true
|
|
110
|
+
EMAIL_TRACKING_BASE_URL=
|
|
111
|
+
EMAIL_TRACKING_SECRET=
|
|
112
|
+
EMAIL_WEBHOOK_SECRET=
|
|
113
|
+
|
|
114
|
+
# -----------------------------------------------------------------------------
|
|
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
|
|
72
136
|
# -----------------------------------------------------------------------------
|
|
73
|
-
# These switches expose customer endpoints backed by Medusa's native
|
|
74
|
-
# return/exchange/claim workflows. They do not auto-approve or auto-refund.
|
|
75
137
|
AFTER_SALES_ENABLED=true
|
|
76
138
|
AFTER_SALES_RETURNS_ENABLED=true
|
|
77
139
|
AFTER_SALES_EXCHANGES_ENABLED=true
|
|
78
140
|
AFTER_SALES_CLAIMS_ENABLED=true
|
|
79
|
-
|
|
80
|
-
# Optional merchant policy page and text inserted into approved return e-mails.
|
|
81
|
-
# The Core intentionally does not hard-code legal return windows or eligibility.
|
|
82
141
|
AFTER_SALES_POLICY_URL=
|
|
83
142
|
AFTER_SALES_RETURN_INSTRUCTIONS=
|
|
84
143
|
|
|
85
144
|
# -----------------------------------------------------------------------------
|
|
86
|
-
#
|
|
145
|
+
# Quote requests / RFQ
|
|
87
146
|
# -----------------------------------------------------------------------------
|
|
88
|
-
# Generic B2B / custom-product quote layer. The storefront may build any design
|
|
89
|
-
# on top of /store/quote-requests and /store/quote-requests/config.
|
|
90
147
|
QUOTE_REQUESTS_ENABLED=true
|
|
91
148
|
QUOTE_EMAIL_ENABLED=true
|
|
92
|
-
# One or more merchant recipients, separated with comma or semicolon.
|
|
93
149
|
QUOTE_ADMIN_EMAILS=
|
|
94
|
-
# Optional JSON array of additional fields exposed by the Core quote config.
|
|
95
|
-
# Supported types: text, textarea, number, boolean, select.
|
|
96
|
-
# Example:
|
|
97
|
-
# 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"]}]
|
|
98
150
|
QUOTE_EXTRA_FIELDS_JSON=
|
|
99
151
|
|
|
100
152
|
# -----------------------------------------------------------------------------
|
|
101
|
-
#
|
|
153
|
+
# Leads / forms
|
|
102
154
|
# -----------------------------------------------------------------------------
|
|
103
|
-
# Generic backend for contact, callback, B2B lead and project-specific forms.
|
|
104
155
|
LEADS_ENABLED=true
|
|
105
156
|
LEAD_EMAIL_ENABLED=true
|
|
106
157
|
LEAD_CUSTOMER_EMAIL_ENABLED=false
|
|
@@ -108,38 +159,24 @@ LEAD_ADMIN_EMAILS=
|
|
|
108
159
|
LEAD_HONEYPOT_FIELD=website
|
|
109
160
|
LEAD_RATE_LIMIT_MAX=8
|
|
110
161
|
LEAD_RATE_LIMIT_WINDOW_SECONDS=600
|
|
111
|
-
# Optional dedicated HMAC secret for anonymized request fingerprints. If empty,
|
|
112
|
-
# COOKIE_SECRET is used. Raw IP addresses are never persisted by the lead module.
|
|
113
162
|
LEAD_SPAM_HASH_SECRET=
|
|
114
|
-
# Optional Cloudflare Turnstile. Both values are required to enable it.
|
|
115
163
|
LEAD_TURNSTILE_SITE_KEY=
|
|
116
164
|
LEAD_TURNSTILE_SECRET_KEY=
|
|
117
165
|
LEAD_PRIVACY_POLICY_VERSION=1
|
|
118
166
|
LEAD_PRIVACY_POLICY_URL=
|
|
119
167
|
LEAD_PRIVACY_POLICY_LABEL=Elfogadom az adatkezelési tájékoztatót.
|
|
120
|
-
# Optional JSON array defining one or more forms and custom fields.
|
|
121
|
-
# Empty = built-in `contact` form with name, email and message required.
|
|
122
168
|
LEAD_FORMS_JSON=
|
|
123
169
|
|
|
124
170
|
# -----------------------------------------------------------------------------
|
|
125
|
-
# CMS / blog
|
|
171
|
+
# CMS / blog
|
|
126
172
|
# -----------------------------------------------------------------------------
|
|
127
|
-
# Generic content engine for blog posts, pages, guides, news and custom types.
|
|
128
173
|
CMS_ENABLED=true
|
|
129
|
-
# Empty = STORE_LOCALE, then hu-HU fallback.
|
|
130
174
|
CMS_DEFAULT_LOCALE=
|
|
131
|
-
# Optional JSON array of content types shown to storefront/admin integrations.
|
|
132
|
-
# Content entries still store a free-form content_type, so projects can add
|
|
133
|
-
# project-specific types without changing the Core schema.
|
|
134
|
-
# Example:
|
|
135
|
-
# CMS_CONTENT_TYPES_JSON=[{"key":"blog_post","label":"Blogbejegyzés"},{"key":"page","label":"Oldal"},{"key":"guide","label":"Tudástár"}]
|
|
136
175
|
CMS_CONTENT_TYPES_JSON=
|
|
137
176
|
|
|
138
177
|
# -----------------------------------------------------------------------------
|
|
139
|
-
# Technical SEO
|
|
178
|
+
# Technical SEO
|
|
140
179
|
# -----------------------------------------------------------------------------
|
|
141
|
-
# Country remains the commercial region country. Locale controls public language
|
|
142
|
-
# and localized URL segments independently.
|
|
143
180
|
SEO_STOREFRONT_URL=
|
|
144
181
|
SEO_STORE_NAME=
|
|
145
182
|
SEO_ORGANIZATION_NAME=
|
|
@@ -148,29 +185,204 @@ SEO_DEFAULT_COUNTRY=
|
|
|
148
185
|
SEO_DEFAULT_CURRENCY=
|
|
149
186
|
SEO_DEFAULT_LOCALE=hu
|
|
150
187
|
SEO_SUPPORTED_LOCALES=hu,en
|
|
151
|
-
|
|
152
|
-
# Optional explicit Medusa region / sales channel for Product Offer JSON-LD.
|
|
153
188
|
SEO_REGION_ID=
|
|
154
189
|
SEO_SALES_CHANNEL_ID=
|
|
155
|
-
|
|
156
|
-
# Defaults generate /hu/termekek/... and /en/products/... from the same template.
|
|
157
190
|
SEO_PRODUCT_PATH_TEMPLATE=/{locale}/{products_segment}/{handle}
|
|
158
191
|
SEO_CATEGORY_PATH_TEMPLATE=/{locale}/{categories_segment}/{handle}
|
|
159
|
-
|
|
160
|
-
# Empty = enabled only in NODE_ENV=production. Set explicitly only when needed.
|
|
161
192
|
SEO_ALLOW_INDEXING=
|
|
162
|
-
# Extra comma-separated Disallow paths. Core defaults already include both HU and
|
|
163
|
-
# EN account/cart/checkout paths plus the legacy aliases.
|
|
164
193
|
SEO_ROBOTS_DISALLOW=
|
|
165
194
|
|
|
166
195
|
# -----------------------------------------------------------------------------
|
|
167
|
-
#
|
|
196
|
+
# Payment fallback/bootstrap settings
|
|
197
|
+
# Prefer Admin -> Settings -> Integrációk.
|
|
168
198
|
# -----------------------------------------------------------------------------
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
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
|
+
|
|
301
|
+
DPD_ENABLED=false
|
|
302
|
+
DPD_SANDBOX=true
|
|
303
|
+
DPD_API_URL=
|
|
304
|
+
DPD_TOKEN=
|
|
305
|
+
DPD_BU_CODE=
|
|
306
|
+
DPD_CUSTOMER_ID=
|
|
307
|
+
DPD_SENDER_ADDRESS_ID=
|
|
308
|
+
DPD_HOME_SERVICE_CODE=
|
|
309
|
+
DPD_COD_PAYMENT_TYPE=Cash
|
|
310
|
+
DPD_PUDO_SOURCE=disabled
|
|
311
|
+
DPD_PUDO_SERVICE_CODE=
|
|
312
|
+
DPD_PUDO_LOCATOR_URL=
|
|
313
|
+
DPD_PUDO_DELIS_ID=
|
|
314
|
+
DPD_PUDO_PASSWORD=
|
|
315
|
+
DPD_PUDO_MESSAGE_LANGUAGE=en_US
|
|
316
|
+
DPD_POINT_PRICE_HUF=1490
|
|
317
|
+
DPD_HOME_DELIVERY_PRICE_HUF=1990
|
|
318
|
+
DPD_FREE_SHIPPING_THRESHOLD_HUF=
|
|
319
|
+
DPD_TIMEOUT_MS=15000
|
|
320
|
+
DPD_DEFAULT_WEIGHT_KG=1
|
|
321
|
+
DPD_LABEL_SIZE=A6
|
|
322
|
+
DPD_PRINT_FORMAT=PDF
|
|
323
|
+
DPD_LABEL_DPI=203
|
|
324
|
+
|
|
325
|
+
MPL_ENABLED=false
|
|
326
|
+
MPL_SANDBOX=true
|
|
327
|
+
MPL_API_URL=
|
|
328
|
+
MPL_TRACKING_API_URL=
|
|
329
|
+
MPL_TOKEN_URL=
|
|
330
|
+
MPL_API_KEY=
|
|
331
|
+
MPL_API_SECRET=
|
|
332
|
+
MPL_AGREEMENT=
|
|
333
|
+
MPL_ACCOUNT_NO=
|
|
334
|
+
MPL_SENDER_NAME=Example Store
|
|
335
|
+
MPL_SENDER_EMAIL=orders@example.com
|
|
336
|
+
MPL_SENDER_PHONE=
|
|
337
|
+
MPL_SENDER_POST_CODE=
|
|
338
|
+
MPL_SENDER_CITY=
|
|
339
|
+
MPL_SENDER_ADDRESS=
|
|
340
|
+
MPL_DEVELOPER=HSZRDM Commerce
|
|
341
|
+
MPL_BASIC_SERVICE_CODE=
|
|
342
|
+
MPL_EXTRA_SERVICES=
|
|
343
|
+
MPL_PAYMENT_MODE=
|
|
344
|
+
MPL_TAG=
|
|
345
|
+
MPL_HOME_DELIVERY_MODE=HA
|
|
346
|
+
MPL_POINT_PRICE_HUF=1290
|
|
347
|
+
MPL_HOME_DELIVERY_PRICE_HUF=1990
|
|
348
|
+
MPL_FREE_SHIPPING_THRESHOLD_HUF=
|
|
349
|
+
MPL_TIMEOUT_MS=15000
|
|
350
|
+
MPL_DEFAULT_WEIGHT_KG=1
|
|
351
|
+
MPL_LABEL_TYPE=A6
|
|
352
|
+
MPL_PACKAGE_RETENTION=5
|
|
353
|
+
MPL_TRACKING_ENABLED=false
|
|
354
|
+
MPL_TRACKING_LANGUAGE=hu
|
|
355
|
+
|
|
356
|
+
# -----------------------------------------------------------------------------
|
|
357
|
+
# Product feeds / trust widgets - optional
|
|
358
|
+
# -----------------------------------------------------------------------------
|
|
359
|
+
GOOGLE_MERCHANT_ENABLED=false
|
|
360
|
+
GOOGLE_MERCHANT_COUNTRY_CODE=HU
|
|
361
|
+
GOOGLE_MERCHANT_CURRENCY_CODE=HUF
|
|
362
|
+
GOOGLE_MERCHANT_LOCALE=hu-HU
|
|
363
|
+
GOOGLE_MERCHANT_STOREFRONT_URL=
|
|
364
|
+
GOOGLE_MERCHANT_PRODUCT_PATH_TEMPLATE=/{locale}/{products_segment}/{handle}?v_id={variant_id}
|
|
365
|
+
GOOGLE_MERCHANT_SALES_CHANNEL_ID=
|
|
366
|
+
GOOGLE_MERCHANT_FEED_TITLE=
|
|
367
|
+
GOOGLE_MERCHANT_FEED_DESCRIPTION=
|
|
368
|
+
GOOGLE_MERCHANT_DEFAULT_BRAND=
|
|
369
|
+
GOOGLE_MERCHANT_DEFAULT_CONDITION=new
|
|
370
|
+
GOOGLE_MERCHANT_INCLUDE_OUT_OF_STOCK=true
|
|
371
|
+
|
|
372
|
+
ARUKERESO_ENABLED=false
|
|
373
|
+
ARUKERESO_STOREFRONT_URL=
|
|
374
|
+
ARUKERESO_PRODUCT_PATH_TEMPLATE=/hu/termekek/{handle}?v_id={variant_id}
|
|
375
|
+
ARUKERESO_SALES_CHANNEL_ID=
|
|
376
|
+
ARUKERESO_DEFAULT_MANUFACTURER=
|
|
377
|
+
ARUKERESO_USE_SKU_AS_PRODUCT_NUMBER=false
|
|
378
|
+
ARUKERESO_INCLUDE_OUT_OF_STOCK=true
|
|
379
|
+
ARUKERESO_DEFAULT_DELIVERY_TIME=
|
|
380
|
+
ARUKERESO_DEFAULT_DELIVERY_COST=
|
|
381
|
+
|
|
382
|
+
FOGYASZTOBARAT_ENABLED=false
|
|
383
|
+
FOGYASZTOBARAT_DATA_ID=
|
|
384
|
+
|
|
385
|
+
# -----------------------------------------------------------------------------
|
|
386
|
+
# Generator only (not used by a running shop)
|
|
387
|
+
# -----------------------------------------------------------------------------
|
|
388
|
+
# HSZRDM_MIN_FREE_GB=8
|
|
@@ -3,12 +3,14 @@
|
|
|
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",
|
|
13
15
|
"storefront:key": "npm run prepare:project && medusa exec ./src/scripts/create-storefront-key.ts",
|
|
14
16
|
"bootstrap:assert": "npm run prepare:project && medusa exec ./src/scripts/verify-bootstrap.ts",
|
|
@@ -17,7 +19,7 @@
|
|
|
17
19
|
"start:prod": "cd .medusa/server && medusa start"
|
|
18
20
|
},
|
|
19
21
|
"dependencies": {
|
|
20
|
-
"@hszrdm/core": "1.
|
|
22
|
+
"@hszrdm/core": "1.4.0",
|
|
21
23
|
"@medusajs/admin-sdk": "2.21.2",
|
|
22
24
|
"@medusajs/cli": "2.21.2",
|
|
23
25
|
"@medusajs/draft-order": "2.21.2",
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
"@medusajs/ui": "4.2.6",
|
|
27
29
|
"react": "^18.3.1",
|
|
28
30
|
"react-dom": "^18.3.1",
|
|
29
|
-
"react-router-dom": "7.18.
|
|
31
|
+
"react-router-dom": "7.18.2"
|
|
30
32
|
},
|
|
31
33
|
"devDependencies": {
|
|
32
34
|
"@swc/core": "1.16.13",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { chmodSync, copyFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs"
|
|
4
|
+
import { dirname, join, resolve } from "node:path"
|
|
5
|
+
import { fileURLToPath } from "node:url"
|
|
6
|
+
|
|
7
|
+
const backendRoot = resolve(dirname(fileURLToPath(import.meta.url)), "..")
|
|
8
|
+
const root = resolve(backendRoot, "..")
|
|
9
|
+
const metadataPath = join(root, "hszrdm-commerce.json")
|
|
10
|
+
const assetsDir = join(backendRoot, "scripts", "production-assets")
|
|
11
|
+
|
|
12
|
+
// The starter itself may be installed in the Core monorepo. Only materialize
|
|
13
|
+
// production assets inside an actual generated client project.
|
|
14
|
+
if (!existsSync(metadataPath)) process.exit(0)
|
|
15
|
+
|
|
16
|
+
const metadata = JSON.parse(readFileSync(metadataPath, "utf8"))
|
|
17
|
+
const slug = String(metadata?.project?.slug || "hszrdm-commerce").trim() || "hszrdm-commerce"
|
|
18
|
+
const deployDir = join(root, "deploy")
|
|
19
|
+
mkdirSync(deployDir, { recursive: true })
|
|
20
|
+
|
|
21
|
+
for (const name of ["install.sh", "deploy.sh", "backup.sh", "restore.sh"]) {
|
|
22
|
+
const source = join(assetsDir, name)
|
|
23
|
+
const target = join(deployDir, name)
|
|
24
|
+
if (!existsSync(source)) throw new Error(`Missing production asset: ${source}`)
|
|
25
|
+
if (!existsSync(target)) copyFileSync(source, target)
|
|
26
|
+
try { chmodSync(target, 0o755) } catch {}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const ecosystemSource = join(assetsDir, "ecosystem.config.cjs.tpl")
|
|
30
|
+
const ecosystemTarget = join(root, "ecosystem.config.cjs")
|
|
31
|
+
if (!existsSync(ecosystemSource)) throw new Error(`Missing production asset: ${ecosystemSource}`)
|
|
32
|
+
if (!existsSync(ecosystemTarget)) {
|
|
33
|
+
const source = readFileSync(ecosystemSource, "utf8")
|
|
34
|
+
writeFileSync(ecosystemTarget, source.replaceAll("__HSZRDM_SLUG__", slug), "utf8")
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
console.log("✅ Production deploy assets are available in deploy/ and ecosystem.config.cjs")
|