Skip to content

Kirimase Init 3. Add shadcnui #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: kirimase@0.57.0_init_bun_None_drizzle_Postgres_Postgre.JS_None_None
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=postgres://postgres:postgres@localhost:5432/{DB_NAME}
Binary file added bun.lockb
Binary file not shown.
16 changes: 16 additions & 0 deletions components.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://ui.shadcn.com/schema.json",
"style": "default",
"rsc": true,
"tsx": true,
"tailwind": {
"config": "tailwind.config.ts",
"css": "src/app/globals.css",
"baseColor": "neutral",
"cssVariables": true
},
"aliases": {
"components": "@/components",
"utils": "@/lib/utils"
}
}
11 changes: 11 additions & 0 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { Config } from "drizzle-kit";
import { env } from "@/lib/env.mjs";

export default {
schema: "./src/lib/db/schema",
out: "./src/lib/db/migrations",
driver: "pg",
dbCredentials: {
connectionString: env.DATABASE_URL,
}
} satisfies Config;
17 changes: 17 additions & 0 deletions kirimase.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"hasSrc": true,
"packages": [
"shadcn-ui",
"drizzle"
],
"preferredPackageManager": "bun",
"t3": false,
"alias": "@",
"analytics": true,
"rootPath": "src/",
"componentLib": "shadcn-ui",
"driver": "pg",
"provider": "postgresjs",
"orm": "drizzle",
"auth": null
}
39 changes: 33 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,49 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"db:generate": "drizzle-kit generate:pg",
"db:migrate": "tsx src/lib/db/migrate.ts",
"db:drop": "drizzle-kit drop",
"db:pull": "drizzle-kit introspect:pg",
"db:studio": "drizzle-kit studio",
"db:check": "drizzle-kit check:pg"
},
"dependencies": {
"@radix-ui/react-avatar": "^1.0.4",
"@radix-ui/react-dropdown-menu": "^2.0.6",
"@radix-ui/react-label": "^2.0.2",
"@radix-ui/react-slot": "^1.0.2",
"@t3-oss/env-nextjs": "^0.9.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"drizzle-orm": "^0.30.2",
"drizzle-zod": "^0.5.1",
"lucide-react": "^0.358.0",
"nanoid": "^5.0.6",
"next": "14.1.3",
"next-themes": "^0.3.0",
"postgres": "^3.4.3",
"react": "^18",
"react-dom": "^18",
"next": "14.1.3"
"sonner": "^1.4.3",
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.22.4"
},
"devDependencies": {
"typescript": "^5",
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"autoprefixer": "^10.0.1",
"dotenv": "^16.4.5",
"drizzle-kit": "^0.20.14",
"eslint": "^8",
"eslint-config-next": "14.1.3",
"pg": "^8.11.3",
"postcss": "^8",
"tailwindcss": "^3.3.0",
"eslint": "^8",
"eslint-config-next": "14.1.3"
"tsx": "^4.7.1",
"typescript": "^5"
}
}
}
10 changes: 10 additions & 0 deletions src/app/(app)/dashboard/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export default function Home() {
return (
<main>
<h1 className="font-semibold text-2xl">Home</h1>
<p className="my-2">
Wow, that was easy. Now it&apos;s your turn. Building something cool!
</p>
</main>
);
}
18 changes: 18 additions & 0 deletions src/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { Toaster } from "@/components/ui/sonner";
import Navbar from "@/components/Navbar";
import Sidebar from "@/components/Sidebar";
export default async function AppLayout({
children,
}: {
children: React.ReactNode;
}) {
return ( <main><div className="flex h-screen">
<Sidebar />
<main className="flex-1 md:p-8 pt-2 p-8 overflow-y-auto">
<Navbar />
{children}
</main>
</div>
<Toaster richColors />
</main> )
}
106 changes: 106 additions & 0 deletions src/app/(app)/settings/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"use client";

import { Button } from "@/components/ui/button";
import { useTheme } from "next-themes";

