Skip to content

Arce0406/template-nextjs-basic

Repository files navigation

Next.js Template

一個 Next.js 13 的模板,包含/使用了以下功能與模組:
Next.js13テンプレートには、次の機能とモジュールが含まれています:
A Next.js 13 template that contains/uses the following features and modules:

  • package manager:pnpm
  • web framework:Next.js 13
    • Using:App Router & src/ directory
    • Using:ESLint
    • Using:TypeScript
    • Using:Tailwind CSS
  • The ui library:shadcn-ui.
  • Themes management:next-themes
  • Database orm using prisma
  • Icons:lucide-react
  • Authorize:Next-Auth
  • i18n:next-intl

ENV

Create a .env file in root folder

# prisma setting
DATABASE_URL=""

# next-auth setting
NEXTAUTH_SECRET=""
NEXTAUTH_URL="https://localhost:3000"

# next-auth discord provider setting
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""

Commands

Create Next.js project

npx create-next-app@latest

Prisma

# Add prisma
pnpm add prisma --save-dev
npx prisma init --datasource-provider mongodb
# This command introspects our database and writes the inferred schema into your prisma/schema.prisma file
npx prisma db pull
# Push changes in your prisma/schema.prisma file to database
npx prisma db push
# Prisma built-in GUI
npx prisma studio
# Add prisma client
pnpm add @prisma/client
npx prisma generate

Others

# next-themes
pnpm add next-themes

# shadcn-ui
pnpm dlx shadcn-ui@latest init

# Lucide React
pnpm install lucide-react

# next-intl
# https://next-intl-docs.vercel.app/docs/getting-started/app-router-server-components
pnpm add [email protected]

Getting Started

First, run the development server, then open https://localhost:3000 with your browser to see the result.

pnpm dev

Fonts

This project uses next/font to automatically optimize and load Inter, a custom Google Font.

Learn More

Next.js

To learn more about Next.js, take a look at the following resources: