create-frootkit 1.1.4 → 1.2.1

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 (109) hide show
  1. package/README.md +50 -16
  2. package/dist/addons/database.d.ts +3 -2
  3. package/dist/addons/database.d.ts.map +1 -1
  4. package/dist/addons/database.js +472 -13
  5. package/dist/addons/database.js.map +1 -1
  6. package/dist/index.js +93 -18
  7. package/dist/index.js.map +1 -1
  8. package/dist/scaffold.d.ts +1 -0
  9. package/dist/scaffold.d.ts.map +1 -1
  10. package/dist/scaffold.js +3 -3
  11. package/dist/scaffold.js.map +1 -1
  12. package/dist/template.d.ts +4 -5
  13. package/dist/template.d.ts.map +1 -1
  14. package/dist/template.js +6 -404
  15. package/dist/template.js.map +1 -1
  16. package/dist/templates/auth.d.ts +3 -0
  17. package/dist/templates/auth.d.ts.map +1 -0
  18. package/dist/templates/auth.js +487 -0
  19. package/dist/templates/auth.js.map +1 -0
  20. package/dist/templates/blog.d.ts +3 -0
  21. package/dist/templates/blog.d.ts.map +1 -0
  22. package/dist/templates/blog.js +369 -0
  23. package/dist/templates/blog.js.map +1 -0
  24. package/dist/templates/common.d.ts +5 -0
  25. package/dist/templates/common.d.ts.map +1 -0
  26. package/dist/templates/common.js +116 -0
  27. package/dist/templates/common.js.map +1 -0
  28. package/dist/templates/ecommerce.d.ts +3 -0
  29. package/dist/templates/ecommerce.d.ts.map +1 -0
  30. package/dist/templates/ecommerce.js +474 -0
  31. package/dist/templates/ecommerce.js.map +1 -0
  32. package/dist/templates/empty.d.ts +3 -0
  33. package/dist/templates/empty.d.ts.map +1 -0
  34. package/dist/templates/empty.js +85 -0
  35. package/dist/templates/empty.js.map +1 -0
  36. package/dist/templates/index.d.ts +23 -0
  37. package/dist/templates/index.d.ts.map +1 -0
  38. package/dist/templates/index.js +100 -0
  39. package/dist/templates/index.js.map +1 -0
  40. package/dist/templates/starter.d.ts +3 -0
  41. package/dist/templates/starter.d.ts.map +1 -0
  42. package/dist/templates/starter.js +308 -0
  43. package/dist/templates/starter.js.map +1 -0
  44. package/dist/templates/types.d.ts +13 -0
  45. package/dist/templates/types.d.ts.map +1 -0
  46. package/dist/templates/types.js +5 -0
  47. package/dist/templates/types.js.map +1 -0
  48. package/package.json +2 -1
  49. package/templates/auth/README.md +11 -0
  50. package/templates/auth/package.json +24 -0
  51. package/templates/auth/src/app/api/auth/route.ts +148 -0
  52. package/templates/auth/src/app/dashboard/layout.tsx +34 -0
  53. package/templates/auth/src/app/dashboard/page.tsx +72 -0
  54. package/templates/auth/src/app/layout.tsx +31 -0
  55. package/templates/auth/src/app/login/page.tsx +18 -0
  56. package/templates/auth/src/app/page.tsx +60 -0
  57. package/templates/auth/src/app/signup/page.tsx +18 -0
  58. package/templates/auth/src/components/AuthForm.tsx +77 -0
  59. package/templates/auth/src/components/DashboardNav.tsx +51 -0
  60. package/templates/auth/src/components/MetricCard.tsx +26 -0
  61. package/templates/auth/src/components/Navbar.tsx +29 -0
  62. package/templates/auth/src/lib/auth.ts +145 -0
  63. package/templates/auth/src/styles.css +19 -0
  64. package/templates/auth/tsconfig.json +13 -0
  65. package/templates/blog/README.md +11 -0
  66. package/templates/blog/package.json +24 -0
  67. package/templates/blog/src/app/api/posts/route.ts +36 -0
  68. package/templates/blog/src/app/blog/[slug]/page.tsx +74 -0
  69. package/templates/blog/src/app/layout.tsx +31 -0
  70. package/templates/blog/src/app/page.tsx +44 -0
  71. package/templates/blog/src/components/Footer.tsx +16 -0
  72. package/templates/blog/src/components/Navbar.tsx +31 -0
  73. package/templates/blog/src/components/Newsletter.tsx +32 -0
  74. package/templates/blog/src/components/PostCard.tsx +47 -0
  75. package/templates/blog/src/data/posts.ts +75 -0
  76. package/templates/blog/src/styles.css +19 -0
  77. package/templates/blog/tsconfig.json +13 -0
  78. package/templates/ecommerce/README.md +11 -0
  79. package/templates/ecommerce/package.json +24 -0
  80. package/templates/ecommerce/src/app/api/checkout/route.ts +19 -0
  81. package/templates/ecommerce/src/app/api/products/route.ts +28 -0
  82. package/templates/ecommerce/src/app/cart/page.tsx +22 -0
  83. package/templates/ecommerce/src/app/layout.tsx +31 -0
  84. package/templates/ecommerce/src/app/page.tsx +59 -0
  85. package/templates/ecommerce/src/app/products/[id]/page.tsx +88 -0
  86. package/templates/ecommerce/src/components/CartDrawer.tsx +64 -0
  87. package/templates/ecommerce/src/components/Footer.tsx +16 -0
  88. package/templates/ecommerce/src/components/Navbar.tsx +32 -0
  89. package/templates/ecommerce/src/components/ProductCard.tsx +52 -0
  90. package/templates/ecommerce/src/data/products.ts +87 -0
  91. package/templates/ecommerce/src/styles.css +19 -0
  92. package/templates/ecommerce/tsconfig.json +13 -0
  93. package/templates/empty/README.md +10 -0
  94. package/templates/empty/package.json +24 -0
  95. package/templates/empty/src/app/layout.tsx +29 -0
  96. package/templates/empty/src/app/page.tsx +38 -0
  97. package/templates/empty/src/styles.css +19 -0
  98. package/templates/empty/tsconfig.json +13 -0
  99. package/templates/starter/README.md +22 -0
  100. package/templates/starter/package.json +24 -0
  101. package/templates/starter/src/app/api/health/route.ts +23 -0
  102. package/templates/starter/src/app/layout.tsx +31 -0
  103. package/templates/starter/src/app/page.tsx +122 -0
  104. package/templates/starter/src/components/FeatureCard.tsx +25 -0
  105. package/templates/starter/src/components/Footer.tsx +16 -0
  106. package/templates/starter/src/components/Header.tsx +45 -0
  107. package/templates/starter/src/components/TerminalPreview.tsx +56 -0
  108. package/templates/starter/src/styles.css +19 -0
  109. package/templates/starter/tsconfig.json +13 -0
