> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theme.eslot.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# Site Build and Deploy

This guide walks you through the complete production-ready **build and deployment** process for the Eslot Prime Theme — a Next.js/React frontend, optimized for performance, SEO, and real-world usage with your iGaming backend.

Before deploying your Eslot Prime frontend, you should understand:

* **Next.js build output** and how it is optimized for production
* Supported deployment environments: **Self-hosted Node.js**, **Vercel**, **Docker**, and **Static Export**
* Common requirements for a stable and scalable deployment

## Deployment Options

There are multiple ways to host your Eslot Prime frontend. Choose based on your infrastructure.

* **Deploy on a Node.js Server (Self-Hosted)**\
  This approach gives full flexibility. Follow these steps:\
  **Upload Project to Server**\
  Use SCP, FTP, or Git deploy to upload your project (including the `.next` folder) to your server.\
  **Install Dependencies on Server**

  ```shellscript lines theme={"dark"}
  npm run build
  ```

  **Start Server**

  ```shellscript lines theme={"dark"}
  npm run start
  ```
* **Use Process Manager (e.g., PM2)**\
  To ensure high availability and auto-restart on failure, use PM2:

  ```shellscript PM installation process theme={"dark"}
  npm install pm2 -g
  pm2 start npm --name "eslot-prime" -- start
  ```

  if need, not mandetory, To remove an existing PM2 process:

  ```shellscript This setup helps keep your site running continuously as a managed Node.js process. theme={"dark"}
  pm2 delete eslot-prime
  ```
* **Deploy to Vercel (Recommended)**\
  [Vercel](https://vercel.com/) is the **official deployment platform for Next.js** and provides:

  * Global CDN
  * Zero config deployment
  * Instant preview deployments
  * Built-in optimization for Next.js features

  #### Steps

  1. Connect your GitHub / GitLab / Bitbucket repo
  2. Select your project
  3. Deploy instantly with default settings

  <Note>
    Free Hobby plans may throw intermittent errors (e.g., 504 Gateway Timeout) on long API calls. Upgrading your Vercel plan resolves this.
  </Note>
* **Static Export (Optional)**\
  Next.js supports exporting a static set of HTML/CSS/JS files:

  ```shellscript theme={"dark"}
  npm run build
  npm run export
  ```

  This produces a static version in the `/out` directory suitable for static hosts like **Netlify, GitHub Pages, or S3**.

  <Warning>
    Static export does not support dynamic Next.js features that require a Node.js server.
  </Warning>

## Common Deployment Tips

* Point your domain’s DNS to your host
* Configure proxy or SSL for HTTPS
* Ensure CORS and API URL settings are accurate

## Additional Resources

* Next.js official deployment docs — [https://nextjs.org/docs/pages/building-your-application/deploying](https://nextjs.org/docs/pages/building-your-application/deploying)
* Vercel deployment guide — [https://vercel.com/docs/concepts/deployments/overview](https://vercel.com/docs/concepts/deployments/overview)
* PM2 process manager docs — [https://pm2.keymetrics.io/](https://pm2.keymetrics.io/)
