# Production deployment

Target: `https://app.infitechglobalsolutions.com`

## Before uploading

1. Create an `A` record for `app.infitechglobalsolutions.com` pointing to the
   public IPv4 address of the Ubuntu server.
2. Allow inbound TCP ports `22`, `80`, and `443` in the hosting firewall.
3. Wait until the DNS record resolves to the server.

## Install

Upload the release ZIP to an Ubuntu 22.04 or 24.04 server, then run:

```bash
sudo apt-get update
sudo apt-get install -y unzip
sudo mkdir -p /opt/tankfarm-upload
sudo unzip tankfarm-infitech-production.zip -d /opt/tankfarm-upload
cd /opt/tankfarm-upload
sudo bash deploy/install-production.sh your-email@example.com
```

The installer:

- installs Node.js 20, Python, MySQL, Nginx, and Certbot;
- creates separate MySQL databases and random production secrets;
- builds all three frontends;
- serves the landing page at `/`, with applications under `/dashboard/`,
  `/supply/`, and `/consumption/`;
- runs only the two backend APIs as system services on loopback ports;
- requests and configures a Let's Encrypt certificate for the subdomain.

Initial credentials are written to
`/root/tankfarm-initial-credentials.txt` with permission mode `600`.

## Service commands

```bash
sudo systemctl status tankfarm-consumption tankfarm-supply nginx
sudo systemctl restart tankfarm-consumption tankfarm-supply
sudo journalctl -u tankfarm-consumption -f
sudo journalctl -u tankfarm-supply -f
```

The local footer service-control menu is intentionally hidden on the public
site. Production services must be managed through authenticated SSH.

## Important

The ZIP contains application source and database seed logic, not local `.env`
files, MySQL data, uploaded documents, logs, dependency directories, or editor
files. Change all initial passwords immediately after deployment.
