Skip to content

jsoncode/nextjs-website-template

Repository files navigation

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

创建项目

npx --yes create-next-app"@latest" . --ts

Getting Started

First, run the development server:

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

server run

# 全局安装 PM2(进程管理器,保证服务常驻)
npm install -g pm2

# 启动 Next.js 应用
pm2 start npm --name "website" -- run start

# 查看运行状态
pm2 list
pm2 logs website

# 更新代码后重新部署
git pull
npm install
npm run build
pm2 restart website

# 开机自启 PM2
pm2 startup
pm2 save

nginx 反向代理

server {
    listen 80;
    server_name your-domain.com;

    location / {
        proxy_pass http://localhost:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
    }
}

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

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.

Tailwind 的响应式前缀:

前缀 屏幕尺寸
sm: ≥640px
md: ≥768px
lg: ≥1024px
xl: ≥1280px
2xl: ≥1536px

About

nextjs15.5.6 , mongodb 6.20.0 and react 19.2.0

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published