ساخت و انتشار

خروجی قالب یک پوشه استاتیک است: هر فایل HTML یک صفحه مستقل، یک فایل CSS و چند فایل JS. روی هر هاست ساده‌ای اجرا می‌شود.

ساخت خروجی

npm run build

زنجیره ساخت به ترتیب زیر اجرا می‌شود و همه مراحل باید سبز باشند:

  1. node tools/build-pages.mjs --mode build — خواندن tools/manifest.mjs و تولید ۲۰۶ صفحه در src/pages/
  2. node tools/gen-assets.mjs — تولید لوگو، ۲۴ آواتار، ۲۴ تصویر محصول و ۱۲ لوگوی برند به‌صورت SVG
  3. node tools/gen-nav.mjs — تولید src/data/navigation.js، public/sitemap.xml و public/robots.txt
  4. vite build — باندل کردن CSS، JS و فونت‌ها در dist/
  5. node tools/flatten-dist.mjs — انتقال dist/src/pages/** به ریشه dist/ و اصلاح مسیرهای نسبی
نکته: هیچ‌وقت فایل‌های dist/ را دستی جابه‌جا نکنید

مرحله flatten-dist این کار را انجام می‌دهد و مسیر همه دارایی‌ها را با عمق جدید هماهنگ می‌کند.

نتیجه ساخت

dist/
├── index.html                 صفحه محصول
├── widgets.html, preview.html  صفحه‌های سطح ریشه
├── dashboards/*.html          ۱۰ داشبورد
├── apps/ ai/ crm/ ecommerce/ finance/ hr/ logistics/ …
├── assets/css/modules-<hash>.css
├── assets/js/{modules,content,ai,apps,kit,vendor-*}-<hash>.js
├── assets/fonts/Vazirmatn-*.woff2
├── assets/img/{avatars,products,brands}/
├── robots.txt
└── sitemap.xml

اندازه خروجی حدود ۲۴ مگابایت است که بیشتر آن آواتارها و تصاویر SVG و نمودارها است.

پیش‌نمایش خروجی

npm run preview -- --port 4173

انتشار روی هاست

۱) هاست اشتراکی / cPanel

محتوای پوشه dist/ را در public_html آپلود کنید. تمام شد.

۲) Netlify / Vercel / Cloudflare Pages

تنظیممقدار
Build commandnpm run build
Publish directorydist
Node version۱۸ یا بالاتر

۳) GitHub Pages

npm run build
npx gh-pages -d dist

اگر سایت در زیرمسیر منتشر می‌شود (user.github.io/repo/)، لینک‌ها نسبی هستند و مشکلی پیش نمی‌آید؛ فقط website را در src/config/config.js برابر آدرس نهایی بگذارید تا sitemap.xml درست تولید شود.

۴) Nginx (نمونه)

server {
  listen 80;
  root /var/www/novaadmin;
  index index.html;

  location /assets/ {
    expires 1y;
    add_header Cache-Control "public, immutable";
  }

  location / {
    try_files $uri $uri.html $uri/ =404;
  }
}

هدرهای پیشنهادی کش

مسیرسیاست
assets/**۱ سال، immutable (نام فایل‌ها هش دارند)
**.htmlبدون کش یا must-revalidate
sitemap.xml, robots.txt۱ روز

چک‌لیست پیش از انتشار

  • npm run qa:all سبز است (ساخت + لینک‌ها + اجرای کنترل‌کننده‌ها)
  • در src/config/config.js مقادیر appName، tagline، website، supportEmail و defaultLanguage نهایی شده‌اند
  • صفحات خطای هاست (۴۰۴) به system/404.html هدایت شده‌اند
  • sitemap.xml آدرس دامنه نهایی را دارد
  • فایل LICENSE.txt و اعتبارها حفظ شده‌اند

Build and release

The template's output is a static folder: every HTML file is a standalone page, plus one CSS file and a few JS files. It runs on any simple host.

Building the output

npm run build

The build chain runs in the following order and every step must be green:

  1. node tools/build-pages.mjs --mode build — reads tools/manifest.mjs and generates 206 pages in src/pages/
  2. node tools/gen-assets.mjs — generates the logo, 24 avatars, 24 product images and 12 brand logos as SVG
  3. node tools/gen-nav.mjs — generates src/data/navigation.js, public/sitemap.xml and public/robots.txt
  4. vite build — bundles CSS, JS and fonts into dist/
  5. node tools/flatten-dist.mjs — moves dist/src/pages/** to the root of dist/ and fixes relative paths
Tip: never move files in dist/ by hand

The flatten-dist step does it and aligns every asset path with the new depth.

Build result

dist/
├── index.html                 product page
├── widgets.html, preview.html  root-level pages
├── dashboards/*.html          10 dashboards
├── apps/ ai/ crm/ ecommerce/ finance/ hr/ logistics/ …
├── assets/css/modules-<hash>.css
├── assets/js/{modules,content,ai,apps,kit,vendor-*}-<hash>.js
├── assets/fonts/Vazirmatn-*.woff2
├── assets/img/{avatars,products,brands}/
├── robots.txt
└── sitemap.xml

The output is about 24 MB, most of which is avatars, SVG images and charts.

Previewing the output

npm run preview -- --port 4173

Publishing to a host

1) Shared hosting / cPanel

Upload the contents of the dist/ folder to public_html. Done.

2) Netlify / Vercel / Cloudflare Pages

SettingValue
Build commandnpm run build
Publish directorydist
Node version18 or higher

3) GitHub Pages

npm run build
npx gh-pages -d dist

If the site is published under a sub-path (user.github.io/repo/), links are relative so nothing breaks; just set website in src/config/config.js to the final address so sitemap.xml is generated correctly.

4) Nginx (example)

server {
  listen 80;
  root /var/www/novaadmin;
  index index.html;

  location /assets/ {
    expires 1y;
    add_header Cache-Control "public, immutable";
  }

  location / {
    try_files $uri $uri.html $uri/ =404;
  }
}

Recommended cache headers

PathPolicy
assets/**1 year, immutable (file names are hashed)
**.htmlNo cache or must-revalidate
sitemap.xml, robots.txt1 day

Pre-release checklist

  • npm run qa:all is green (build + links + controller runs)
  • appName, tagline, website, supportEmail and defaultLanguage are finalised in src/config/config.js
  • The host's error pages (404) point to system/404.html
  • sitemap.xml contains the final domain
  • LICENSE.txt and the credits are preserved

البناء والنشر

مخرجات القالب مجلد ثابت: كل ملف HTML صفحة مستقلة، مع ملف CSS واحد وبضعة ملفات JS. ويعمل على أي استضافة بسيطة.

بناء المخرجات

npm run build

تُنفَّذ سلسلة البناء بالترتيب التالي ويجب أن تنجح جميع المراحل:

  1. node tools/build-pages.mjs --mode build — قراءة tools/manifest.mjs وتوليد ٢٠٦ صفحات في src/pages/
  2. node tools/gen-assets.mjs — توليد الشعار و٢٤ صورة رمزية و٢٤ صورة منتج و١٢ شعار علامة بصيغة SVG
  3. node tools/gen-nav.mjs — توليد src/data/navigation.js وpublic/sitemap.xml وpublic/robots.txt
  4. vite build — تجميع CSS وJS والخطوط في dist/
  5. node tools/flatten-dist.mjs — نقل dist/src/pages/** إلى جذر dist/ وتصحيح المسارات النسبية
ملاحظة: لا تنقل ملفات dist/ يدوياً أبداً

تتولى مرحلة flatten-dist ذلك وتوائم مسارات جميع الأصول مع العمق الجديد.

نتيجة البناء

dist/
├── index.html                 صفحة المنتج
├── widgets.html, preview.html  صفحات على مستوى الجذر
├── dashboards/*.html          ١٠ لوحات تحكم
├── apps/ ai/ crm/ ecommerce/ finance/ hr/ logistics/ …
├── assets/css/modules-<hash>.css
├── assets/js/{modules,content,ai,apps,kit,vendor-*}-<hash>.js
├── assets/fonts/Vazirmatn-*.woff2
├── assets/img/{avatars,products,brands}/
├── robots.txt
└── sitemap.xml

حجم المخرجات نحو ٢٤ ميغابايت، معظمها صور رمزية وصور SVG ومخططات.

معاينة المخرجات

npm run preview -- --port 4173

النشر على الاستضافة

١) استضافة مشتركة / cPanel

ارفع محتوى المجلد dist/ إلى public_html. انتهى.

٢) Netlify / Vercel / Cloudflare Pages

الإعدادالقيمة
Build commandnpm run build
Publish directorydist
Node version١٨ أو أعلى

٣) GitHub Pages

npm run build
npx gh-pages -d dist

إذا نُشر الموقع في مسار فرعي (user.github.io/repo/)، فالروابط نسبية ولن تحدث مشكلة؛ فقط اضبط website في src/config/config.js على العنوان النهائي ليُولَّد sitemap.xml بشكل صحيح.

٤) Nginx (مثال)

server {
  listen 80;
  root /var/www/novaadmin;
  index index.html;

  location /assets/ {
    expires 1y;
    add_header Cache-Control "public, immutable";
  }

  location / {
    try_files $uri $uri.html $uri/ =404;
  }
}

ترويسات التخزين المؤقت المقترحة

المسارالسياسة
assets/**سنة واحدة، immutable (أسماء الملفات مجزّأة)
**.htmlبلا تخزين مؤقت أو must-revalidate
sitemap.xml, robots.txtيوم واحد

قائمة التحقق قبل النشر

  • npm run qa:all ناجح (البناء + الروابط + تشغيل المتحكمات)
  • القيم appName وtagline وwebsite وsupportEmail وdefaultLanguage نهائية في src/config/config.js
  • صفحات خطأ الاستضافة (٤٠٤) موجّهة إلى system/404.html
  • يحتوي sitemap.xml على النطاق النهائي
  • الملف LICENSE.txt والإشادات محفوظة