create-frootkit 1.1.4 → 1.2.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 +50 -16
- package/dist/addons/database.d.ts +3 -2
- package/dist/addons/database.d.ts.map +1 -1
- package/dist/addons/database.js +472 -13
- package/dist/addons/database.js.map +1 -1
- package/dist/index.js +93 -18
- package/dist/index.js.map +1 -1
- package/dist/scaffold.d.ts +1 -0
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +3 -3
- package/dist/scaffold.js.map +1 -1
- package/dist/template.d.ts +3 -5
- package/dist/template.d.ts.map +1 -1
- package/dist/template.js +47 -403
- package/dist/template.js.map +1 -1
- package/dist/templates/auth.d.ts +3 -0
- package/dist/templates/auth.d.ts.map +1 -0
- package/dist/templates/auth.js +487 -0
- package/dist/templates/auth.js.map +1 -0
- package/dist/templates/blog.d.ts +3 -0
- package/dist/templates/blog.d.ts.map +1 -0
- package/dist/templates/blog.js +369 -0
- package/dist/templates/blog.js.map +1 -0
- package/dist/templates/common.d.ts +5 -0
- package/dist/templates/common.d.ts.map +1 -0
- package/dist/templates/common.js +116 -0
- package/dist/templates/common.js.map +1 -0
- package/dist/templates/ecommerce.d.ts +3 -0
- package/dist/templates/ecommerce.d.ts.map +1 -0
- package/dist/templates/ecommerce.js +474 -0
- package/dist/templates/ecommerce.js.map +1 -0
- package/dist/templates/empty.d.ts +3 -0
- package/dist/templates/empty.d.ts.map +1 -0
- package/dist/templates/empty.js +85 -0
- package/dist/templates/empty.js.map +1 -0
- package/dist/templates/index.d.ts +16 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/templates/index.js +32 -0
- package/dist/templates/index.js.map +1 -0
- package/dist/templates/starter.d.ts +3 -0
- package/dist/templates/starter.d.ts.map +1 -0
- package/dist/templates/starter.js +308 -0
- package/dist/templates/starter.js.map +1 -0
- package/dist/templates/types.d.ts +13 -0
- package/dist/templates/types.d.ts.map +1 -0
- package/dist/templates/types.js +5 -0
- package/dist/templates/types.js.map +1 -0
- package/package.json +2 -1
- package/templates/auth/README.md +11 -0
- package/templates/auth/package.json +24 -0
- package/templates/auth/src/app/api/auth/route.ts +148 -0
- package/templates/auth/src/app/dashboard/layout.tsx +34 -0
- package/templates/auth/src/app/dashboard/page.tsx +72 -0
- package/templates/auth/src/app/layout.tsx +31 -0
- package/templates/auth/src/app/login/page.tsx +18 -0
- package/templates/auth/src/app/page.tsx +60 -0
- package/templates/auth/src/app/signup/page.tsx +18 -0
- package/templates/auth/src/components/AuthForm.tsx +77 -0
- package/templates/auth/src/components/DashboardNav.tsx +51 -0
- package/templates/auth/src/components/MetricCard.tsx +26 -0
- package/templates/auth/src/components/Navbar.tsx +29 -0
- package/templates/auth/src/lib/auth.ts +145 -0
- package/templates/auth/src/styles.css +19 -0
- package/templates/auth/tsconfig.json +13 -0
- package/templates/blog/README.md +11 -0
- package/templates/blog/package.json +24 -0
- package/templates/blog/src/app/api/posts/route.ts +36 -0
- package/templates/blog/src/app/blog/[slug]/page.tsx +74 -0
- package/templates/blog/src/app/layout.tsx +31 -0
- package/templates/blog/src/app/page.tsx +44 -0
- package/templates/blog/src/components/Footer.tsx +16 -0
- package/templates/blog/src/components/Navbar.tsx +31 -0
- package/templates/blog/src/components/Newsletter.tsx +32 -0
- package/templates/blog/src/components/PostCard.tsx +47 -0
- package/templates/blog/src/data/posts.ts +75 -0
- package/templates/blog/src/styles.css +19 -0
- package/templates/blog/tsconfig.json +13 -0
- package/templates/ecommerce/README.md +11 -0
- package/templates/ecommerce/package.json +24 -0
- package/templates/ecommerce/src/app/api/checkout/route.ts +19 -0
- package/templates/ecommerce/src/app/api/products/route.ts +28 -0
- package/templates/ecommerce/src/app/cart/page.tsx +22 -0
- package/templates/ecommerce/src/app/layout.tsx +31 -0
- package/templates/ecommerce/src/app/page.tsx +59 -0
- package/templates/ecommerce/src/app/products/[id]/page.tsx +88 -0
- package/templates/ecommerce/src/components/CartDrawer.tsx +64 -0
- package/templates/ecommerce/src/components/Footer.tsx +16 -0
- package/templates/ecommerce/src/components/Navbar.tsx +32 -0
- package/templates/ecommerce/src/components/ProductCard.tsx +52 -0
- package/templates/ecommerce/src/data/products.ts +87 -0
- package/templates/ecommerce/src/styles.css +19 -0
- package/templates/ecommerce/tsconfig.json +13 -0
- package/templates/empty/README.md +10 -0
- package/templates/empty/package.json +24 -0
- package/templates/empty/src/app/layout.tsx +29 -0
- package/templates/empty/src/app/page.tsx +38 -0
- package/templates/empty/src/styles.css +19 -0
- package/templates/empty/tsconfig.json +13 -0
- package/templates/starter/README.md +22 -0
- package/templates/starter/package.json +24 -0
- package/templates/starter/src/app/api/health/route.ts +23 -0
- package/templates/starter/src/app/layout.tsx +31 -0
- package/templates/starter/src/app/page.tsx +122 -0
- package/templates/starter/src/components/FeatureCard.tsx +25 -0
- package/templates/starter/src/components/Footer.tsx +16 -0
- package/templates/starter/src/components/Header.tsx +45 -0
- package/templates/starter/src/components/TerminalPreview.tsx +56 -0
- package/templates/starter/src/styles.css +19 -0
- package/templates/starter/tsconfig.json +13 -0
|
@@ -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">★ {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,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
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { Header } from '../components/Header.js';
|
|
2
|
+
import { FeatureCard } from '../components/FeatureCard.js';
|
|
3
|
+
import { TerminalPreview } from '../components/TerminalPreview.js';
|
|
4
|
+
import { Footer } from '../components/Footer.js';
|
|
5
|
+
|
|
6
|
+
export const metadata = {
|
|
7
|
+
title: 'FrootKit — Next.js Alternative for Preact & Froot',
|
|
8
|
+
description: 'Ultra-fast Preact SSR, nested layouts, native Tailwind CSS v4, and dynamic API routes.',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default function HomePage() {
|
|
12
|
+
const features = [
|
|
13
|
+
{
|
|
14
|
+
icon: '⚡',
|
|
15
|
+
badge: '0.1ms render',
|
|
16
|
+
title: 'Sub-Millisecond SSR',
|
|
17
|
+
description: 'Preact VNode streaming and monomorphic rendering ensure blistering speed with near-zero memory footprint.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
icon: '🎨',
|
|
21
|
+
badge: 'Tailwind v4',
|
|
22
|
+
title: 'Native CSS Pipeline',
|
|
23
|
+
description: 'Zero postcss.config.js or tailwind.config.js required. Tailwind CSS v4 is compiled instantly on every change.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
icon: '📁',
|
|
27
|
+
badge: 'App Router',
|
|
28
|
+
title: 'Nested Layouts',
|
|
29
|
+
description: 'Intuitive file-based routing with layout.tsx, page.tsx, and loading.tsx mirroring modern Next.js conventions.',
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
icon: '🔌',
|
|
33
|
+
badge: 'Fullstack API',
|
|
34
|
+
title: 'Route Handlers',
|
|
35
|
+
description: 'Build backend logic seamlessly in src/app/api/**/route.ts handling GET, POST, PUT, DELETE with standard Web APIs.',
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
icon: '📦',
|
|
39
|
+
badge: 'Static Export',
|
|
40
|
+
title: 'SSG & Edge Ready',
|
|
41
|
+
description: 'Run frootkit build to pre-render static HTML and bundle dynamic endpoints for serverless and edge clouds.',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
icon: '🤖',
|
|
45
|
+
badge: 'Agent Friendly',
|
|
46
|
+
title: 'AI Native Scaffolding',
|
|
47
|
+
description: 'Comes with pre-configured AGENT.md guidelines, strict TypeScript, and biome/eslint support.',
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
return (
|
|
52
|
+
<div class="min-h-screen flex flex-col justify-between">
|
|
53
|
+
{/* Background glow effects */}
|
|
54
|
+
<div class="fixed inset-0 overflow-hidden pointer-events-none -z-10">
|
|
55
|
+
<div class="absolute -top-40 left-1/2 -translate-x-1/2 w-[800px] h-[500px] bg-gradient-to-tr from-emerald-500/15 via-teal-500/10 to-cyan-500/5 blur-[120px] rounded-full" />
|
|
56
|
+
<div class="absolute top-1/2 -left-40 w-[600px] h-[400px] bg-emerald-600/10 blur-[140px] rounded-full" />
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<Header />
|
|
60
|
+
|
|
61
|
+
{/* Hero Section */}
|
|
62
|
+
<main class="max-w-6xl mx-auto px-6 py-16 sm:py-24 flex-1 flex flex-col justify-center">
|
|
63
|
+
<div class="text-center max-w-3xl mx-auto mb-16">
|
|
64
|
+
<div class="inline-flex items-center gap-2 px-3.5 py-1.5 rounded-full bg-emerald-500/10 border border-emerald-500/25 text-xs font-semibold text-emerald-400 mb-8 shadow-sm shadow-emerald-950">
|
|
65
|
+
<span class="w-1.5 h-1.5 rounded-full bg-emerald-400" />
|
|
66
|
+
Next.js App Router Conventions • Zero Overhead
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
<h1 class="text-4xl sm:text-6xl md:text-7xl font-extrabold text-white tracking-tight mb-6 leading-tight sm:leading-none">
|
|
70
|
+
The Next.js Alternative Built for{' '}
|
|
71
|
+
<span class="bg-gradient-to-r from-emerald-400 via-teal-300 to-cyan-400 bg-clip-text text-transparent">
|
|
72
|
+
Speed & Simplicity
|
|
73
|
+
</span>
|
|
74
|
+
</h1>
|
|
75
|
+
|
|
76
|
+
<p class="text-slate-300 text-lg sm:text-xl leading-relaxed mb-10 max-w-2xl mx-auto">
|
|
77
|
+
Sub-millisecond Preact SSR, nested file-based layouts, native Tailwind CSS v4, instant static site export, and built-in API routes.
|
|
78
|
+
</p>
|
|
79
|
+
|
|
80
|
+
<div class="flex flex-wrap items-center justify-center gap-4">
|
|
81
|
+
<a
|
|
82
|
+
href="https://frootjs.org"
|
|
83
|
+
target="_blank"
|
|
84
|
+
rel="noreferrer"
|
|
85
|
+
class="px-6 py-3 rounded-xl bg-emerald-500 text-slate-950 font-bold hover:bg-emerald-400 transition-all shadow-lg shadow-emerald-500/25 hover:shadow-emerald-500/40 hover:-translate-y-0.5"
|
|
86
|
+
>
|
|
87
|
+
Explore Documentation →
|
|
88
|
+
</a>
|
|
89
|
+
<a
|
|
90
|
+
href="https://github.com/orbitnorth/frootkit"
|
|
91
|
+
target="_blank"
|
|
92
|
+
rel="noreferrer"
|
|
93
|
+
class="px-6 py-3 rounded-xl bg-slate-900 border border-slate-800 text-slate-200 font-semibold hover:bg-slate-800/80 hover:border-slate-700 transition-all hover:-translate-y-0.5 flex items-center gap-2"
|
|
94
|
+
>
|
|
95
|
+
<svg class="w-4 h-4 fill-current text-slate-300" viewBox="0 0 24 24">
|
|
96
|
+
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
|
|
97
|
+
</svg>
|
|
98
|
+
Star on GitHub
|
|
99
|
+
</a>
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
|
|
103
|
+
<TerminalPreview />
|
|
104
|
+
|
|
105
|
+
{/* Feature Grid */}
|
|
106
|
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
|
|
107
|
+
{features.map((f) => (
|
|
108
|
+
<FeatureCard
|
|
109
|
+
key={f.title}
|
|
110
|
+
icon={f.icon}
|
|
111
|
+
badge={f.badge}
|
|
112
|
+
title={f.title}
|
|
113
|
+
description={f.description}
|
|
114
|
+
/>
|
|
115
|
+
))}
|
|
116
|
+
</div>
|
|
117
|
+
</main>
|
|
118
|
+
|
|
119
|
+
<Footer />
|
|
120
|
+
</div>
|
|
121
|
+
);
|
|
122
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface FeatureCardProps {
|
|
2
|
+
icon: string;
|
|
3
|
+
badge: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export function FeatureCard({ icon, badge, title, description }: FeatureCardProps) {
|
|
9
|
+
return (
|
|
10
|
+
<div class="rounded-2xl border border-slate-800/80 bg-slate-900/30 p-6 backdrop-blur-sm hover:border-emerald-500/40 transition-all hover:-translate-y-1 group">
|
|
11
|
+
<div class="flex items-center justify-between mb-4">
|
|
12
|
+
<span class="text-3xl">{icon}</span>
|
|
13
|
+
<span class="text-xs font-mono font-medium px-2 py-0.5 rounded-full bg-slate-800 text-slate-300 border border-slate-700/60 group-hover:border-emerald-500/40 transition-colors">
|
|
14
|
+
{badge}
|
|
15
|
+
</span>
|
|
16
|
+
</div>
|
|
17
|
+
<h3 class="text-lg font-bold text-white mb-2 group-hover:text-emerald-400 transition-colors">
|
|
18
|
+
{title}
|
|
19
|
+
</h3>
|
|
20
|
+
<p class="text-slate-400 text-sm leading-relaxed">
|
|
21
|
+
{description}
|
|
22
|
+
</p>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -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
|
+
FrootKit © {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/health" class="hover:text-slate-400 transition-colors">Health API</a>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</footer>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function Header() {
|
|
2
|
+
return (
|
|
3
|
+
<header class="border-b border-slate-800/80 bg-slate-950/40 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
|
+
<div class="flex items-center gap-3">
|
|
6
|
+
<span class="text-emerald-400 font-extrabold text-xl tracking-tight flex items-center gap-2">
|
|
7
|
+
<span class="inline-block w-3 h-3 rounded-full bg-emerald-400 animate-pulse" />
|
|
8
|
+
FrootKit
|
|
9
|
+
</span>
|
|
10
|
+
<span class="px-2 py-0.5 text-[11px] font-mono font-medium rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">
|
|
11
|
+
v1.3.1
|
|
12
|
+
</span>
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<nav class="flex items-center gap-6 text-sm font-medium">
|
|
16
|
+
<a
|
|
17
|
+
href="https://frootjs.org"
|
|
18
|
+
target="_blank"
|
|
19
|
+
rel="noreferrer"
|
|
20
|
+
class="text-slate-300 hover:text-white transition-colors"
|
|
21
|
+
>
|
|
22
|
+
Docs
|
|
23
|
+
</a>
|
|
24
|
+
<a
|
|
25
|
+
href="/api/health"
|
|
26
|
+
class="text-slate-300 hover:text-emerald-400 transition-colors font-mono text-xs px-2.5 py-1 rounded-md bg-slate-900 border border-slate-800"
|
|
27
|
+
>
|
|
28
|
+
/api/health
|
|
29
|
+
</a>
|
|
30
|
+
<a
|
|
31
|
+
href="https://github.com/orbitnorth/frootkit"
|
|
32
|
+
target="_blank"
|
|
33
|
+
rel="noreferrer"
|
|
34
|
+
class="flex items-center gap-2 text-slate-300 hover:text-white transition-colors"
|
|
35
|
+
>
|
|
36
|
+
<svg class="w-4 h-4 fill-current" viewBox="0 0 24 24">
|
|
37
|
+
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z" />
|
|
38
|
+
</svg>
|
|
39
|
+
GitHub
|
|
40
|
+
</a>
|
|
41
|
+
</nav>
|
|
42
|
+
</div>
|
|
43
|
+
</header>
|
|
44
|
+
);
|
|
45
|
+
}
|