Automate feedback form submissions to PRMITR ERP via a friendly web UI and a concurrency‑limited job queue. Submissions run with Puppeteer in headless Chrome and can optionally send an email acknowledgment.
— Built with Node.js, Express, EJS/static HTML, and Puppeteer.
- Beautiful, responsive web form (username, password, selection mode, email)
- In‑memory queue with concurrency control (default 5–10 at a time)
- Headless browser automation with Puppeteer
- Optional email notification when a request is received
- API endpoint for programmatic submissions
Prerequisites:
- Node.js 18+ and npm
Install dependencies:
npm installConfigure environment:
- Copy
.env.exampleto.envand adjust values
Copy-Item .env.example .env- Edit
.env(PORT, SMTP if you want email, etc.)
Run the server:
npm startOpen the UI:
- http://localhost:3000 (or your configured PORT)
Open the homepage and fill:
- Enrollment Number (username)
- Password
- Selection Mode: excellent | average | poor | random
- Email (to receive a received‑request email)
After submit, your job is queued and processed automatically.
POST /api/feedback
Body (JSON):
{
"username": "24BTIT1019",
"password": "<password>",
"selectionMode": "random",
"email": "name@example.com"
}Response:
{ "message": "Feedback received" }PORT: Server port (default: 3000)HEADLESS:true|falsefor Puppeteer headless modeBROWSER_PATH: Optional path to Chrome/Chromium for Puppeteer- Email (optional):
SMTP_HOST,SMTP_PORT,SMTP_USER,SMTP_PASS,SMTP_FROM BASE_URL: Public base URL (used in links/emails, optional)
The file config.js also contains defaults for:
url(PRMITR ERP site)selectionModeheadless
High‑level flow:
- Express serves the static UI (
public/index.html). - Submissions call the API (
/api/feedback). - Each request is added to an in‑memory
FeedbackQueue(queue.js) with a configurable concurrency. - The worker function (
fillFeedbackinmain.js) launches Puppeteer and completes the form flow. - Optional: an acknowledgment email is sent on receipt.
Key files:
server.js– Express app, API routes, queue wiringpublic/index.html– Responsive web formqueue.js– Concurrency‑limited in‑memory queuemain.js– Puppeteer automation (login, navigation, submission)lib/util.js– Helper utilities for Puppeteer actionsconfig.js– Automation defaults
{
"start": "node server.js",
"start:debug": "node server.js --debug",
"start:visible": "node --env-file=.env server.js --visible"
}Run:
npm start- Chrome path: if Puppeteer cannot find a browser, set
BROWSER_PATHin.env. - Headless mode: set
HEADLESS=falsefor debugging to see the browser. - Captcha/flows: site changes may require selector updates in
main.jsandlib/util.js. - Concurrency: adjust via
new FeedbackQueue({ concurrency: 10 })inserver.js.
Submitted credentials are used solely for automated login within your environment. Do not deploy publicly without appropriate controls. Consider adding rate‑limits, HTTPS, and secure secret management.
ISC License. See LICENSE if included, or adapt to your needs.