RJBULK-APP/scripts/shoot-after-migrate.mjs
SJCoetz 1efa979443 feat: initial setup of rj bulk supplies backoffice app
Adds complete initial codebase for the RJ Bulk Supplies fuel delivery backoffice:
- Authentication pages and protected route layouts
- Customer, supplier, fuel purchase, and delivery note management
- Custom reporting and customer statement sending tools
- Full UI component library and Tailwind styling
- Server actions, API routes, and PocketBase integration
- Development scripts and project configuration updates
- Updated README and package metadata
2026-07-19 20:38:16 +02:00

31 lines
1.3 KiB
JavaScript

import puppeteer from "puppeteer-core";
const browser = await puppeteer.launch({
executablePath: "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome",
headless: "new",
args: ["--no-sandbox", "--disable-gpu"],
});
const page = await browser.newPage();
await page.setViewport({ width: 1280, height: 900 });
const res = await fetch("http://pocketbase-zinlbpsext2ro0lgb2558vfy.169.239.180.130.sslip.io/api/collections/users/auth-with-password", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ identity: "david@rjbulk.local", password: "ChangeMe123!" }),
});
const { token } = await res.json();
await page.setCookie({ name: "pb_auth", value: token, domain: "localhost", path: "/" });
await page.goto("http://localhost:4004/customers", { waitUntil: "networkidle2" });
await page.screenshot({ path: "/tmp/rjbulk-screens/30-customers-after-migrate.png" });
console.log("✓ customers list");
await page.goto("http://localhost:4004/pricing", { waitUntil: "networkidle2" });
await page.screenshot({ path: "/tmp/rjbulk-screens/31-pricing-after-migrate.png" });
console.log("✓ pricing");
await page.goto("http://localhost:4004/suppliers", { waitUntil: "networkidle2" });
await page.screenshot({ path: "/tmp/rjbulk-screens/32-suppliers-after-migrate.png" });
console.log("✓ suppliers");
await browser.close();