Skip to content

linzheng99/next-nest-template-turbo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

next-nest-template-turbo

Start

npm install
npm run dev

tip: secret key generate by openssl rand -base64 32

Nest

create .env file

# Database
DATABASE_URL="mysql://root:xxx@localhost:xxx/xxx"

# JWT
JWT_SECRET=
JWT_EXPIRES_IN="2d"

# JWT Refresh Token
JWT_REFRESH_SECRET=
JWT_REFRESH_EXPIRES_IN="7d"

# ?Google OAuth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CALLBACK_URL=

# ?internet http agent ip
HTTP_PROXY=

Next

create .env file

NEXT_PUBLIC_API_URL=http://localhost:8000

SESSION_SECRET_KEY=

constants.ts 修改一些常量 比如 cookie 名称等

export const AUTH_COOKIE = "xxxx"

prisma

model User {
  id                 String         @id @default(uuid())
  email              String         @unique
  password           String
  name               String
  hashedRefreshToken String?
  isActive           Boolean        @default(true)
  role               Role           @default(USER)
  createdAt          DateTime       @default(now())
  updatedAt          DateTime       @updatedAt
}

enum Role {
  ADMIN
  USER
}

About

next with next

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published