From nothing to a first run: start the engine, start mooflair, connect them, add your accounts and AI key, and run a template.
1. Start the engine
cd Script/engine
cp .env.example .env
Fill .env (see Engine configuration): at least ENGINE_SECRET, ENGINE_PUBLIC_URL=http://localhost:4000, ENGINE_CORS_ORIGIN=http://localhost:3000, LIBRARY_PATH, and BROWSER_CHANNEL=chromium on Apple Silicon.
npm run build:browser
npm run dev
Check it:
curl http://localhost:4000/runtime
You should get {"runtime":"11"}.
2. Start mooflair
cd Script/mooflair
cp .env.example .env
| Variable | Example | Meaning |
|---|---|---|
MONGODB_URI | mongodb://localhost:27017/mooflair | mooflair's database. |
LIBRARY_PATH | /Users/you/Mooflair/Library/mooflair | Files (mounted at /usr/src/app/library). |
NEXTJS_PORT, DOCKER_PORT, MONGO_* | Docker Compose ports and the MongoDB root user. |
npm install
npm run dev
npm run dev runs server.ts (Next.js plus the flow scheduler). Open http://localhost:3000 and sign up.
3. Connect the engine
As an admin, open Admin › Engine › Add engine: a Name, the Link (http://localhost:4000) and the Secret (the engine's ENGINE_SECRET). Ping should say "Engine is reachable". Flows, campaigns and accounts are placed on it the first time they run (switch one in its settings).
4. Add what flows use
- Dataset › Accounts: your 𝕏 account (username, password, optional 2FA secret) and/or Shopee account (a name, region). The flow's Sign in node signs them in on the first run (Shopee: scan the QR code in the live view). See .
- Dataset › AI: an OpenAI or DeepSeek key, load models, pick one, optionally set prices. See .
5. First run
- Studio › New flow › pick 𝕏 Auto Reply (or Shopee Product Finder).
- Open the flow: its account options already point at your first account of each platform (Settings › Options to change). Pick the AI key in the nodes that show ⚠.
- Press Test run. Watch the canvas and open Logs › Preview, then Show preview in the middle of the view.
- When it asks for you (sign-in, captcha, QR code), do it in the live view and press Done (most checks notice by themselves).
- Happy with it? Press Run for a real run, or Publish it and run it from Operate › Campaigns with your accounts and a schedule ().
Tip: to sign in before running, hover a node and press the window icon (Open browser).
FAQ
The run stays on Queued for a minute.
The first run starts the browser's container (up to 90 s). Later runs reuse it until it's idle for 30 minutes.
Effect nodes didn't post anything.
That was a test run. Use Run (rocket) for a real run.
Settings that live in configuration.json
Settings that used to be environment variables are in library/configuration.json (the rule: settings and secrets go in the configuration, only ENCRYPTION_KEY_* stay in .env):
| Key | What | Default |
|---|---|---|
secret.jwt | Signs the sign-in cookie, tickets and run tokens | Made on first start (64 random bytes), kept in the file. Never shown in Admin. |
secret.drive.network | Engines join the Drive with it: copy it into each engine's .env as DRIVE_NETWORK_SECRET | Made on first start, kept in the file. Never shown in Admin. |
secret.drive.signing | Signs Drive file links (an hour) | Made on first start, kept in the file. |
flow.api.url | Where browser containers reach mooflair's run API | Empty: the site URL. Locally with the engine in Docker: http://host.docker.internal:3000 |
site.url | The app's own public URL (links in emails, OAuth redirect URIs, resume links, page metadata) | Admin › Configuration › Site |
{ "flow": { "api": { "url": "http://host.docker.internal:3000" } } }