Skip to content

Commit 3e4aa77

Browse files
committed
Initial Commit with .gitignore
0 parents  commit 3e4aa77

File tree

17 files changed

+6238
-0
lines changed

17 files changed

+6238
-0
lines changed

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DATABASE_URL=
2+
NEXTAUTH_SECRET=
3+
NEXTAUTH_URL=http://localhost:3000

.github/workflows/main.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Install Node.js
11+
uses: actions/setup-node@v3
12+
with:
13+
node-version: '18'
14+
- name: Install dependencies
15+
run: npm install
16+
- name: Lint
17+
run: npm run lint
18+
- name: Build
19+
run: npm run build

.gitignore

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Node
2+
node_modules/
3+
.env
4+
.next/
5+
dist/
6+
out/
7+
8+
# Logs
9+
npm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
pnpm-debug.log*
13+
14+
# OS-specific
15+
.DS_Store
16+
Thumbs.db
17+
18+
# Prisma
19+
prisma/dev.db
20+
prisma/dev.db-journal
21+
22+
# Vercel
23+
.vercel/
24+
25+
# Build outputs
26+
coverage/
27+
turbo/

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Next.js Starter Template
2+
3+
This is a starter template for Next.js 13 (App Router) with:
4+
5+
- TypeScript
6+
- Tailwind CSS
7+
- Prisma (PostgreSQL)
8+
- Zustand state management
9+
- ESLint + Prettier config
10+
- Sample API route
11+
12+
## Getting Started
13+
14+
1. Copy `.env.example` to `.env` and fill environment variables
15+
2. Run `npm install`
16+
3. Run `npm run dev` to start development server

app/api/hello/route.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import { NextResponse } from 'next/server';
2+
3+
export async function GET() {
4+
return NextResponse.json({ message: 'Hello from the server!' });
5+
}

app/layout.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import '../styles/globals.css';
2+
import { ReactNode } from 'react';
3+
4+
export default function RootLayout({ children }: { children: ReactNode }) {
5+
return (
6+
<html lang="en">
7+
<body>
8+
{children}
9+
</body>
10+
</html>
11+
);
12+
}

app/page.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function Home() {
2+
return (
3+
<main className="flex min-h-screen items-center justify-center">
4+
<h1 className="text-3xl font-bold">Welcome to your starter!</h1>
5+
</main>
6+
);
7+
}

components/Button.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export function Button({ children }: { children: React.ReactNode }) {
2+
return (
3+
<button className="px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700">
4+
{children}
5+
</button>
6+
);
7+
}

hooks/useDebounce.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { useEffect, useState } from 'react';
2+
3+
export function useDebounce<T>(value: T, delay: number): T {
4+
const [debouncedValue, setDebouncedValue] = useState(value);
5+
6+
useEffect(() => {
7+
const handler = setTimeout(() => setDebouncedValue(value), delay);
8+
return () => clearTimeout(handler);
9+
}, [value, delay]);
10+
11+
return debouncedValue;
12+
}

lib/prisma.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { PrismaClient } from '@prisma/client'
2+
3+
const globalForPrisma = globalThis as unknown as {
4+
prisma: PrismaClient | undefined
5+
}
6+
7+
export const prisma =
8+
globalForPrisma.prisma ||
9+
new PrismaClient({
10+
log: ['query']
11+
})
12+
13+
if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma

0 commit comments

Comments
 (0)