3.5 KiB
MaalFlows Agent
Purpose: maintain the MaalFlows live chat widget and admin app.
Project Shape
- Main application file:
server.js. - Frontend assets:
public/widget.js,public/admin.js,public/admin.css,public/admin.html. - Runtime: Node.js without a framework, SQLite through
better-sqlite3. - Local check command:
npm.cmd run check. - Production app is proxied by nginx on
app.black-week.czto127.0.0.1:3400.
Work Rules
- Read the relevant code before editing.
- Keep changes small and focused on the user's request.
- Do not touch
.agents/sogo-mail-filter-agent.mdordocs/mail-sogo-*files unless the task is explicitly about SOGo mail filters. - Preserve existing user changes. Do not reset, checkout, or delete unrelated work.
- For language/translation changes, protect conversation-level customer language from short greetings, product names, SKUs, colors, and other language-neutral text.
Verification
Before finishing a code change, run:
npm.cmd run check
If a broader behavioral change is made, add or run the smallest practical extra verification for that area.
Git Workflow
Project remote:
https://git.ma-al.com/rajch_ales/MaalFlows.git
The main branch is main.
After each completed project code change:
- Review
git diff. - Stage only files that belong to the change.
- Commit with a concise message.
- Push the current branch to
origin. - Report what was changed, what was verified, and whether the push succeeded.
Do not stage unrelated untracked files such as historical audits, screenshots, exports, or mail-filter documentation unless the user explicitly asks for them.
If Git authentication is needed, this project follows the same HTTPS credential style as D:\Codex\01-projekty\catalog-meaker-by-magic-ai: read GIT_USERNAME and GIT_PASSWORD from that project's local .env only for the command that needs them. Never print those values, commit them, save them into origin, or leave credentials embedded in Git config.
Production Update
After a successful push, update the production server.
Production details:
Host: app.black-week.cz
SSH user: root
SSH key: C:/Users/DELL/.ssh/druhakapitola_hetzner
App directory: /var/www/maalflows
PM2 process: maalflows
Public URL: https://app.black-week.cz/admin
Deploy workflow:
- SSH to
root@app.black-week.czwith thedruhakapitola_hetznerkey. - In
/var/www/maalflows, checkgit status --shortfirst. Stop if there are unexpected local changes. - Ensure server
originishttps://git.ma-al.com/rajch_ales/MaalFlows.git. - Fetch
origin main. If HTTPS credentials are required, provide them via a one-command temporary credential helper from the local catalog project's.env; do not store credentials on the server. - Run
git merge --ff-only FETCH_HEAD. - Run
npm install --omit=dev. - Run
npm run check. - Run
pm2 restart maalflows. - Run
pm2 save. - Verify:
cd /var/www/maalflows && git status --short
cd /var/www/maalflows && git log -1 --oneline
pm2 describe maalflows
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' http://127.0.0.1:3400/admin
curl -s -o /dev/null -w '%{http_code} %{content_type}\n' http://127.0.0.1:3400/widget.js
curl -k -s -o /dev/null -w '%{http_code} %{content_type}\n' https://app.black-week.cz/admin
Expected verification: PM2 status online, local /admin and /widget.js return 200, public HTTPS /admin returns 200, and the server worktree is clean.