This is a Next.js project bootstrapped with create-next-app
.
boilerplate
The boilerplate branch contains the basic template code for the project. This provides a starting point for new development.
dev
The dev branch is used for ongoing development work. All new features and bug fixes are merged into dev during the development phase.
main The main branch contains the production-ready source code. This branch contains thoroughly tested code deployed onto production。
Data fetching See dev route:
- GET:服务端组件基本
- GET:服务端组件错误处理(实际上在examle层级实现error.tsx)
- GET:客户端组件
- GET:客户端组件(使用Route Handler)
- POST:Server Action
- POST:Server Action on Client
- POST:By Post route handler
(Use vscode settings to exclude the files) bunx prisma generate will generate zod schema from prisma schema. This is ignored in .gitignore: /prisma/generated/zod/index.ts. You should always delete the generated zod schema for better IDE performance Copy the code needed into @/lib/schema.ts when needed.
- fix google oauth
- multi oauth provider link to same email user
- account link logic: 1, pw first:add image to user 2, oauth first: add pw to user
- default loading page/skeleton components set
- use server action to login on social.tsx
- email verification flow
- oauth user has same email link to email user
- send register confirmation email
- implement DTO layer: https://nextjs.org/blog/security-nextjs-server-components-actions
https://m09tqret04o.feishu.cn/wiki/ULAawULUziLp0UkSkmUcl0sHn2f?from=from_copylink
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Second, setting up the .env file from .env.example
- Get a Mysql dev database locally running or cloud. Generate the database url for prisma.
- Setup nodemailer smtp
- Setup Oauth credentials for google and github
- other settings
Then, run prisma db push
, init database schema.
Open http://localhost:3000 with your browser to see the result.
This project uses next/font
to automatically optimize and load Inter, a custom Google Font.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.