export default function Page() {
const { setTheme } = useTheme();
return (
<div>
<h1 className="text-2xl font-semibold">Settings</h1>
<div className="space-y-4 my-4">
<div>
<h3 className="text-lg font-medium">Appearance</h3>
<p className="text-sm text-muted-foreground">
Customize the appearance of the app. Automatically switch between
day and night themes.
</p>
</div>
<Button
asChild
variant={"ghost"}
className="w-fit h-fit"
onClick={() => setTheme("light")}
>
<div className="flex flex-col">
<div className="items-center rounded-md border-2 border-muted p-1 hover:border-accent">
<div className="space-y-2 rounded-sm bg-[#ecedef] p-2">
<div className="space-y-2 rounded-md bg-white p-2 shadow-sm">
<div className="h-2 w-[80px] rounded-lg bg-[#ecedef]" />
<div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" />
</div>
<div className="flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm">
<div className="h-4 w-4 rounded-full bg-[#ecedef]" />
<div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" />
</div>
<div className="flex items-center space-x-2 rounded-md bg-white p-2 shadow-sm">
<div className="h-4 w-4 rounded-full bg-[#ecedef]" />
<div className="h-2 w-[100px] rounded-lg bg-[#ecedef]" />
</div>
</div>
</div>
<span className="block w-full p-2 text-center font-normal">
Light
</span>
</div>
</Button>
<Button
asChild
variant={"ghost"}
onClick={() => setTheme("dark")}
className="w-fit h-fit"
>
<div className="flex flex-col">
<div className="items-center rounded-md border-2 border-muted bg-popover p-1 hover:bg-accent hover:text-accent-foreground">
<div className="space-y-2 rounded-sm bg-neutral-950 p-2">
<div className="space-y-2 rounded-md bg-neutral-800 p-2 shadow-sm">
<div className="h-2 w-[80px] rounded-lg bg-neutral-400" />
<div className="h-2 w-[100px] rounded-lg bg-neutral-400" />
</div>
<div className="flex items-center space-x-2 rounded-md bg-neutral-800 p-2 shadow-sm">
<div className="h-4 w-4 rounded-full bg-neutral-400" />
<div className="h-2 w-[100px] rounded-lg bg-neutral-400" />
</div>
<div className="flex items-center space-x-2 rounded-md bg-neutral-800 p-2 shadow-sm">
<div className="h-4 w-4 rounded-full bg-neutral-400" />
<div className="h-2 w-[100px] rounded-lg bg-neutral-400" />
</div>
</div>
</div>
<span className="block w-full p-2 text-center font-normal">
Dark
</span>
</div>
</Button>
<Button
asChild
variant={"ghost"}
onClick={() => setTheme("system")}
className="w-fit h-fit"
>
<div className="flex flex-col">
<div className="items-center rounded-md border-2 border-muted bg-popover p-1 hover:bg-accent hover:text-accent-foreground">
<div className="space-y-2 rounded-sm bg-neutral-300 p-2">
<div className="space-y-2 rounded-md bg-neutral-600 p-2 shadow-sm">
<div className="h-2 w-[80px] rounded-lg bg-neutral-400" />
<div className="h-2 w-[100px] rounded-lg bg-neutral-400" />
</div>
<div className="flex items-center space-x-2 rounded-md bg-neutral-600 p-2 shadow-sm">
<div className="h-4 w-4 rounded-full bg-neutral-400" />
<div className="h-2 w-[100px] rounded-lg bg-neutral-400" />
</div>
<div className="flex items-center space-x-2 rounded-md bg-neutral-600 p-2 shadow-sm">
<div className="h-4 w-4 rounded-full bg-neutral-400" />
<div className="h-2 w-[100px] rounded-lg bg-neutral-400" />
</div>
</div>
</div>
<span className="block w-full p-2 text-center font-normal">
System
</span>
</div>
</Button>
</div>
</div>
);
}
91 changes: 67 additions & 24 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,76 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
:root {
--background: 0 0% 100%;
--foreground: 0 0% 3.9%;

:root {
--foreground-rgb: 0, 0, 0;
--background-start-rgb: 214, 219, 220;
--background-end-rgb: 255, 255, 255;
}
--card: 0 0% 100%;
--card-foreground: 0 0% 3.9%;

--popover: 0 0% 100%;
--popover-foreground: 0 0% 3.9%;

--primary: 0 0% 9%;
--primary-foreground: 0 0% 98%;

--secondary: 0 0% 96.1%;
--secondary-foreground: 0 0% 9%;

--muted: 0 0% 96.1%;
--muted-foreground: 0 0% 45.1%;

--accent: 0 0% 96.1%;
--accent-foreground: 0 0% 9%;

--destructive: 0 84.2% 60.2%;
--destructive-foreground: 0 0% 98%;

@media (prefers-color-scheme: dark) {
:root {
--foreground-rgb: 255, 255, 255;
--background-start-rgb: 0, 0, 0;
--background-end-rgb: 0, 0, 0;
--border: 0 0% 89.8%;
--input: 0 0% 89.8%;
--ring: 0 0% 3.9%;

--radius: 0.5rem;
}

.dark {
--background: 0 0% 3.9%;
--foreground: 0 0% 98%;

--card: 0 0% 3.9%;
--card-foreground: 0 0% 98%;

--popover: 0 0% 3.9%;
--popover-foreground: 0 0% 98%;

--primary: 0 0% 98%;
--primary-foreground: 0 0% 9%;

--secondary: 0 0% 14.9%;
--secondary-foreground: 0 0% 98%;

--muted: 0 0% 14.9%;
--muted-foreground: 0 0% 63.9%;

--accent: 0 0% 14.9%;
--accent-foreground: 0 0% 98%;

--destructive: 0 62.8% 30.6%;
--destructive-foreground: 0 0% 98%;

--border: 0 0% 14.9%;
--input: 0 0% 14.9%;
--ring: 0 0% 83.1%;
}
}

body {
color: rgb(var(--foreground-rgb));
background: linear-gradient(
to bottom,
transparent,
rgb(var(--background-end-rgb))
)
rgb(var(--background-start-rgb));
}

@layer utilities {
.text-balance {
text-wrap: balance;

@layer base {
* {
@apply border-border;
}
body {
@apply bg-background text-foreground;
}
}
5 changes: 4 additions & 1 deletion src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "./globals.css";
import { ThemeProvider } from "@/components/ThemeProvider";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -16,7 +17,9 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="system" enableSystem disableTransitionOnChange>{children}</ThemeProvider>
</body>
</html>
);
}
25 changes: 25 additions & 0 deletions src/app/loading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
export default function Loading() {
return (
<div className="grid place-items-center animate-pulse text-neutral-300 p-4">
<div role="status">
<svg
aria-hidden="true"
className="w-8 h-8 text-neutral-200 dark:text-neutral-600 fill-neutral-600 animate-spin"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
/>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
/>
</svg>
<span className="sr-only">Loading...</span>
</div>
</div>
);
}
Loading