Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,503 changes: 2,279 additions & 224 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions starters/react-shadcn/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist
node_modules
3 changes: 3 additions & 0 deletions starters/react-shadcn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<br>

The official **[@fastify/react](https://github.com/fastify/fastify-vite/tree/dev/packages/fastify-react)** starter template.
21 changes: 21 additions & 0 deletions starters/react-shadcn/components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "new-york",
"rsc": false,
"tsx": true,
"tailwind": {
"config": "",
"css": "src/client/index.css",
"baseColor": "neutral",
"cssVariables": true,
"prefix": ""
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils",
"ui": "@/components/ui",
"lib": "@/lib",
"hooks": "@/hooks"
},
"iconLibrary": "lucide"
}
48 changes: 48 additions & 0 deletions starters/react-shadcn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"type": "module",
"scripts": {
"lint": "oxlint",
"dev": "tsx src/server.ts --dev",
"start": "NODE_ENV=production node dist/server.js",
"build": "pnpm build:client && pnpm build:server",
"build:server": "tsc",
"build:client": "NODE_ENV=production vite build",
"clean": "rm -rf dist tsconfig.tsbuildinfo"
},
"dependencies": {
"@fastify/formbody": "^8.0.2",
"@fastify/one-line-logger": "^2.0.2",
"@fastify/react": "^1.1.0",
"@fastify/vite": "^8.1.2",
"@radix-ui/react-select": "^2.2.4",
"@radix-ui/react-slot": "^1.2.2",
"@unhead/react": "^2.0.8",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"fastify": "^5.3.2",
"history": "^5.3.0",
"lucide-react": "^0.511.0",
"minipass": "^7.1.2",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^7.5.0",
"tailwind-merge": "^3.3.0",
"valtio": "^2.1.4"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.1",
"@tailwindcss/vite": "^4.1.2",
"@types/node": "^22.15.19",
"@types/react": "^19.1.2",
"@types/react-dom": "^19.1.2",
"@vitejs/plugin-react": "^4.3.4",
"oxlint": "^0.16.6",
"postcss": "^8.5.3",
"postcss-preset-env": "^10.1.5",
"tailwindcss": "^4.1.4",
"tsx": "^4.19.4",
"tw-animate-css": "^1.3.0",
"typescript": "^5.8.3",
"vite": "^6.2.4"
}
}
31 changes: 31 additions & 0 deletions starters/react-shadcn/src/client/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
182 changes: 182 additions & 0 deletions starters/react-shadcn/src/client/base.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@

html {
background: #222;
}
#root {
width: 800px;
margin: 0 auto;
padding: 2em;
box-shadow: 5px 5px 30px rgba(0,0,0,0.4);
border-radius: 10px;
background-color: rgba(255, 255, 255, 0.1);
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: var(--color-base);
margin-top: 60px;
& a {
color: var(--color-highlight);
text-decoration: none;
font-weight: bold;
border-bottom: 1px solid var(--color-highlight);
&:hover {
color: #ffde00;
}
&:active {
color: #eecf00
}
}
& p {
font-size: 1.2em;
}
& ul {
& li {
&:not(:last-child) {
margin-bottom: 0.5em;
}
break-inside: avoid;
font-size: 1em;
}
}
& code {
color: #ffde00;
font-weight: bold;
font-family: 'Consolas', 'Andale Mono', monospace;
font-size: 0.9em;
}
& img {
width: 14em;
}
}

/*button, input[type=button] {
margin: 0;
border: none;
box-shadow: none;
cursor: pointer;
color: #333;
font-size: 1.2em;
background: #ff80ff;
padding: 0.5em;
&:hover {
background: #ff5eff;
color: #000;
}
}*/

label {
margin: 0;
outline: none;
border: none;
box-shadow: none;
color: #fff;
font-size: 1.2em;
margin-right: 0.5em;
padding: 0.5em;
}

input {
margin: 0;
outline: none;
border: none;
box-shadow: none;
color: #333;
font-size: 1.2em;
background: #ccc;
margin-right: 0.5em;
border: 2px solid #ff80ff;
padding: calc(0.5em - 2px);
}

/*
---break---
*/

@theme inline {
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}

/*
---break---
*/

.dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.205 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.205 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.922 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.704 0.191 22.216);
--border: oklch(1 0 0 / 10%);
--input: oklch(1 0 0 / 15%);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(1 0 0 / 10%);
--sidebar-ring: oklch(0.556 0 0);
}

/*
---break---
*/

@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
}
59 changes: 59 additions & 0 deletions starters/react-shadcn/src/client/components/ui/button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import * as React from "react"
import { Slot } from "@radix-ui/react-slot"
import { cva, type VariantProps } from "class-variance-authority"

import { cn } from "@/lib/utils"

const buttonVariants = cva(
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
{
variants: {
variant: {
default:
"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",
destructive:
"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
outline:
"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
secondary:
"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",
ghost:
"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
link: "text-primary underline-offset-4 hover:underline",
},
size: {
default: "h-9 px-4 py-2 has-[>svg]:px-3",
sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
icon: "size-9",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
}
)

function Button({
className,
variant,
size,
asChild = false,
...props
}: React.ComponentProps<"button"> &
VariantProps<typeof buttonVariants> & {
asChild?: boolean
}) {
const Comp = asChild ? Slot : "button"

return (
<Comp
data-slot="button"
className={cn(buttonVariants({ variant, size, className }))}
{...props}
/>
)
}

export { Button, buttonVariants }
Loading