AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <?php
  2. namespace App\StorePlan;
  3. use App\Models\Store;
  4. /**
  5. * A hand-written plan. Used as the format example in AI prompts, by the fake AI provider, and in tests.
  6. * It uses every section type once.
  7. */
  8. final class SamplePlan
  9. {
  10. /**
  11. * @return array<string, mixed>
  12. */
  13. public static function for(Store $store): array
  14. {
  15. return self::forName($store->name);
  16. }
  17. /**
  18. * @return array<string, mixed>
  19. */
  20. public static function forName(string $name): array
  21. {
  22. return PlanUpgrader::upgrade(self::flat($name));
  23. }
  24. /**
  25. * The sample written as one flat list, header first and footer last, which is the easiest form to read.
  26. * PlanUpgrader then moves the header and footer out and puts the rest on the home page.
  27. *
  28. * @return array<string, mixed>
  29. */
  30. private static function flat(string $name): array
  31. {
  32. return [
  33. 'version' => 1,
  34. 'theme' => [
  35. 'colors' => [
  36. 'background' => '#FBF7F0',
  37. 'surface' => '#F3EADB',
  38. 'foreground' => '#2A1A12',
  39. 'muted' => '#7A6557',
  40. 'primary' => '#B4411F',
  41. 'primaryForeground' => '#FFF8F0',
  42. 'accent' => '#E2A93B',
  43. 'border' => '#E3D5C0',
  44. ],
  45. 'fonts' => ['heading' => 'fraunces', 'body' => 'dm-sans'],
  46. 'radius' => 'medium',
  47. ],
  48. 'sections' => [
  49. [
  50. 'id' => 'header',
  51. 'type' => 'header',
  52. 'variant' => 'simple',
  53. 'content' => [
  54. 'logoText' => $name,
  55. 'links' => [
  56. ['label' => 'Shop', 'href' => '#products'],
  57. ['label' => 'Our story', 'href' => '#about'],
  58. ['label' => 'FAQ', 'href' => '#faq'],
  59. ['label' => 'Contact', 'href' => '#contact'],
  60. ],
  61. 'cta' => ['label' => 'Shop now', 'href' => '#products'],
  62. ],
  63. ],
  64. [
  65. 'id' => 'hero',
  66. 'type' => 'hero',
  67. 'variant' => 'split',
  68. 'content' => [
  69. 'eyebrow' => 'Small batch · Made in Malaysia',
  70. 'headline' => 'Sambal the way grandma made it',
  71. 'subheadline' => 'Slow-cooked for six hours with fresh chillies and no preservatives. One spoon turns plain rice into a meal.',
  72. 'primaryCta' => ['label' => 'Shop the range', 'href' => '#products'],
  73. 'secondaryCta' => ['label' => 'Our story', 'href' => '#about'],
  74. ],
  75. ],
  76. [
  77. 'id' => 'products',
  78. 'type' => 'product_grid',
  79. 'variant' => 'grid',
  80. 'content' => [
  81. 'heading' => 'Best sellers',
  82. 'subheading' => 'Cooked fresh every week and delivered across Malaysia.',
  83. 'items' => [
  84. ['name' => 'Sambal Ikan Bilis', 'price' => 18.90, 'badge' => 'Best seller'],
  85. ['name' => 'Sambal Hijau', 'price' => 16.90, 'badge' => null],
  86. ['name' => 'Sambal Petai', 'price' => 21.90, 'badge' => 'New'],
  87. ['name' => 'Sambal Belacan', 'price' => 15.90, 'badge' => null],
  88. ],
  89. ],
  90. ],
  91. [
  92. 'id' => 'featured',
  93. 'type' => 'featured_product',
  94. 'variant' => 'image-right',
  95. 'content' => [
  96. 'eyebrow' => 'Gift set',
  97. 'name' => 'The Family Trio',
  98. 'description' => 'Three of our most loved sambals in one box. A good first order, and an easy gift for anyone who misses home cooking.',
  99. 'price' => 49.90,
  100. 'bullets' => [
  101. 'Three 180g jars',
  102. 'Keeps for 3 months unopened',
  103. 'Free delivery in Peninsular Malaysia',
  104. ],
  105. 'cta' => ['label' => 'Add to cart', 'href' => '#products'],
  106. ],
  107. ],
  108. [
  109. 'id' => 'about',
  110. 'type' => 'about',
  111. 'variant' => 'with-stats',
  112. 'content' => [
  113. 'heading' => 'A family recipe, three generations old',
  114. 'body' => "$name began in a home kitchen, with a recipe passed from grandmother to mother to daughter. We still cook in small batches, taste every pot, and use chillies bought from the same farms each week.",
  115. 'stats' => [
  116. ['value' => '6 hrs', 'label' => 'Slow-cooked per batch'],
  117. ['value' => '0', 'label' => 'Preservatives'],
  118. ['value' => '12k+', 'label' => 'Jars delivered'],
  119. ],
  120. ],
  121. ],
  122. [
  123. 'id' => 'testimonials',
  124. 'type' => 'testimonials',
  125. 'variant' => 'cards',
  126. 'content' => [
  127. 'heading' => 'What customers say',
  128. 'items' => [
  129. ['quote' => 'Tastes exactly like my late mother\'s sambal. I order four jars every month.', 'name' => 'Aishah R.', 'role' => 'Shah Alam'],
  130. ['quote' => 'Spicy, but balanced. My kids now ask for it with every meal.', 'name' => 'Daniel L.', 'role' => 'Penang'],
  131. ['quote' => 'Arrived well packed and fresh. The petai one is dangerous.', 'name' => 'Farah N.', 'role' => 'Johor Bahru'],
  132. ],
  133. ],
  134. ],
  135. [
  136. 'id' => 'faq',
  137. 'type' => 'faq',
  138. 'variant' => 'list',
  139. 'content' => [
  140. 'heading' => 'Common questions',
  141. 'items' => [
  142. ['question' => 'How long does it keep?', 'answer' => 'Three months unopened. After opening, keep it in the fridge and finish within four weeks.'],
  143. ['question' => 'How spicy is it?', 'answer' => 'Most of our sambals are medium. Sambal Hijau is the mildest and Sambal Belacan is the hottest.'],
  144. ['question' => 'Do you deliver to East Malaysia?', 'answer' => 'Yes. Delivery to Sabah and Sarawak takes three to five working days.'],
  145. ],
  146. ],
  147. ],
  148. [
  149. 'id' => 'newsletter',
  150. 'type' => 'newsletter',
  151. 'variant' => 'banner',
  152. 'content' => [
  153. 'heading' => 'Get 10% off your first order',
  154. 'body' => 'Join our list for new flavours and recipes. No spam.',
  155. 'placeholder' => 'Your email address',
  156. 'buttonLabel' => 'Sign up',
  157. ],
  158. ],
  159. [
  160. 'id' => 'contact',
  161. 'type' => 'contact',
  162. 'variant' => 'simple',
  163. 'content' => [
  164. 'heading' => 'Talk to us',
  165. 'body' => 'Questions about an order, or want to stock our sambal? We reply within a day.',
  166. 'email' => 'hello@example.com',
  167. 'phone' => '+60 12-345 6789',
  168. 'whatsapp' => '60123456789',
  169. 'address' => 'Shah Alam, Selangor',
  170. ],
  171. ],
  172. [
  173. 'id' => 'footer',
  174. 'type' => 'footer',
  175. 'variant' => 'simple',
  176. 'content' => [
  177. 'text' => "© $name. All rights reserved.",
  178. 'links' => [
  179. ['label' => 'Shop', 'href' => '#products'],
  180. ['label' => 'FAQ', 'href' => '#faq'],
  181. ['label' => 'Contact', 'href' => '#contact'],
  182. ],
  183. ],
  184. ],
  185. ],
  186. ];
  187. }
  188. }