stackkit-cli 0.3.0 → 0.3.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.
- package/README.md +6 -0
- package/dist/commands/add.js +12 -4
- package/dist/commands/add.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/code-inject.js +1 -1
- package/dist/utils/code-inject.js.map +1 -1
- package/dist/utils/detect.d.ts.map +1 -1
- package/dist/utils/detect.js +45 -16
- package/dist/utils/detect.js.map +1 -1
- package/dist/utils/env-editor.d.ts.map +1 -1
- package/dist/utils/env-editor.js +2 -2
- package/dist/utils/env-editor.js.map +1 -1
- package/dist/utils/files.js +1 -1
- package/dist/utils/files.js.map +1 -1
- package/modules/auth/authjs-express/files/lib/auth.ts +40 -0
- package/modules/auth/authjs-express/files/routes/auth.ts +12 -0
- package/modules/auth/authjs-express/module.json +39 -0
- package/modules/auth/authjs-nextjs/files/api/auth/[...nextauth]/route.ts +3 -0
- package/modules/auth/authjs-nextjs/files/lib/auth.ts +43 -0
- package/modules/auth/authjs-nextjs/module.json +38 -0
- package/modules/auth/better-auth-express/files/lib/auth.ts +16 -0
- package/modules/auth/better-auth-express/files/routes/auth.ts +12 -0
- package/modules/auth/better-auth-express/module.json +38 -0
- package/modules/auth/better-auth-nextjs/files/api/auth/[...all]/route.ts +3 -0
- package/modules/auth/better-auth-nextjs/files/lib/auth.ts +18 -0
- package/modules/auth/better-auth-nextjs/module.json +38 -0
- package/modules/auth/better-auth-react/files/lib/auth-client.ts +9 -0
- package/modules/auth/better-auth-react/module.json +26 -0
- package/modules/database/prisma-mongodb/files/lib/db.ts +9 -0
- package/modules/database/prisma-mongodb/files/prisma/schema.prisma +17 -0
- package/modules/database/prisma-mongodb/module.json +36 -0
- package/modules/database/prisma-postgresql/files/lib/db.ts +9 -0
- package/modules/database/prisma-postgresql/files/prisma/schema.prisma +17 -0
- package/modules/database/prisma-postgresql/module.json +36 -0
- package/package.json +4 -4
- package/templates/auth/authjs-express/config.json +20 -0
- package/templates/auth/authjs-express/files/lib/auth.ts +43 -0
- package/templates/auth/authjs-express/files/routes/auth.ts +12 -0
- package/templates/auth/authjs-express/lib/auth.ts +43 -0
- package/templates/auth/authjs-express/module.json +39 -0
- package/templates/auth/authjs-express/routes/auth.ts +12 -0
- package/templates/auth/authjs-nextjs/app/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/auth/authjs-nextjs/config.json +19 -0
- package/templates/auth/authjs-nextjs/files/api/auth/[...nextauth]/route.ts +3 -0
- package/templates/auth/authjs-nextjs/files/lib/auth.ts +45 -0
- package/templates/auth/authjs-nextjs/lib/auth.ts +45 -0
- package/templates/auth/authjs-nextjs/module.json +38 -0
- package/templates/auth/better-auth-react/config.json +15 -0
- package/templates/auth/better-auth-react/files/lib/auth-client.ts +9 -0
- package/templates/auth/better-auth-react/lib/auth-client.ts +9 -0
- package/templates/auth/better-auth-react/module.json +26 -0
- package/templates/next-prisma-postgres-shadcn/.env.example +0 -5
- package/templates/next-prisma-postgres-shadcn/.eslintrc.json +0 -7
- package/templates/next-prisma-postgres-shadcn/.prettierrc +0 -8
- package/templates/next-prisma-postgres-shadcn/README.md +0 -85
- package/templates/next-prisma-postgres-shadcn/app/api/health/route.ts +0 -25
- package/templates/next-prisma-postgres-shadcn/app/globals.css +0 -1
- package/templates/next-prisma-postgres-shadcn/app/layout.tsx +0 -22
- package/templates/next-prisma-postgres-shadcn/app/page.tsx +0 -29
- package/templates/next-prisma-postgres-shadcn/lib/db.ts +0 -14
- package/templates/next-prisma-postgres-shadcn/lib/env.ts +0 -15
- package/templates/next-prisma-postgres-shadcn/next.config.ts +0 -7
- package/templates/next-prisma-postgres-shadcn/package.json +0 -32
- package/templates/next-prisma-postgres-shadcn/prisma/schema.prisma +0 -20
- package/templates/next-prisma-postgres-shadcn/public/.gitkeep +0 -1
- package/templates/next-prisma-postgres-shadcn/template.json +0 -18
- package/templates/next-prisma-postgres-shadcn/tsconfig.json +0 -32
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
# Project
|
|
2
|
-
|
|
3
|
-
Created with [StackKit](https://github.com/tariqul420/stackkit).
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
# Install dependencies
|
|
9
|
-
pnpm install
|
|
10
|
-
|
|
11
|
-
# Configure environment
|
|
12
|
-
cp .env.example .env
|
|
13
|
-
# Update DATABASE_URL in .env
|
|
14
|
-
|
|
15
|
-
# Run migrations
|
|
16
|
-
pnpm prisma migrate dev
|
|
17
|
-
|
|
18
|
-
# Start dev server
|
|
19
|
-
pnpm dev
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Open [http://localhost:3000](http://localhost:3000)
|
|
23
|
-
|
|
24
|
-
## Stack
|
|
25
|
-
|
|
26
|
-
- Next.js 15 (App Router)
|
|
27
|
-
- TypeScript
|
|
28
|
-
- Prisma + PostgreSQL
|
|
29
|
-
- Tailwind CSS
|
|
30
|
-
- shadcn/ui
|
|
31
|
-
- Zod validation
|
|
32
|
-
|
|
33
|
-
## Structure
|
|
34
|
-
|
|
35
|
-
```
|
|
36
|
-
├── app/ # Next.js routes
|
|
37
|
-
├── lib/ # Utilities
|
|
38
|
-
├── prisma/ # Database schema
|
|
39
|
-
└── public/ # Static files
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Scripts
|
|
43
|
-
|
|
44
|
-
```bash
|
|
45
|
-
pnpm dev # Development server
|
|
46
|
-
pnpm build # Production build
|
|
47
|
-
pnpm start # Start production
|
|
48
|
-
pnpm lint # Run linter
|
|
49
|
-
pnpm prisma studio # Open Prisma Studio
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Add Features
|
|
53
|
-
|
|
54
|
-
```bash
|
|
55
|
-
npx stackkit-cli add auth
|
|
56
|
-
```
|
|
57
|
-
├── lib/ # Shared utilities
|
|
58
|
-
│ ├── db.ts # Prisma client
|
|
59
|
-
│ └── env.ts # Environment validation
|
|
60
|
-
├── prisma/ # Database schema
|
|
61
|
-
│ └── schema.prisma
|
|
62
|
-
└── public/ # Static assets
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Available Commands
|
|
66
|
-
|
|
67
|
-
- `pnpm dev` - Start development server
|
|
68
|
-
- `pnpm build` - Build for production
|
|
69
|
-
- `pnpm start` - Start production server
|
|
70
|
-
- `pnpm lint` - Run ESLint
|
|
71
|
-
- `pnpm format` - Format code with Prettier
|
|
72
|
-
|
|
73
|
-
## Adding Features
|
|
74
|
-
|
|
75
|
-
Use StackKit to add more features to your project:
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
npx stackkit add auth
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
## Learn More
|
|
82
|
-
|
|
83
|
-
- [Next.js Documentation](https://nextjs.org/docs)
|
|
84
|
-
- [Prisma Documentation](https://www.prisma.io/docs)
|
|
85
|
-
- [StackKit Documentation](https://github.com/yourusername/stackkit)
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from 'next/server';
|
|
2
|
-
import { prisma } from '@/lib/db';
|
|
3
|
-
|
|
4
|
-
export async function GET() {
|
|
5
|
-
try {
|
|
6
|
-
// Test database connection
|
|
7
|
-
await prisma.$queryRaw`SELECT 1`;
|
|
8
|
-
|
|
9
|
-
return NextResponse.json({
|
|
10
|
-
status: 'ok',
|
|
11
|
-
timestamp: new Date().toISOString(),
|
|
12
|
-
database: 'connected',
|
|
13
|
-
});
|
|
14
|
-
} catch (error) {
|
|
15
|
-
return NextResponse.json(
|
|
16
|
-
{
|
|
17
|
-
status: 'error',
|
|
18
|
-
timestamp: new Date().toISOString(),
|
|
19
|
-
database: 'disconnected',
|
|
20
|
-
error: error instanceof Error ? error.message : 'Unknown error',
|
|
21
|
-
},
|
|
22
|
-
{ status: 500 }
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import 'tailwindcss';
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from 'next';
|
|
2
|
-
import { Inter } from 'next/font/google';
|
|
3
|
-
import './globals.css';
|
|
4
|
-
|
|
5
|
-
const inter = Inter({ subsets: ['latin'] });
|
|
6
|
-
|
|
7
|
-
export const metadata: Metadata = {
|
|
8
|
-
title: 'StackKit App',
|
|
9
|
-
description: 'Created with StackKit',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default function RootLayout({
|
|
13
|
-
children,
|
|
14
|
-
}: Readonly<{
|
|
15
|
-
children: React.ReactNode;
|
|
16
|
-
}>) {
|
|
17
|
-
return (
|
|
18
|
-
<html lang="en">
|
|
19
|
-
<body className={inter.className}>{children}</body>
|
|
20
|
-
</html>
|
|
21
|
-
);
|
|
22
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export default function HomePage() {
|
|
2
|
-
return (
|
|
3
|
-
<main className="flex min-h-screen flex-col items-center justify-center p-24">
|
|
4
|
-
<div className="z-10 max-w-5xl w-full items-center justify-between font-mono text-sm">
|
|
5
|
-
<h1 className="text-4xl font-bold mb-4">Welcome to StackKit</h1>
|
|
6
|
-
<p className="text-lg text-gray-600 dark:text-gray-400">
|
|
7
|
-
Your production-ready Next.js starter
|
|
8
|
-
</p>
|
|
9
|
-
<div className="mt-8 space-y-2">
|
|
10
|
-
<p>✅ Next.js 15 App Router</p>
|
|
11
|
-
<p>✅ TypeScript</p>
|
|
12
|
-
<p>✅ Prisma + PostgreSQL</p>
|
|
13
|
-
<p>✅ Tailwind CSS</p>
|
|
14
|
-
<p>✅ Environment validation</p>
|
|
15
|
-
</div>
|
|
16
|
-
<div className="mt-8">
|
|
17
|
-
<a
|
|
18
|
-
href="/api/health"
|
|
19
|
-
className="text-blue-600 hover:underline"
|
|
20
|
-
target="_blank"
|
|
21
|
-
rel="noopener noreferrer"
|
|
22
|
-
>
|
|
23
|
-
Check API Health →
|
|
24
|
-
</a>
|
|
25
|
-
</div>
|
|
26
|
-
</div>
|
|
27
|
-
</main>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PrismaClient } from '@prisma/client';
|
|
2
|
-
import { env } from './env';
|
|
3
|
-
|
|
4
|
-
const globalForPrisma = globalThis as unknown as {
|
|
5
|
-
prisma: PrismaClient | undefined;
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const prisma =
|
|
9
|
-
globalForPrisma.prisma ??
|
|
10
|
-
new PrismaClient({
|
|
11
|
-
log: env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'],
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
if (env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
|
|
3
|
-
const envSchema = z.object({
|
|
4
|
-
NODE_ENV: z.enum(['development', 'production', 'test']).default('development'),
|
|
5
|
-
DATABASE_URL: z.string().url(),
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
const parsedEnv = envSchema.safeParse(process.env);
|
|
9
|
-
|
|
10
|
-
if (!parsedEnv.success) {
|
|
11
|
-
console.error('❌ Invalid environment variables:', parsedEnv.error.format());
|
|
12
|
-
throw new Error('Invalid environment variables');
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export const env = parsedEnv.data;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "my-app",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"dev": "next dev",
|
|
7
|
-
"build": "next build",
|
|
8
|
-
"start": "next start",
|
|
9
|
-
"lint": "eslint . --ext .ts,.tsx",
|
|
10
|
-
"format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,md}\"",
|
|
11
|
-
"postinstall": "prisma generate"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@prisma/client": "^5.8.0",
|
|
15
|
-
"next": "16.1.1",
|
|
16
|
-
"react": "19.2.3",
|
|
17
|
-
"react-dom": "19.2.3",
|
|
18
|
-
"zod": "^3.22.4"
|
|
19
|
-
},
|
|
20
|
-
"devDependencies": {
|
|
21
|
-
"@tailwindcss/postcss": "^4",
|
|
22
|
-
"@types/node": "^20",
|
|
23
|
-
"@types/react": "^19",
|
|
24
|
-
"@types/react-dom": "^19",
|
|
25
|
-
"eslint": "^9",
|
|
26
|
-
"eslint-config-next": "16.1.1",
|
|
27
|
-
"prettier": "^3.2.4",
|
|
28
|
-
"prisma": "^5.8.0",
|
|
29
|
-
"tailwindcss": "^4",
|
|
30
|
-
"typescript": "^5"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// This is your Prisma schema file
|
|
2
|
-
// Learn more about it in the docs: https://pris.ly/d/prisma-schema
|
|
3
|
-
|
|
4
|
-
generator client {
|
|
5
|
-
provider = "prisma-client-js"
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
datasource db {
|
|
9
|
-
provider = "postgresql"
|
|
10
|
-
url = env("DATABASE_URL")
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
// Example model - replace with your own
|
|
14
|
-
model User {
|
|
15
|
-
id String @id @default(cuid())
|
|
16
|
-
email String @unique
|
|
17
|
-
name String?
|
|
18
|
-
createdAt DateTime @default(now())
|
|
19
|
-
updatedAt DateTime @updatedAt
|
|
20
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
# This file is used to keep the public directory in git
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "next-prisma-postgres-shadcn",
|
|
3
|
-
"displayName": "Next.js + Prisma + PostgreSQL + shadcn/ui",
|
|
4
|
-
"description": "Next.js 15 App Router, Prisma, PostgreSQL, shadcn/ui, TypeScript",
|
|
5
|
-
"tags": ["nextjs", "prisma", "postgresql", "shadcn", "typescript"],
|
|
6
|
-
"defaultPackageManager": "pnpm",
|
|
7
|
-
"features": [
|
|
8
|
-
"Next.js 15 App Router",
|
|
9
|
-
"TypeScript",
|
|
10
|
-
"Prisma ORM",
|
|
11
|
-
"PostgreSQL",
|
|
12
|
-
"shadcn/ui components",
|
|
13
|
-
"Tailwind CSS",
|
|
14
|
-
"Environment validation (Zod)",
|
|
15
|
-
"ESLint + Prettier",
|
|
16
|
-
"Health check API route"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2017",
|
|
4
|
-
"lib": ["dom", "dom.iterable", "esnext"],
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"skipLibCheck": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"noEmit": true,
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"module": "esnext",
|
|
11
|
-
"moduleResolution": "bundler",
|
|
12
|
-
"resolveJsonModule": true,
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"jsx": "preserve",
|
|
15
|
-
"incremental": true,
|
|
16
|
-
"plugins": [
|
|
17
|
-
{
|
|
18
|
-
"name": "next"
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"paths": {
|
|
22
|
-
"@/*": ["./*"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"next-env.d.ts",
|
|
27
|
-
"**/*.ts",
|
|
28
|
-
"**/*.tsx",
|
|
29
|
-
".next/types/**/*.ts"
|
|
30
|
-
],
|
|
31
|
-
"exclude": ["node_modules"]
|
|
32
|
-
}
|