Skip to content

Deployment

umutxyp edited this page Oct 17, 2026 · 2 revisions

Deployment

The Beatra website is a standard Next.js 15 app. You can deploy it to Vercel, to any Node.js server or VPS, or to any platform that supports Next.js 15 with middleware. No environment variables are required.


Before you deploy

  • Set baseURL in src/resources/seo.js to the real domain. It is used for canonical links, hreflang alternates and Open Graph URLs.
  • Set your links in src/resources/constants.js (invite, support, premium, vote, GitHub, socials).
  • Replace public/img/og-image.png (1200 × 630), the logos and the favicons if the site is not Beatra.
  • Replace the Terms of Service and Privacy Policy text if the site is not Beatra.
  • Run a production build locally and fix any error:
    npm run build

Option 1: Vercel

Vercel detects Next.js automatically. The settings from the README:

Setting Value
Install command npm install
Build command npm run build
Output Next.js default
Environment variables None

Steps:

  1. Push the project to your own GitHub repository (or fork the original).
  2. In Vercel, choose Add New → Project and import the repository.
  3. Keep the detected Next.js framework preset and the settings above, then click Deploy.
  4. Add your domain under the project's Domains settings, and make sure baseURL in seo.js matches it.

Every push to the connected branch triggers a new deployment.

Note: Vercel no longer builds with Node.js 20 (since 2026-10-01). You do not need to change anything for this: package.json sets "engines": { "node": ">=22" }, and Vercel uses that field instead of the project's Node.js Version setting, so it builds with the newest Node.js version Vercel supports. See Troubleshooting if a deployment still fails.


Option 2: Node.js server or VPS

Any machine with Node.js 22 or newer can run the site with the repo's own scripts.

1. Install and build

git clone https://github.com/umutxyp/Discord-Bot-Website.git
cd Discord-Bot-Website
npm install
npm run build

2. Start

npm run start

The server listens on port 3000 by default. To use another port, pass Next.js's -p option:

npm run start -- -p 8080

Next.js also reads the port from a PORT environment variable (PORT=8080 npm run start). Many hosting platforms set PORT for you, and next start picks it up without any change to the repo.

3. Keep it running (optional)

The repo does not include a process manager setup. If you want the site to restart on crashes and reboots, a common choice is PM2:

npm install -g pm2
pm2 start npm --name beatra-site -- run start
pm2 save
pm2 startup

pm2 startup prints a command; run it once to register PM2 with your system's startup.

4. Put a reverse proxy in front (optional)

To serve the site on port 80/443 with your domain, forward traffic from a web server to port 3000. A minimal nginx server block:

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Add HTTPS with your usual tool (for example Certbot). The Accept-Language header and the locale cookie pass through the proxy unchanged, so language detection keeps working.

5. Updating

git pull
npm install
npm run build
pm2 restart beatra-site   # or stop and start `npm run start` again

Note: The site needs Node.js 22 or newer (the engines field in package.json). Run node -v on the server before you update: on an older version npm install only prints an EBADENGINE warning and carries on, so upgrade Node.js first.

Note: The repository has no package-lock.json, so npm install on the server may resolve newer patch or minor versions than on your machine. Committing your own lock file in your fork keeps them identical.


Windows servers

The same commands work in PowerShell or Command Prompt:

npm install
npm run build
npm run start

To set the port through the environment in PowerShell, use $env:PORT=8080; npm run start (the PORT=8080 npm run start form only works in Unix shells).


What is not included

Option Status
Dockerfile / Docker Compose Not in the repo.
Static HTML export (output: "export") Not configured. The site relies on src/middleware.js for the language redirect, and middleware needs a Next.js server or a platform that runs it.
Environment variables None are read, so there is nothing to set.

After deploying

  • Open / and confirm it redirects to a language path.
  • Switch languages in the header and reload: the choice should stick (the locale cookie).
  • Share a page link in Discord or another app to check the Open Graph preview (/img/og-image.png).
  • Visit /en/premium and click a plan button: it should open your PREMIUM_URL.

Clone this wiki locally