stackkit 0.1.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 +41 -0
- package/bin/stackkit.js +4 -0
- package/dist/cli/add.d.ts +8 -0
- package/dist/cli/add.js +313 -0
- package/dist/cli/create.d.ts +22 -0
- package/dist/cli/create.js +336 -0
- package/dist/cli/doctor.d.ts +7 -0
- package/dist/cli/doctor.js +569 -0
- package/dist/cli/list.d.ts +6 -0
- package/dist/cli/list.js +123 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +91 -0
- package/dist/lib/conversion/js-conversion.d.ts +1 -0
- package/dist/lib/conversion/js-conversion.js +244 -0
- package/dist/lib/database/database-config.d.ts +6 -0
- package/dist/lib/database/database-config.js +9 -0
- package/dist/lib/discovery/module-discovery.d.ts +62 -0
- package/dist/lib/discovery/module-discovery.js +188 -0
- package/dist/lib/env/env-editor.d.ts +9 -0
- package/dist/lib/env/env-editor.js +116 -0
- package/dist/lib/framework/framework-utils.d.ts +22 -0
- package/dist/lib/framework/framework-utils.js +74 -0
- package/dist/lib/fs/files.d.ts +14 -0
- package/dist/lib/fs/files.js +101 -0
- package/dist/lib/generation/code-generator.d.ts +83 -0
- package/dist/lib/generation/code-generator.js +681 -0
- package/dist/lib/git-utils.d.ts +1 -0
- package/dist/lib/git-utils.js +9 -0
- package/dist/lib/pm/package-manager.d.ts +5 -0
- package/dist/lib/pm/package-manager.js +69 -0
- package/dist/lib/project/detect.d.ts +4 -0
- package/dist/lib/project/detect.js +121 -0
- package/dist/lib/ui/logger.d.ts +16 -0
- package/dist/lib/ui/logger.js +59 -0
- package/dist/types/index.d.ts +92 -0
- package/dist/types/index.js +2 -0
- package/modules/auth/authjs/files/api/auth/[...nextauth]/route.ts +6 -0
- package/modules/auth/authjs/files/lib/auth-client.ts +11 -0
- package/modules/auth/authjs/files/lib/auth.ts +36 -0
- package/modules/auth/authjs/files/schemas/prisma-schema.prisma +45 -0
- package/modules/auth/authjs/module.json +22 -0
- package/modules/auth/better-auth/files/api/auth/[...all]/route.ts +4 -0
- package/modules/auth/better-auth/files/lib/auth-client.ts +7 -0
- package/modules/auth/better-auth/files/lib/auth.ts +83 -0
- package/modules/auth/better-auth/files/lib/email-service.ts +34 -0
- package/modules/auth/better-auth/files/lib/email-templates.ts +89 -0
- package/modules/auth/better-auth/files/prisma/schema.prisma +63 -0
- package/modules/auth/better-auth/generator.json +78 -0
- package/modules/auth/better-auth/module.json +37 -0
- package/modules/database/mongoose/files/lib/db.ts +63 -0
- package/modules/database/mongoose/files/models/User.ts +34 -0
- package/modules/database/mongoose/generator.json +24 -0
- package/modules/database/mongoose/module.json +15 -0
- package/modules/database/prisma/files/lib/prisma.ts +45 -0
- package/modules/database/prisma/files/prisma/schema.prisma +8 -0
- package/modules/database/prisma/files/prisma.config.ts +12 -0
- package/modules/database/prisma/generator.json +43 -0
- package/modules/database/prisma/module.json +17 -0
- package/package.json +83 -0
- package/templates/express/.env.example +2 -0
- package/templates/express/eslint.config.cjs +42 -0
- package/templates/express/package.json +33 -0
- package/templates/express/src/app.ts +51 -0
- package/templates/express/src/config/env.ts +12 -0
- package/templates/express/src/features/health/health.controller.ts +18 -0
- package/templates/express/src/features/health/health.route.ts +9 -0
- package/templates/express/src/features/health/health.service.ts +6 -0
- package/templates/express/src/middlewares/error.middleware.ts +18 -0
- package/templates/express/src/server.ts +8 -0
- package/templates/express/template.json +27 -0
- package/templates/express/tsconfig.json +30 -0
- package/templates/nextjs/README.md +52 -0
- package/templates/nextjs/app/favicon.ico +0 -0
- package/templates/nextjs/app/globals.css +26 -0
- package/templates/nextjs/app/layout.tsx +30 -0
- package/templates/nextjs/app/page.tsx +57 -0
- package/templates/nextjs/eslint.config.mjs +18 -0
- package/templates/nextjs/lib/env.ts +8 -0
- package/templates/nextjs/next.config.ts +7 -0
- package/templates/nextjs/package.json +27 -0
- package/templates/nextjs/postcss.config.mjs +7 -0
- package/templates/nextjs/public/file.svg +1 -0
- package/templates/nextjs/public/globe.svg +1 -0
- package/templates/nextjs/public/next.svg +1 -0
- package/templates/nextjs/public/vercel.svg +1 -0
- package/templates/nextjs/public/window.svg +1 -0
- package/templates/nextjs/template.json +34 -0
- package/templates/nextjs/tsconfig.json +34 -0
- package/templates/react/.env.example +1 -0
- package/templates/react/.prettierignore +4 -0
- package/templates/react/.prettierrc +9 -0
- package/templates/react/README.md +56 -0
- package/templates/react/eslint.config.js +23 -0
- package/templates/react/index.html +14 -0
- package/templates/react/package.json +44 -0
- package/templates/react/public/vite.svg +1 -0
- package/templates/react/src/api/client.ts +47 -0
- package/templates/react/src/assets/react.svg +1 -0
- package/templates/react/src/components/ErrorBoundary.tsx +51 -0
- package/templates/react/src/components/Layout.tsx +13 -0
- package/templates/react/src/components/Loading.tsx +8 -0
- package/templates/react/src/components/SEO.tsx +49 -0
- package/templates/react/src/config/constants.ts +5 -0
- package/templates/react/src/hooks/index.ts +64 -0
- package/templates/react/src/index.css +1 -0
- package/templates/react/src/lib/queryClient.ts +12 -0
- package/templates/react/src/main.tsx +22 -0
- package/templates/react/src/pages/About.tsx +78 -0
- package/templates/react/src/pages/Home.tsx +49 -0
- package/templates/react/src/pages/NotFound.tsx +24 -0
- package/templates/react/src/router.tsx +21 -0
- package/templates/react/src/types/api.d.ts +20 -0
- package/templates/react/src/utils/helpers.ts +51 -0
- package/templates/react/src/utils/storage.ts +35 -0
- package/templates/react/src/vite-env.d.ts +11 -0
- package/templates/react/template.json +38 -0
- package/templates/react/tsconfig.app.json +28 -0
- package/templates/react/tsconfig.json +4 -0
- package/templates/react/tsconfig.node.json +26 -0
- package/templates/react/vite.config.ts +7 -0
- package/templates/react-vite/README.md +56 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-express-app",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "tsx watch src/server.ts",
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"lint": "eslint src --ext .ts",
|
|
10
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
11
|
+
"start": "node dist/server.js",
|
|
12
|
+
"start:prod": "cross-env NODE_ENV=production node dist/server.js"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"cors": "^2.8.5",
|
|
16
|
+
"dotenv": "^17.2.3",
|
|
17
|
+
"express": "^5.2.1",
|
|
18
|
+
"helmet": "^8.1.0",
|
|
19
|
+
"morgan": "^1.10.1"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/cors": "^2.8.19",
|
|
23
|
+
"@types/express": "^5.0.6",
|
|
24
|
+
"@types/morgan": "^1.9.10",
|
|
25
|
+
"@types/node": "^25.0.8",
|
|
26
|
+
"@typescript-eslint/eslint-plugin": "^8.53.0",
|
|
27
|
+
"@typescript-eslint/parser": "^8.53.0",
|
|
28
|
+
"cross-env": "^10.1.0",
|
|
29
|
+
"eslint": "^9.39.2",
|
|
30
|
+
"tsx": "^4.21.0",
|
|
31
|
+
"typescript": "^5.9.3"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import cors from "cors";
|
|
2
|
+
import express, { Application, NextFunction, Request, Response } from "express";
|
|
3
|
+
import helmet from "helmet";
|
|
4
|
+
import morgan from "morgan";
|
|
5
|
+
import { env } from "./config/env";
|
|
6
|
+
import { authRoutes } from "./features/health/health.route";
|
|
7
|
+
import { errorHandler } from "./middlewares/error.middleware";
|
|
8
|
+
|
|
9
|
+
// app initialization
|
|
10
|
+
const app: Application = express();
|
|
11
|
+
app.use(express.json());
|
|
12
|
+
|
|
13
|
+
// security headers
|
|
14
|
+
app.use(helmet());
|
|
15
|
+
|
|
16
|
+
// logging
|
|
17
|
+
if (env.isProduction) {
|
|
18
|
+
app.use(morgan("combined"));
|
|
19
|
+
} else {
|
|
20
|
+
app.use(morgan("dev"));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// cors configuration
|
|
24
|
+
app.use(cors());
|
|
25
|
+
|
|
26
|
+
// Home page route
|
|
27
|
+
app.get("/", (_req: Request, res: Response) => {
|
|
28
|
+
res.status(200).json({
|
|
29
|
+
title: "Welcome to your Express app",
|
|
30
|
+
description:
|
|
31
|
+
"Built with StackKit - A production-ready Express template with TypeScript, security, and best practices.",
|
|
32
|
+
version: "1.0.0",
|
|
33
|
+
docs: "https://github.com/tariqul420/stackkit",
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
// routes
|
|
38
|
+
app.use("/api/health", authRoutes);
|
|
39
|
+
|
|
40
|
+
// unhandled routes
|
|
41
|
+
app.use((req: Request, _res: Response, next: NextFunction) => {
|
|
42
|
+
const error: any = new Error(`Can't find ${req.originalUrl} on this server!`);
|
|
43
|
+
error.status = 404;
|
|
44
|
+
|
|
45
|
+
next(error);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// Global error handler
|
|
49
|
+
app.use(errorHandler);
|
|
50
|
+
|
|
51
|
+
export default app;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import dotenv from "dotenv";
|
|
2
|
+
import path from "path";
|
|
3
|
+
|
|
4
|
+
dotenv.config({ path: path.join(process.cwd(), ".env") });
|
|
5
|
+
|
|
6
|
+
const env = {
|
|
7
|
+
port: Number(process.env.PORT) || 3000,
|
|
8
|
+
node_env: process.env.NODE_ENV || "development",
|
|
9
|
+
isProduction: (process.env.NODE_ENV || "development") === "production",
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { env };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from "express";
|
|
2
|
+
|
|
3
|
+
const health = async (_req: Request, res: Response, next: NextFunction) => {
|
|
4
|
+
try {
|
|
5
|
+
res.status(200).json({
|
|
6
|
+
success: true,
|
|
7
|
+
message: "API is healthy!",
|
|
8
|
+
timestamp: new Date().toISOString(),
|
|
9
|
+
version: "1.0.0",
|
|
10
|
+
});
|
|
11
|
+
} catch (error) {
|
|
12
|
+
next(error);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const healthController = {
|
|
17
|
+
health,
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NextFunction, Request, Response } from "express";
|
|
2
|
+
import { env } from "../config/env";
|
|
3
|
+
|
|
4
|
+
export const errorHandler = (err: any, _req: Request, res: Response, _: NextFunction) => {
|
|
5
|
+
const statusCode = err.status || 500;
|
|
6
|
+
const errorMessage = err?.message || "Internal server error!";
|
|
7
|
+
|
|
8
|
+
const payload: any = {
|
|
9
|
+
success: false,
|
|
10
|
+
message: errorMessage,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
if (!env.isProduction) {
|
|
14
|
+
payload.errors = err?.stack || err;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
res.status(statusCode).json(payload);
|
|
18
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "express",
|
|
3
|
+
"displayName": "Express.js",
|
|
4
|
+
"framework": "express",
|
|
5
|
+
"description": "Express.js REST API with TypeScript",
|
|
6
|
+
"compatibility": {
|
|
7
|
+
"databases": ["prisma", "mongoose"],
|
|
8
|
+
"auth": ["better-auth"]
|
|
9
|
+
},
|
|
10
|
+
"files": ["src/", ".gitignore", "package.json", "tsconfig.json", ".env.example"],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"dev": "tsx watch src/server.ts",
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"lint": "eslint src --ext .ts",
|
|
15
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
16
|
+
"start": "node dist/server.js",
|
|
17
|
+
"start:prod": "cross-env NODE_ENV=production node dist/server.js"
|
|
18
|
+
},
|
|
19
|
+
"jsScripts": {
|
|
20
|
+
"dev": "tsx --watch src/server.js",
|
|
21
|
+
"build": "echo 'No build step for JavaScript'",
|
|
22
|
+
"lint": "eslint src --ext .js",
|
|
23
|
+
"lint:fix": "eslint src --ext .js --fix",
|
|
24
|
+
"start": "node src/server.js",
|
|
25
|
+
"start:prod": "cross-env NODE_ENV=production node src/server.js"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./dist",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"target": "ES2023",
|
|
7
|
+
"lib": ["ES2023"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"resolveJsonModule": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": true,
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"declaration": false,
|
|
16
|
+
"declarationMap": false,
|
|
17
|
+
"removeComments": false,
|
|
18
|
+
"noImplicitAny": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noImplicitThis": true,
|
|
21
|
+
"noUnusedLocals": true,
|
|
22
|
+
"noUnusedParameters": true,
|
|
23
|
+
"exactOptionalPropertyTypes": true,
|
|
24
|
+
"noEmitOnError": true,
|
|
25
|
+
"incremental": false,
|
|
26
|
+
"ignoreDeprecations": "5.0"
|
|
27
|
+
},
|
|
28
|
+
"include": ["src/**/*"],
|
|
29
|
+
"exclude": ["node_modules", "dist"]
|
|
30
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Next.js Template
|
|
2
|
+
|
|
3
|
+
Production-ready Next.js starter with TypeScript and App Router.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- Next.js 15 with App Router
|
|
15
|
+
- TypeScript for type safety
|
|
16
|
+
- Tailwind CSS for styling
|
|
17
|
+
- ESLint for code quality
|
|
18
|
+
|
|
19
|
+
## Scripts
|
|
20
|
+
|
|
21
|
+
- `npm run dev` - Start development server
|
|
22
|
+
- `npm run build` - Build for production
|
|
23
|
+
- `npm run start` - Start production server
|
|
24
|
+
- `npm run lint` - Run linter
|
|
25
|
+
|
|
26
|
+
## Project Structure
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
app/
|
|
30
|
+
├── globals.css # Global styles
|
|
31
|
+
├── layout.tsx # Root layout
|
|
32
|
+
├── page.tsx # Home page
|
|
33
|
+
└── api/ # API routes
|
|
34
|
+
|
|
35
|
+
lib/
|
|
36
|
+
└── utils.ts # Utility functions
|
|
37
|
+
|
|
38
|
+
public/ # Static assets
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Environment Variables
|
|
42
|
+
|
|
43
|
+
Create `.env.local` file for environment variables.
|
|
44
|
+
|
|
45
|
+
## Deployment
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
npm run build
|
|
49
|
+
npm run start
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Deploy to Vercel, Netlify, or any Node.js hosting service.
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
@import "tailwindcss";
|
|
2
|
+
|
|
3
|
+
:root {
|
|
4
|
+
--background: #ffffff;
|
|
5
|
+
--foreground: #171717;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
@theme inline {
|
|
9
|
+
--color-background: var(--background);
|
|
10
|
+
--color-foreground: var(--foreground);
|
|
11
|
+
--font-sans: var(--font-geist-sans);
|
|
12
|
+
--font-mono: var(--font-geist-mono);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
@media (prefers-color-scheme: dark) {
|
|
16
|
+
:root {
|
|
17
|
+
--background: #0a0a0a;
|
|
18
|
+
--foreground: #ededed;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
body {
|
|
23
|
+
background: var(--background);
|
|
24
|
+
color: var(--foreground);
|
|
25
|
+
font-family: Arial, Helvetica, sans-serif;
|
|
26
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Metadata } from "next";
|
|
2
|
+
import { Geist, Geist_Mono } from "next/font/google";
|
|
3
|
+
import "./globals.css";
|
|
4
|
+
|
|
5
|
+
const geistSans = Geist({
|
|
6
|
+
variable: "--font-geist-sans",
|
|
7
|
+
subsets: ["latin"],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const geistMono = Geist_Mono({
|
|
11
|
+
variable: "--font-geist-mono",
|
|
12
|
+
subsets: ["latin"],
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const metadata: Metadata = {
|
|
16
|
+
title: "Create Next App",
|
|
17
|
+
description: "Generated by create next app",
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default function RootLayout({
|
|
21
|
+
children,
|
|
22
|
+
}: Readonly<{
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}>) {
|
|
25
|
+
return (
|
|
26
|
+
<html lang="en">
|
|
27
|
+
<body className={`${geistSans.variable} ${geistMono.variable} antialiased`}>{children}</body>
|
|
28
|
+
</html>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import Image from "next/image";
|
|
2
|
+
|
|
3
|
+
export default function Home() {
|
|
4
|
+
return (
|
|
5
|
+
<div className="flex min-h-screen items-center justify-center bg-zinc-50 font-sans dark:bg-black">
|
|
6
|
+
<main className="flex min-h-screen w-full max-w-3xl flex-col items-center justify-between py-32 px-16 bg-white dark:bg-black sm:items-start">
|
|
7
|
+
<div className="flex items-center gap-4 mb-8">
|
|
8
|
+
<div className="text-2xl font-bold text-black dark:text-white">Stackkit</div>
|
|
9
|
+
<span className="text-xl text-zinc-400">+</span>
|
|
10
|
+
<Image
|
|
11
|
+
className="dark:invert"
|
|
12
|
+
src="/next.svg"
|
|
13
|
+
alt="Next.js logo"
|
|
14
|
+
width={100}
|
|
15
|
+
height={20}
|
|
16
|
+
priority
|
|
17
|
+
/>
|
|
18
|
+
</div>
|
|
19
|
+
<div className="flex flex-col items-center gap-6 text-center sm:items-start sm:text-left">
|
|
20
|
+
<h1 className="max-w-xs text-3xl font-semibold leading-10 tracking-tight text-black dark:text-zinc-50">
|
|
21
|
+
To get started, edit the page.tsx file.
|
|
22
|
+
</h1>
|
|
23
|
+
<p className="max-w-md text-lg leading-8 text-zinc-600 dark:text-zinc-400">
|
|
24
|
+
This template includes Next.js, Tailwind CSS, and Stackkit best practices. Check out the{" "}
|
|
25
|
+
<a
|
|
26
|
+
href="https://github.com/tariqul420/stackkit"
|
|
27
|
+
className="font-medium text-zinc-950 dark:text-zinc-50 hover:underline"
|
|
28
|
+
target="_blank"
|
|
29
|
+
rel="noopener noreferrer"
|
|
30
|
+
>
|
|
31
|
+
Stackkit repository
|
|
32
|
+
</a>{" "}
|
|
33
|
+
for more info.
|
|
34
|
+
</p>
|
|
35
|
+
</div>
|
|
36
|
+
<div className="flex flex-col gap-4 text-base font-medium sm:flex-row">
|
|
37
|
+
<a
|
|
38
|
+
className="flex h-12 w-full items-center justify-center rounded-full bg-white text-black px-5 transition-colors hover:bg-zinc-200 md:w-40"
|
|
39
|
+
href="https://nextjs.org/docs"
|
|
40
|
+
target="_blank"
|
|
41
|
+
rel="noopener noreferrer"
|
|
42
|
+
>
|
|
43
|
+
Documentation
|
|
44
|
+
</a>
|
|
45
|
+
<a
|
|
46
|
+
className="flex h-12 w-full items-center justify-center rounded-full bg-black text-white px-5 transition-colors hover:bg-zinc-900 md:w-40"
|
|
47
|
+
href="https://github.com/tariqul420/stackkit"
|
|
48
|
+
target="_blank"
|
|
49
|
+
rel="noopener noreferrer"
|
|
50
|
+
>
|
|
51
|
+
Stackkit GitHub
|
|
52
|
+
</a>
|
|
53
|
+
</div>
|
|
54
|
+
</main>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
2
|
+
import nextVitals from "eslint-config-next/core-web-vitals";
|
|
3
|
+
import nextTs from "eslint-config-next/typescript";
|
|
4
|
+
|
|
5
|
+
const eslintConfig = defineConfig([
|
|
6
|
+
...nextVitals,
|
|
7
|
+
...nextTs,
|
|
8
|
+
// Override default ignores of eslint-config-next.
|
|
9
|
+
globalIgnores([
|
|
10
|
+
// Default ignores of eslint-config-next:
|
|
11
|
+
".next/**",
|
|
12
|
+
"out/**",
|
|
13
|
+
"build/**",
|
|
14
|
+
"next-env.d.ts",
|
|
15
|
+
]),
|
|
16
|
+
]);
|
|
17
|
+
|
|
18
|
+
export default eslintConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "next dev",
|
|
8
|
+
"build": "next build",
|
|
9
|
+
"start": "next start",
|
|
10
|
+
"lint": "eslint"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"next": "16.1.1",
|
|
14
|
+
"react": "19.2.3",
|
|
15
|
+
"react-dom": "19.2.3"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
19
|
+
"@types/node": "^25.0.8",
|
|
20
|
+
"@types/react": "^19.2.8",
|
|
21
|
+
"@types/react-dom": "^19.2.3",
|
|
22
|
+
"eslint": "^9.39.2",
|
|
23
|
+
"eslint-config-next": "16.1.1",
|
|
24
|
+
"tailwindcss": "^4.1.18",
|
|
25
|
+
"typescript": "^5.9.3"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"><path d="M14.5 13.5V5.41a1 1 0 0 0-.3-.7L9.8.29A1 1 0 0 0 9.08 0H1.5v13.5A2.5 2.5 0 0 0 4 16h8a2.5 2.5 0 0 0 2.5-2.5m-1.5 0v-7H8v-5H3v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1M9.5 5V2.12L12.38 5zM5.13 5h-.62v1.25h2.12V5zm-.62 3h7.12v1.25H4.5zm.62 3h-.62v1.25h7.12V11z" clip-rule="evenodd" fill="#666" fill-rule="evenodd"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><g clip-path="url(#a)"><path fill-rule="evenodd" clip-rule="evenodd" d="M10.27 14.1a6.5 6.5 0 0 0 3.67-3.45q-1.24.21-2.7.34-.31 1.83-.97 3.1M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16m.48-1.52a7 7 0 0 1-.96 0H7.5a4 4 0 0 1-.84-1.32q-.38-.89-.63-2.08a40 40 0 0 0 3.92 0q-.25 1.2-.63 2.08a4 4 0 0 1-.84 1.31zm2.94-4.76q1.66-.15 2.95-.43a7 7 0 0 0 0-2.58q-1.3-.27-2.95-.43a18 18 0 0 1 0 3.44m-1.27-3.54a17 17 0 0 1 0 3.64 39 39 0 0 1-4.3 0 17 17 0 0 1 0-3.64 39 39 0 0 1 4.3 0m1.1-1.17q1.45.13 2.69.34a6.5 6.5 0 0 0-3.67-3.44q.65 1.26.98 3.1M8.48 1.5l.01.02q.41.37.84 1.31.38.89.63 2.08a40 40 0 0 0-3.92 0q.25-1.2.63-2.08a4 4 0 0 1 .85-1.32 7 7 0 0 1 .96 0m-2.75.4a6.5 6.5 0 0 0-3.67 3.44 29 29 0 0 1 2.7-.34q.31-1.83.97-3.1M4.58 6.28q-1.66.16-2.95.43a7 7 0 0 0 0 2.58q1.3.27 2.95.43a18 18 0 0 1 0-3.44m.17 4.71q-1.45-.12-2.69-.34a6.5 6.5 0 0 0 3.67 3.44q-.65-1.27-.98-3.1" fill="#666"/></g><defs><clipPath id="a"><path fill="#fff" d="M0 0h16v16H0z"/></clipPath></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 394 80"><path fill="#000" d="M262 0h68.5v12.7h-27.2v66.6h-13.6V12.7H262V0ZM149 0v12.7H94v20.4h44.3v12.6H94v21h55v12.6H80.5V0h68.7zm34.3 0h-17.8l63.8 79.4h17.9l-32-39.7 32-39.6h-17.9l-23 28.6-23-28.6zm18.3 56.7-9-11-27.1 33.7h17.8l18.3-22.7z"/><path fill="#000" d="M81 79.3 17 0H0v79.3h13.6V17l50.2 62.3H81Zm252.6-.4c-1 0-1.8-.4-2.5-1s-1.1-1.6-1.1-2.6.3-1.8 1-2.5 1.6-1 2.6-1 1.8.3 2.5 1a3.4 3.4 0 0 1 .6 4.3 3.7 3.7 0 0 1-3 1.8zm23.2-33.5h6v23.3c0 2.1-.4 4-1.3 5.5a9.1 9.1 0 0 1-3.8 3.5c-1.6.8-3.5 1.3-5.7 1.3-2 0-3.7-.4-5.3-1s-2.8-1.8-3.7-3.2c-.9-1.3-1.4-3-1.4-5h6c.1.8.3 1.6.7 2.2s1 1.2 1.6 1.5c.7.4 1.5.5 2.4.5 1 0 1.8-.2 2.4-.6a4 4 0 0 0 1.6-1.8c.3-.8.5-1.8.5-3V45.5zm30.9 9.1a4.4 4.4 0 0 0-2-3.3 7.5 7.5 0 0 0-4.3-1.1c-1.3 0-2.4.2-3.3.5-.9.4-1.6 1-2 1.6a3.5 3.5 0 0 0-.3 4c.3.5.7.9 1.3 1.2l1.8 1 2 .5 3.2.8c1.3.3 2.5.7 3.7 1.2a13 13 0 0 1 3.2 1.8 8.1 8.1 0 0 1 3 6.5c0 2-.5 3.7-1.5 5.1a10 10 0 0 1-4.4 3.5c-1.8.8-4.1 1.2-6.8 1.2-2.6 0-4.9-.4-6.8-1.2-2-.8-3.4-2-4.5-3.5a10 10 0 0 1-1.7-5.6h6a5 5 0 0 0 3.5 4.6c1 .4 2.2.6 3.4.6 1.3 0 2.5-.2 3.5-.6 1-.4 1.8-1 2.4-1.7a4 4 0 0 0 .8-2.4c0-.9-.2-1.6-.7-2.2a11 11 0 0 0-2.1-1.4l-3.2-1-3.8-1c-2.8-.7-5-1.7-6.6-3.2a7.2 7.2 0 0 1-2.4-5.7 8 8 0 0 1 1.7-5 10 10 0 0 1 4.3-3.5c2-.8 4-1.2 6.4-1.2 2.3 0 4.4.4 6.2 1.2 1.8.8 3.2 2 4.3 3.4 1 1.4 1.5 3 1.5 5h-5.8z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1155 1000"><path d="m577.3 0 577.4 1000H0z" fill="#fff"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M1.5 2.5h13v10a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1zM0 1h16v11.5a2.5 2.5 0 0 1-2.5 2.5h-11A2.5 2.5 0 0 1 0 12.5zm3.75 4.5a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5M7 4.75a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0m1.75.75a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5" fill="#666"/></svg>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nextjs",
|
|
3
|
+
"displayName": "Next.js",
|
|
4
|
+
"framework": "nextjs",
|
|
5
|
+
"description": "Next.js 16 App Router with TypeScript",
|
|
6
|
+
"compatibility": {
|
|
7
|
+
"databases": ["prisma", "mongoose"],
|
|
8
|
+
"auth": ["better-auth", "authjs"]
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"app/",
|
|
12
|
+
"public/",
|
|
13
|
+
".gitignore",
|
|
14
|
+
"eslint.config.mjs",
|
|
15
|
+
"next-env.d.ts",
|
|
16
|
+
"next.config.ts",
|
|
17
|
+
"package.json",
|
|
18
|
+
"postcss.config.mjs",
|
|
19
|
+
"README.md",
|
|
20
|
+
"tsconfig.json"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"dev": "next dev",
|
|
24
|
+
"build": "next build",
|
|
25
|
+
"start": "next start",
|
|
26
|
+
"lint": "eslint"
|
|
27
|
+
},
|
|
28
|
+
"jsScripts": {
|
|
29
|
+
"dev": "next dev",
|
|
30
|
+
"build": "next build",
|
|
31
|
+
"start": "next start",
|
|
32
|
+
"lint": "eslint"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
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": "react-jsx",
|
|
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
|
+
".next/dev/types/**/*.ts",
|
|
31
|
+
"**/*.mts"
|
|
32
|
+
],
|
|
33
|
+
"exclude": ["node_modules"]
|
|
34
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VITE_API_URL=http://localhost:3000
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# React + Vite Template
|
|
2
|
+
|
|
3
|
+
Production-ready React starter with TypeScript, Vite, and essential libraries.
|
|
4
|
+
|
|
5
|
+
## Quick Start
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm install
|
|
9
|
+
pnpm dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- React 19 with TypeScript
|
|
15
|
+
- Vite for fast development
|
|
16
|
+
- React Router for routing
|
|
17
|
+
- TanStack Query for data fetching
|
|
18
|
+
- Tailwind CSS for styling
|
|
19
|
+
- ESLint for code quality
|
|
20
|
+
|
|
21
|
+
## Scripts
|
|
22
|
+
|
|
23
|
+
- `pnpm dev` - Start development server
|
|
24
|
+
- `pnpm build` - Build for production
|
|
25
|
+
- `pnpm preview` - Preview production build
|
|
26
|
+
- `pnpm lint` - Run linter
|
|
27
|
+
|
|
28
|
+
## Environment Variables
|
|
29
|
+
|
|
30
|
+
Copy `.env.example` to `.env` and configure:
|
|
31
|
+
|
|
32
|
+
```env
|
|
33
|
+
VITE_API_URL=http://localhost:3000/api
|
|
34
|
+
VITE_APP_NAME=My App
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Project Structure
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
src/
|
|
41
|
+
├── api/ # API client
|
|
42
|
+
├── components/ # UI components
|
|
43
|
+
├── hooks/ # Custom hooks
|
|
44
|
+
├── lib/ # Utilities
|
|
45
|
+
├── pages/ # Route pages
|
|
46
|
+
├── types/ # TypeScript types
|
|
47
|
+
└── utils/ # Helper functions
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Deployment
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm build
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Deploy the `dist` folder to Vercel, Netlify, or any static hosting service.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import globals from "globals";
|
|
3
|
+
import reactHooks from "eslint-plugin-react-hooks";
|
|
4
|
+
import reactRefresh from "eslint-plugin-react-refresh";
|
|
5
|
+
import tseslint from "typescript-eslint";
|
|
6
|
+
import { defineConfig, globalIgnores } from "eslint/config";
|
|
7
|
+
|
|
8
|
+
export default defineConfig([
|
|
9
|
+
globalIgnores(["dist"]),
|
|
10
|
+
{
|
|
11
|
+
files: ["**/*.{ts,tsx}"],
|
|
12
|
+
extends: [
|
|
13
|
+
js.configs.recommended,
|
|
14
|
+
tseslint.configs.recommended,
|
|
15
|
+
reactHooks.configs.flat.recommended,
|
|
16
|
+
reactRefresh.configs.vite,
|
|
17
|
+
],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
ecmaVersion: 2020,
|
|
20
|
+
globals: globals.browser,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
]);
|