> For the complete documentation index, see [llms.txt](https://framework.pokerscript.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://framework.pokerscript.net/deployment/backend.md).

# Backend

To deploy the admin source code, verify that all dependencies are installed and configurations are appropriately set.  For first-time installations, it is recommended to use the database dump file shared by Pokerscript in the deliverables. Then, proceed with the step-by-step guide for seamless deployment.

1. Get your copy of the Project Source File (Backend Source Code) and the database dump file from [Pokerscript](mailto:undefined).
2. **(or) Clone the Project Repository**: Use the `git clone` command to clone the project repository provided by the developer.

   ```bash
   bashCopy codegit clone <repository_url> /home/ubuntu/folder-name
   ```

   Replace `<repository_url>` with the URL of the Git repository provided by the [Pokerscript](mailto:undefined).
3. **Move Project Folder Inside `/home/ubuntu/` Directory**\
   Use the `mv` command to move the project folder into the `/home/ubuntu/` directory. Replace `folder-name` with the name of your folder.

   ```
   mv /path/to/your/project-folder /home/ubuntu/folder-name
   ```
4. **Install npm Packages**\
   Navigate into your project directory and run `npm install` to install the necessary dependencies.

   ```
   cd /home/ubuntu/folder-name
   npm install
   ```
5. **Start Your Node.js Application with pm2**\
   Run your Node.js application using pm2. Make sure `index.js` is your entry point file.

   ```
   pm2 start index.js
   ```
6. **Check pm2 Logs**\
   To check the logs for your running application, use the following command:

   ```
   pm2 logs
   ```
7. **Check pm2 Status**\
   Verify the status of your application to ensure it's running properly:

   ```
   pm2 status
   ```
8. **URL Testing**\
   Open your preferred web browser and navigate to your server's IP address or domain name followed by the port your application is running on. For example:

   ```
   http://your-server-ip:port
   ```
9. Replace `your-server-ip` with your server's IP address and `port` (3030) with the port number your application is listening on.

That should cover all the steps you need to take! If you encounter any errors or need further assistance, feel free to ask.