@@ -0,0 +1,88 @@
1
+ import { PRODUCTS } from '../../../data/products.js';
2
+ import { Navbar } from '../../../components/Navbar.js';
3
+ import { Footer } from '../../../components/Footer.js';
4
+
5
+ export async function generateStaticParams() {
6
+ return PRODUCTS.map((p) => ({ id: p.id }));
7
+ }
8
+
9
+ export default function ProductDetailPage({ params }: { params?: { id?: string } }) {
10
+ const id = params?.id || 'nordic-mechanical-keyboard';
11
+ const product = PRODUCTS.find((p) => p.id === id) || PRODUCTS[0]!;
12
+
13
+ return (
14
+ <div class="min-h-screen flex flex-col justify-between">
15
+ <Navbar />
16
+
17
+ <main class="max-w-6xl mx-auto px-6 py-12 flex-1 w-full">
18
+ <a
19
+ href="/"
20
+ class="inline-flex items-center gap-2 text-sm text-slate-400 hover:text-emerald-400 mb-8 transition-colors"
21
+ >
22
+ &larr; Back to catalog
23
+ </a>
24
+
25
+ <div class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-start">
26
+ <div class="rounded-3xl border border-slate-800 overflow-hidden bg-slate-950 aspect-[4/3]">
27
+ <img
28
+ src={product.image}
29
+ alt={product.name}
30
+ class="w-full h-full object-cover"
31
+ />
32
+ </div>
33
+
34
+ <div>
35
+ <div class="flex items-center gap-2 mb-3">
36
+ <span class="px-2.5 py-0.5 rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 text-xs font-mono font-medium">
37
+ {product.category}
38
+ </span>
39
+ <span class="text-amber-400 text-xs font-bold">
40
+ &#9733; {product.rating} ({product.reviewsCount} reviews)
41
+ </span>
42
+ </div>
43
+
44
+ <h1 class="text-3xl sm:text-4xl font-black text-white tracking-tight mb-4">
45
+ {product.name}
46
+ </h1>
47
+
48
+ <div class="text-3xl font-black text-emerald-400 mb-6 font-mono">
49
+ ${product.price.toFixed(2)}
50
+ </div>
51
+
52
+ <p class="text-slate-300 text-base leading-relaxed mb-8">
53
+ {product.description}
54
+ </p>
55
+
56
+ <div class="border-t border-slate-800 pt-6 mb-8">
57
+ <h3 class="text-xs uppercase font-mono font-bold text-slate-400 tracking-wider mb-4">
58
+ Key Specifications
59
+ </h3>
60
+ <ul class="grid grid-cols-1 sm:grid-cols-2 gap-3 text-sm text-slate-300">
61
+ {product.features.map((f) => (
62
+ <li key={f} class="flex items-center gap-2">
63
+ <span class="text-emerald-400 font-bold">&#10003;</span>
64
+ <span>{f}</span>
65
+ </li>
66
+ ))}
67
+ </ul>
68
+ </div>
69
+
70
+ <div class="flex items-center gap-4">
71
+ <a
72
+ href="/cart"
73
+ class="flex-1 py-3.5 rounded-xl bg-emerald-500 text-slate-950 font-bold text-center text-sm hover:bg-emerald-400 transition-colors shadow-lg shadow-emerald-500/20"
74
+ >
75
+ Add to Cart &bull; ${product.price.toFixed(2)}
76
+ </a>
77
+ <span class="text-xs text-slate-500 font-mono">
78
+ {product.inStock ? 'In Stock (Ready to Ship)' : 'Backorder'}
79
+ </span>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </main>
84
+
85
+ <Footer />
86
+ </div>
87
+ );
88
+ }
@@ -0,0 +1,64 @@
1
+ import { PRODUCTS } from '../data/products.js';
2
+
3
+ export function CartDrawer() {
4
+ const cartItems = [
5
+ { product: PRODUCTS[0]!, quantity: 1 },
6
+ { product: PRODUCTS[2]!, quantity: 1 },
7
+ ];
8
+
9
+ const subtotal = cartItems.reduce((acc, item) => acc + item.product.price * item.quantity, 0);
10
+ const shipping = subtotal > 100 ? 0 : 15;
11
+ const total = subtotal + shipping;
12
+
13
+ return (
14
+ <div class="rounded-2xl border border-slate-800 bg-slate-900/60 p-6 backdrop-blur-md">
15
+ <h2 class="text-lg font-bold text-white mb-4 flex items-center justify-between">
16
+ <span>Order Summary</span>
17
+ <span class="text-xs font-mono text-emerald-400 font-semibold">{cartItems.length} items</span>
18
+ </h2>
19
+
20
+ <div class="space-y-4 mb-6">
21
+ {cartItems.map(({ product, quantity }) => (
22
+ <div key={product.id} class="flex items-center gap-3 pb-3 border-b border-slate-800/60">
23
+ <img
24
+ src={product.image}
25
+ alt={product.name}
26
+ class="w-12 h-12 rounded-lg object-cover bg-slate-950"
27
+ />
28
+ <div class="flex-1 min-w-0">
29
+ <h4 class="text-xs font-semibold text-white truncate">{product.name}</h4>
30
+ <div class="text-[11px] text-slate-400">Qty: {quantity} &times; ${product.price}</div>
31
+ </div>
32
+ <div class="font-bold text-sm text-white font-mono">
33
+ ${(product.price * quantity).toFixed(2)}
34
+ </div>
35
+ </div>
36
+ ))}
37
+ </div>
38
+
39
+ <div class="space-y-2 text-xs text-slate-400 mb-6 font-mono">
40
+ <div class="flex justify-between">
41
+ <span>Subtotal</span>
42
+ <span class="text-white font-bold">${subtotal.toFixed(2)}</span>
43
+ </div>
44
+ <div class="flex justify-between">
45
+ <span>Estimated Shipping</span>
46
+ <span class="text-emerald-400 font-semibold">{shipping === 0 ? 'FREE' : `$${shipping.toFixed(2)}`}</span>
47
+ </div>
48
+ <div class="pt-3 border-t border-slate-800 flex justify-between text-sm text-white font-bold">
49
+ <span>Total</span>
50
+ <span class="text-emerald-400 text-base font-black">${total.toFixed(2)}</span>
51
+ </div>
52
+ </div>
53
+
54
+ <form action="/api/checkout" method="POST">
55
+ <button
56
+ type="submit"
57
+ class="w-full py-3 rounded-xl bg-emerald-500 text-slate-950 font-bold text-sm hover:bg-emerald-400 transition-colors shadow-lg shadow-emerald-500/20"
58
+ >
59
+ Proceed to Checkout &rarr;
60
+ </button>
61
+ </form>
62
+ </div>
63
+ );
64
+ }
@@ -0,0 +1,16 @@
1
+ export function Footer() {
2
+ return (
3
+ <footer class="border-t border-slate-900 bg-slate-950/60 py-8 text-center text-xs text-slate-500">
4
+ <div class="max-w-6xl mx-auto px-6 flex flex-col sm:flex-row items-center justify-between gap-4">
5
+ <div>
6
+ FrootStore &copy; {new Date().getFullYear()} OrbitNorth LLC. MIT Licensed.
7
+ </div>
8
+ <div class="flex items-center gap-6">
9
+ <a href="https://github.com/orbitnorth/frootkit" class="hover:text-slate-400 transition-colors">GitHub</a>
10
+ <a href="https://frootjs.org" class="hover:text-slate-400 transition-colors">Documentation</a>
11
+ <a href="/api/products" class="hover:text-slate-400 transition-colors">Products API</a>
12
+ </div>
13
+ </div>
14
+ </footer>
15
+ );
16
+ }
@@ -0,0 +1,32 @@
1
+ export function Navbar() {
2
+ return (
3
+ <header class="border-b border-slate-800/80 bg-slate-950/70 backdrop-blur-md sticky top-0 z-50">
4
+ <div class="max-w-6xl mx-auto px-6 h-16 flex items-center justify-between">
5
+ <a href="/" class="flex items-center gap-3 font-extrabold text-white text-lg tracking-tight hover:opacity-90">
6
+ <span class="w-8 h-8 rounded-xl bg-gradient-to-tr from-emerald-500 to-teal-400 flex items-center justify-center text-slate-950 font-black text-sm">
7
+ 🛒
8
+ </span>
9
+ <span>Froot<span class="text-emerald-400">Store</span></span>
10
+ </a>
11
+
12
+ <nav class="flex items-center gap-6 text-sm font-medium">
13
+ <a href="/" class="text-slate-300 hover:text-white transition-colors">
14
+ Catalog
15
+ </a>
16
+ <a href="/api/products" class="text-slate-400 hover:text-emerald-400 font-mono text-xs px-2 py-1 rounded bg-slate-900 border border-slate-800 transition-colors">
17
+ /api/products
18
+ </a>
19
+ <a
20
+ href="/cart"
21
+ class="flex items-center gap-2 px-3.5 py-1.5 rounded-xl bg-slate-900 border border-slate-800 text-slate-200 hover:border-emerald-500/50 hover:text-emerald-400 transition-all font-semibold text-xs"
22
+ >
23
+ <span>Cart</span>
24
+ <span class="w-5 h-5 rounded-full bg-emerald-500 text-slate-950 flex items-center justify-center font-bold text-[10px]">
25
+ 2
26
+ </span>
27
+ </a>
28
+ </nav>
29
+ </div>
30
+ </header>
31
+ );
32
+ }
@@ -0,0 +1,52 @@
1
+ import type { Product } from '../data/products.js';
2
+
3
+ export function ProductCard({ product }: { product: Product }) {
4
+ return (
5
+ <div class="rounded-2xl border border-slate-800/80 bg-slate-900/30 overflow-hidden backdrop-blur-sm hover:border-emerald-500/40 transition-all hover:-translate-y-1 group flex flex-col justify-between">
6
+ <a href={`/products/${product.id}`} class="block relative aspect-[4/3] overflow-hidden bg-slate-950">
7
+ <img
8
+ src={product.image}
9
+ alt={product.name}
10
+ class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"
11
+ loading="lazy"
12
+ />
13
+ <span class="absolute top-3 right-3 px-2 py-0.5 rounded-full bg-slate-950/80 backdrop-blur-md text-[11px] font-mono text-slate-300 border border-slate-700/60">
14
+ {product.category}
15
+ </span>
16
+ </a>
17
+
18
+ <div class="p-5 flex-1 flex flex-col justify-between">
19
+ <div>
20
+ <div class="flex items-center gap-1.5 mb-2 text-xs">
21
+ <span class="text-amber-400 font-bold">&#9733; {product.rating}</span>
22
+ <span class="text-slate-500">({product.reviewsCount})</span>
23
+ </div>
24
+
25
+ <h3 class="font-bold text-white text-base mb-2 group-hover:text-emerald-400 transition-colors line-clamp-1">
26
+ <a href={`/products/${product.id}`}>
27
+ {product.name}
28
+ </a>
29
+ </h3>
30
+
31
+ <p class="text-slate-400 text-xs leading-relaxed mb-4 line-clamp-2">
32
+ {product.description}
33
+ </p>
34
+ </div>
35
+
36
+ <div class="pt-4 border-t border-slate-800/60 flex items-center justify-between">
37
+ <div>
38
+ <span class="text-xs text-slate-500 block">Price</span>
39
+ <span class="text-lg font-black text-white">${product.price.toFixed(2)}</span>
40
+ </div>
41
+
42
+ <a
43
+ href={`/products/${product.id}`}
44
+ class="px-3.5 py-2 rounded-xl bg-emerald-500 text-slate-950 font-bold text-xs hover:bg-emerald-400 transition-colors shadow-md shadow-emerald-500/10"
45
+ >
46
+ View Details
47
+ </a>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ );
52
+ }
@@ -0,0 +1,87 @@
1
+ export interface Product {
2
+ id: string;
3
+ name: string;
4
+ price: number;
5
+ category: string;
6
+ rating: number;
7
+ reviewsCount: number;
8
+ image: string;
9
+ description: string;
10
+ features: string[];
11
+ inStock: boolean;
12
+ }
13
+
14
+ export const PRODUCTS: Product[] = [
15
+ {
16
+ id: 'nordic-mechanical-keyboard',
17
+ name: 'Nordic Minimal Mechanical Keyboard',
18
+ price: 149.0,
19
+ category: 'Keyboards',
20
+ rating: 4.9,
21
+ reviewsCount: 128,
22
+ image: 'https://images.unsplash.com/photo-1587829741301-dc798b83add3?w=600&h=450&fit=crop',
23
+ description: 'Aircraft-grade anodized aluminum body with custom hot-swappable linear switches and sound-dampening silicone base.',
24
+ features: ['Hot-swappable switches', 'Bluetooth 5.3 & 2.4GHz', 'CNC Aluminum Chassis', 'PBT Dye-Sub Keycaps'],
25
+ inStock: true,
26
+ },
27
+ {
28
+ id: 'studio-monitor-headphones',
29
+ name: 'Studio Master Pro Headphones',
30
+ price: 289.0,
31
+ category: 'Audio',
32
+ rating: 4.8,
33
+ reviewsCount: 94,
34
+ image: 'https://images.unsplash.com/photo-1505740420928-5e560c06d30e?w=600&h=450&fit=crop',
35
+ description: 'Precision 50mm dynamic drivers engineered for ultra-flat frequency response, critical mixing, and executive focus.',
36
+ features: ['Planar Magnetic Sound', 'Memory Foam Cushions', 'Detachable Silver Cable', 'Hard Travel Case'],
37
+ inStock: true,
38
+ },
39
+ {
40
+ id: 'ergo-master-mouse',
41
+ name: 'ErgoMaster Wireless Precision Mouse',
42
+ price: 89.0,
43
+ category: 'Peripherals',
44
+ rating: 4.7,
45
+ reviewsCount: 210,
46
+ image: 'https://images.unsplash.com/photo-1527864550417-7fd91fc51a46?w=600&h=450&fit=crop',
47
+ description: 'Sculpted ergonomic contour designed to eliminate wrist fatigue during extended development sessions.',
48
+ features: ['26,000 DPI Optical Sensor', '70-day Battery Life', 'Infinite Scroll Wheel', 'Quiet Click Switches'],
49
+ inStock: true,
50
+ },
51
+ {
52
+ id: 'walnut-monitor-riser',
53
+ name: 'Solid Walnut Monitor Riser Stand',
54
+ price: 119.0,
55
+ category: 'Desk Setup',
56
+ rating: 5.0,
57
+ reviewsCount: 62,
58
+ image: 'https://images.unsplash.com/photo-1526738549149-8e07eca6c147?w=600&h=450&fit=crop',
59
+ description: 'Handcrafted from single-origin American walnut with cork feet and an integrated aluminum tray for accessories.',
60
+ features: ['Sustainable American Walnut', 'Holds up to 60 lbs', 'Integrated Cable Troughs', 'Hand-finished Matte Oil'],
61
+ inStock: true,
62
+ },
63
+ {
64
+ id: 'titanium-desk-pad',
65
+ name: 'Matte Slate Vegan Leather Desk Mat',
66
+ price: 49.0,
67
+ category: 'Desk Setup',
68
+ rating: 4.6,
69
+ reviewsCount: 175,
70
+ image: 'https://images.unsplash.com/photo-1544816155-12df9643f363?w=600&h=450&fit=crop',
71
+ description: 'Water-resistant, stain-proof premium desk surface that provides effortless mouse tracking and protects your workspace.',
72
+ features: ['Water-resistant PU Leather', 'Anti-slip Suede Backing', '90cm x 45cm Large Size', 'Easy to Clean'],
73
+ inStock: true,
74
+ },
75
+ {
76
+ id: 'usb-c-magnetic-cable',
77
+ name: '240W Braided Kevlar Charging Cable',
78
+ price: 29.0,
79
+ category: 'Accessories',
80
+ rating: 4.9,
81
+ reviewsCount: 340,
82
+ image: 'https://images.unsplash.com/photo-1583863788434-e58a36330cf0?w=600&h=450&fit=crop',
83
+ description: 'Ultra-durable Kevlar-reinforced charging cable supporting up to 240W Power Delivery and 40Gbps Thunderbolt data transfer.',
84
+ features: ['240W Power Delivery', 'E-Marker Smart Chip', 'Braided Kevlar Weave', '2-meter Length'],
85
+ inStock: true,
86
+ },
87
+ ];
@@ -0,0 +1,19 @@
1
+ @import "tailwindcss";
2
+
3
+ @theme {
4
+ --color-brand-50: #ecfdf5;
5
+ --color-brand-100: #d1fae5;
6
+ --color-brand-200: #a7f3d0;
7
+ --color-brand-300: #6ee7b7;
8
+ --color-brand-400: #34d399;
9
+ --color-brand-500: #10b981;
10
+ --color-brand-600: #059669;
11
+ --color-brand-700: #047857;
12
+ --color-brand-800: #065f46;
13
+ --color-brand-900: #064e3b;
14
+ --color-brand-950: #022c22;
15
+ }
16
+
17
+ :root {
18
+ color-scheme: dark;
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2024",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "preact",
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "noEmit": true
11
+ },
12
+ "include": ["src/**/*"]
13
+ }
@@ -0,0 +1,10 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ A minimal blank canvas created with **FrootKit**.
4
+
5
+ ## 🚀 Quick Start
6
+
7
+ ```bash
8
+ pnpm install
9
+ pnpm dev
10
+ ```
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "frootkit dev",
7
+ "build": "frootkit build",
8
+ "start": "frootkit start"
9
+ },
10
+ "dependencies": {
11
+ "frootkit": "npm:froot-kit@^1.3.1",
12
+ "froot-kit": "^1.3.1",
13
+ "frootjs": "^1.0.6",
14
+ "preact": "^11.1.0",
15
+ "preact-render-to-string": "^6.8.2"
16
+ },
17
+ "devDependencies": {
18
+ "@tailwindcss/cli": "^4.0.0",
19
+ "tailwindcss": "^4.0.0",
20
+ "@types/node": "^22.10.0",
21
+ "tsx": "^4.19.2",
22
+ "typescript": "^5.8.0"
23
+ }
24
+ }
@@ -0,0 +1,29 @@
1
+ import type { ComponentChildren } from 'preact';
2
+
3
+ export interface RootLayoutProps {
4
+ children: ComponentChildren;
5
+ metadata?: {
6
+ title?: string;
7
+ description?: string;
8
+ };
9
+ }
10
+
11
+ export default function RootLayout({ children, metadata }: RootLayoutProps) {
12
+ const title = metadata?.title || 'FrootKit App';
13
+ const description = metadata?.description || 'Built with FrootKit & Preact';
14
+
15
+ return (
16
+ <html lang="en" class="dark">
17
+ <head>
18
+ <meta charSet="UTF-8" />
19
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
20
+ <title>{title}</title>
21
+ <meta name="description" content={description} />
22
+ <link rel="stylesheet" href="/styles.css" />
23
+ </head>
24
+ <body class="bg-slate-950 text-slate-100 min-h-screen antialiased">
25
+ {children}
26
+ </body>
27
+ </html>
28
+ );
29
+ }
@@ -0,0 +1,38 @@
1
+ export const metadata = {
2
+ title: 'Blank Canvas — FrootKit',
3
+ description: 'Minimal blank project with Preact and Tailwind CSS v4.',
4
+ };
5
+
6
+ export default function HomePage() {
7
+ return (
8
+ <main class="min-h-screen flex items-center justify-center p-6">
9
+ <div class="max-w-md w-full text-center border border-slate-800 bg-slate-900/40 rounded-2xl p-8 backdrop-blur-sm">
10
+ <div class="w-12 h-12 rounded-xl bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-center mx-auto mb-4 text-emerald-400 font-bold text-xl">
11
+ F
12
+ </div>
13
+ <h1 class="text-2xl font-bold text-white mb-2">Blank Slate</h1>
14
+ <p class="text-slate-400 text-sm mb-6">
15
+ Edit <code class="font-mono text-emerald-400 bg-slate-800/80 px-1.5 py-0.5 rounded">src/app/page.tsx</code> to get started.
16
+ </p>
17
+ <div class="flex justify-center gap-3 text-xs font-medium">
18
+ <a
19
+ href="https://frootjs.org"
20
+ target="_blank"
21
+ rel="noreferrer"
22
+ class="px-4 py-2 rounded-lg bg-emerald-500 text-slate-950 font-bold hover:bg-emerald-400 transition-colors"
23
+ >
24
+ Docs
25
+ </a>
26
+ <a
27
+ href="https://github.com/orbitnorth/frootkit"
28
+ target="_blank"
29
+ rel="noreferrer"
30
+ class="px-4 py-2 rounded-lg bg-slate-800 text-slate-200 hover:bg-slate-700 transition-colors"
31
+ >
32
+ GitHub
33
+ </a>
34
+ </div>
35
+ </div>
36
+ </main>
37
+ );
38
+ }
@@ -0,0 +1,19 @@
1
+ @import "tailwindcss";
2
+
3
+ @theme {
4
+ --color-brand-50: #ecfdf5;
5
+ --color-brand-100: #d1fae5;
6
+ --color-brand-200: #a7f3d0;
7
+ --color-brand-300: #6ee7b7;
8
+ --color-brand-400: #34d399;
9
+ --color-brand-500: #10b981;
10
+ --color-brand-600: #059669;
11
+ --color-brand-700: #047857;
12
+ --color-brand-800: #065f46;
13
+ --color-brand-900: #064e3b;
14
+ --color-brand-950: #022c22;
15
+ }
16
+
17
+ :root {
18
+ color-scheme: dark;
19
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2024",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "jsx": "react-jsx",
7
+ "jsxImportSource": "preact",
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "noEmit": true
11
+ },
12
+ "include": ["src/**/*"]
13
+ }
@@ -0,0 +1,22 @@
1
+ # {{PROJECT_NAME}}
2
+
3
+ Scaffolded with **FrootKit** (Next.js Alternative for Preact).
4
+
5
+ ## 🚀 Quick Start
6
+
7
+ ```bash
8
+ # 1. Install dependencies
9
+ pnpm install
10
+
11
+ # 2. Start development server
12
+ pnpm dev
13
+ ```
14
+
15
+ Open [http://localhost:3000](http://localhost:3000) in your browser.
16
+
17
+ ## 📦 Features
18
+
19
+ - **Sub-millisecond Preact SSR**
20
+ - **Native Tailwind CSS v4**
21
+ - **File-based Routing & API Routes**
22
+ - **Zero-config Static Site Export (`pnpm build`)**
@@ -0,0 +1,24 @@
1
+ {
2
+ "name": "{{PROJECT_NAME}}",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "scripts": {
6
+ "dev": "frootkit dev",
7
+ "build": "frootkit build",
8
+ "start": "frootkit start"
9
+ },
10
+ "dependencies": {
11
+ "frootkit": "npm:froot-kit@^1.3.1",
12
+ "froot-kit": "^1.3.1",
13
+ "frootjs": "^1.0.6",
14
+ "preact": "^11.1.0",
15
+ "preact-render-to-string": "^6.8.2"
16
+ },
17
+ "devDependencies": {
18
+ "@tailwindcss/cli": "^4.0.0",
19
+ "tailwindcss": "^4.0.0",
20
+ "@types/node": "^22.10.0",
21
+ "tsx": "^4.19.2",
22
+ "typescript": "^5.8.0"
23
+ }
24
+ }
@@ -0,0 +1,23 @@
1
+ export async function GET(req: Request): Promise<Response> {
2
+ const url = new URL(req.url);
3
+
4
+ return Response.json(
5
+ {
6
+ status: 'healthy',
7
+ framework: 'FrootKit',
8
+ version: '1.3.1',
9
+ engine: 'Preact SSR + Monomorphic V8 Router',
10
+ timestamp: new Date().toISOString(),
11
+ uptimeSeconds: Math.floor(process.uptime()),
12
+ nodeVersion: process.version,
13
+ query: Object.fromEntries(url.searchParams.entries()),
14
+ },
15
+ {
16
+ status: 200,
17
+ headers: {
18
+ 'content-type': 'application/json',
19
+ 'cache-control': 'no-cache',
20
+ },
21
+ }
22
+ );
23
+ }
@@ -0,0 +1,31 @@
1
+ import type { ComponentChildren } from 'preact';
2
+
3
+ export interface RootLayoutProps {
4
+ children: ComponentChildren;
5
+ metadata?: {
6
+ title?: string;
7
+ description?: string;
8
+ };
9
+ }
10
+
11
+ export default function RootLayout({ children, metadata }: RootLayoutProps) {
12
+ const title = metadata?.title || 'FrootKit — The Next.js Alternative for Preact';
13
+ const description =
14
+ metadata?.description ||
15
+ 'High-performance fullstack web application powered by Preact SSR, nested layouts, Tailwind CSS v4, and dynamic API routes.';
16
+
17
+ return (
18
+ <html lang="en" class="dark scroll-smooth">
19
+ <head>
20
+ <meta charSet="UTF-8" />
21
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
22
+ <title>{title}</title>
23
+ <meta name="description" content={description} />
24
+ <link rel="stylesheet" href="/styles.css" />
25
+ </head>
26
+ <body class="bg-[#030712] text-slate-100 min-h-screen antialiased selection:bg-emerald-500/20 selection:text-emerald-300">
27
+ {children}
28
+ </body>
29
+ </html>
30
+ );
31
+ }