# Step by Step Guide to build and push to MoDPR

This folder has the Desktop launcher for your OS and this guide.

| OS | Run |
|----|-----|
| Linux | `chmod +x MoDPR-Desktop.sh && ./MoDPR-Desktop.sh` (do not use sudo) |
| macOS | `chmod +x MoDPR-Desktop.command && ./MoDPR-Desktop.command` |
| Windows | Double-click `MoDPR-Desktop.bat` (not Run as administrator) |

The launcher checks Docker, then opens MoDPR Desktop. Then follow the steps below.

Placeholders (do **not** type these words): `YOUR_USER` is your Register / `modpr login` username, `your-image` is the image name you choose, `v1` is the tag, `/path/to/app` is the folder that contains the Dockerfile. All lowercase. Do **not** put the registry host in `-t`.

**Pattern:** `-t` is always `YOUR_USER/your-image:v1` — the same name as `modpr login`, then `/`, then any image name and tag.

Live Hub: **https://modpr.modevops.fun** · Product docs: **https://modpr.modevops.fun/docs**

---

## 0. CLI (once)

```bash
mkdir -p ~/.local/bin
curl -fsSL -o ~/.local/bin/modpr \
  https://modpr.modevops.fun/download/cli
chmod +x ~/.local/bin/modpr
export PATH="$HOME/.local/bin:$PATH"
```

Windows: run those commands in WSL or Git Bash — `modpr` is a shell script, not a `.exe`.

---

## 1. Register

Register at https://modpr.modevops.fun — username = `YOUR_USER`. Same password for the website and `modpr login`.

---

## 2. Point the CLI at this Hub (every terminal)

```bash
export MODPR_URL=https://modpr.modevops.fun
```

---

## 3. Login

```bash
modpr login YOUR_USER
```

Run that command **alone**, then type the password at the hidden prompt. After login, use **that** username:

```bash
export MODPR_URL=https://modpr.modevops.fun
cd /path/to/app
modpr build -t YOUR_USER/your-image:v1 .
modpr push YOUR_USER/your-image:v1
modpr deploy YOUR_USER default staging web YOUR_USER/web:v1
modpr paas ps YOUR_USER default staging
```

Then open Hub signed in as `YOUR_USER`. You should see `YOUR_USER/your-image:v1`. Image management shows digest, size, and the filesystem layer stack. Tags shows named tags and `modpr pull`. Push origin shows the country of that client public IP. Private image cards use the MoDPR mascot. The site logo is **MoDPR hub**. The header register button is **Create account**; home buttons say **Create an account**. **Start** on a card runs the image on the host engine (sign in first).

---

## 4. Optional local run

```bash
cd /path/to/app
docker build -t your-image:v1 .
docker run --rm -p 8000:8000 your-image:v1
```

---

## 5–6. Build and push

```bash
cd /path/to/app
export MODPR_URL=https://modpr.modevops.fun
modpr build -t YOUR_USER/your-image:v1 .
modpr push YOUR_USER/your-image:v1
```

---

## 7. Confirm

https://modpr.modevops.fun/app/hub (signed in as `YOUR_USER`)

---

## Fail / Fix

| Fail | Fix |
|------|-----|
| `modpr: command not found` | step 0 + `PATH` |
| push to `localhost:8080` | `export MODPR_URL=https://modpr.modevops.fun` |
| `denied` / `403` | `modpr login`; `-t` must start with **your** username |
