OpusCRM Desktop
================

What this is
------------
A dedicated desktop shell for the OpusCRM web app. Each Brezzels creator
account you switch to inside the CRM is loaded in its own isolated Chromium
session (a "partition"), so you can be signed into all 44 models at the
same time without cookies stepping on each other.

You never see or type any creator's password — the app fetches the
encrypted credential from your backend when you click Auto-login, then
fills the Brezzels form inside the isolated session and forgets it.

How to run
----------
Windows:
  Double-click START-OPUSCRM.bat
  (The first launch installs dependencies; ~2 minutes. Subsequent launches
   are instant.)

macOS:
  Double-click start-opuscrm.command
  (The .command extension is the macOS-native way to double-click a shell
   script. Finder opens it in Terminal automatically — no right-click, no
   "Open with", no TextEdit.)

  First-time-only permission prompt: macOS may show "cannot be opened
  because it is from an unidentified developer". If so, right-click →
  Open once and confirm. After that, plain double-click works forever.

  If Terminal reports "permission denied", run once:
    chmod +x start-opuscrm.command

Linux:
  Double-click start-opuscrm.command in your file manager (GNOME / KDE /
  Nautilus all recognise executable shell scripts).
  Or from a terminal:
    cd opuscrm-desktop
    ./start-opuscrm.command

  If Terminal reports "permission denied", run once:
    chmod +x start-opuscrm.command

Requirements
------------
Node.js 18+ LTS  →  https://nodejs.org

Where things live
userData storage
----------------
OpusCRM stores every model's Brezzels session (cookies, cache) in the OS-standard
per-user data folder so sessions survive re-extracting the ZIP, app updates and
moving the app around your Downloads.

  Windows:  %APPDATA%\OpusCRM   (e.g. C:\Users\<you>\AppData\Roaming\OpusCRM)
  macOS:    ~/Library/Application Support/OpusCRM
  Linux:    ~/.config/OpusCRM

Wipe that folder to sign every model out at once. Set the environment variable
OPUSCRM_USER_DATA to a custom absolute path if you need portable storage
(e.g. on a USB stick).

Files inside the ZIP
--------------------
main.js            — Electron main process; owns credentials and session partitions
preload.js         — bridge exposed to the OpusCRM web UI as window.crm
config.json        — backendUrl / webUIUrl (edit if you self-host the CRM)
package.json       — dependencies
build/icon.png     — app icon

Troubleshooting
---------------
- "Auto-login failed: inputs_not_found" — Brezzels changed their login form.
  The main process logs the first few inputs it saw. Send that string to
  support so we can update the selector.
- Blank/black window — check that config.json's backendUrl is reachable
  from your machine.
- "logged out after restart" — the app was earlier storing data next to the
  ZIP inside Downloads and lost it on re-extract. As of v1.5 the app writes
  to %APPDATA%\OpusCRM (Windows) / ~/Library/Application Support/OpusCRM
  (macOS), which survives updates automatically.
- To wipe a model's session (log out on this computer), use "Clear session"
  in the model toolbar in the CRM.

Contact
-------
Your OpusCRM administrator.
