Skip to content
Red-wolf0Public

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

This is a Next.js project bootstrapped with create-next-app.

Getting Started

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

PostgreSQL 注册登录配置

  1. 将 .env.example 复制为 .env.local,并填写 DATABASE_URL。
  2. 运行 npm run db:migrate。该命令由 Node.js 直接连接 PostgreSQL,不要求本机安装 psql,本地与线上环境都可使用。
  3. 启动项目后访问 /account,即可注册、登录和退出。

迁移文件位于 database/migrations/。每个迁移只会执行一次,执行记录和校验值保存在数据库的 schema_migrations 表中。上线时应在发布流程中先执行 npm run db:migrate,成功后再发布应用;不要把数据库迁移放进 Vercel 的每次 Serverless 请求。

密码使用 bcrypt 强哈希保存;浏览器只保存 HttpOnly、SameSite=Lax 的随机会话令牌,数据库仅保存令牌的 SHA-256 摘要。

You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.

This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.

Learn More

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

You can check out the Next.js GitHub repository - your feedback and contributions are welcome!

Deploy on Vercel

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.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages