Skip to content

dev-rohit-gupta/auto-feedback-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PRMITR ERP Feedback Automation

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.

Features

  • 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

Quick start

Prerequisites:

  • Node.js 18+ and npm

Install dependencies:

npm install

Configure environment:

  1. Copy .env.example to .env and adjust values
Copy-Item .env.example .env
  1. Edit .env (PORT, SMTP if you want email, etc.)

Run the server:

npm start

Open the UI:

Usage

Web UI

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.

API

POST /api/feedback

Body (JSON):

{
  "username": "24BTIT1019",
  "password": "<password>",
  "selectionMode": "random",
  "email": "name@example.com"
}

Response:

{ "message": "Feedback received" }

Configuration

  • PORT: Server port (default: 3000)
  • HEADLESS: true|false for Puppeteer headless mode
  • BROWSER_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)
  • selectionMode
  • headless

How it works

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 (fillFeedback in main.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 wiring
  • public/index.html – Responsive web form
  • queue.js – Concurrency‑limited in‑memory queue
  • main.js – Puppeteer automation (login, navigation, submission)
  • lib/util.js – Helper utilities for Puppeteer actions
  • config.js – Automation defaults

Scripts

{
  "start": "node server.js",
  "start:debug": "node server.js --debug",
  "start:visible": "node --env-file=.env server.js --visible"
}

Run:

npm start

Tips & troubleshooting

  • Chrome path: if Puppeteer cannot find a browser, set BROWSER_PATH in .env.
  • Headless mode: set HEADLESS=false for debugging to see the browser.
  • Captcha/flows: site changes may require selector updates in main.js and lib/util.js.
  • Concurrency: adjust via new FeedbackQueue({ concurrency: 10 }) in server.js.

Security note

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.

License

ISC License. See LICENSE if included, or adapt to your needs.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors