PPPAIMT - Crest
Go to file
Amey Bhagwat 51f99134c3 # changed city and state field mandatory for Survey questions. 2026-11-20 18:05:01 +05:30
backend # changed city and state field mandatory for Survey questions. 2026-11-20 18:05:01 +05:30
docs # added send bulk email for invitation and reminder 2026-11-20 15:05:08 +05:30
e2e Change in Login flow, now email should be validated against the list from doctors 2026-11-05 13:00:30 +05:30
files # added send bulk email for invitation and reminder 2026-11-20 15:05:08 +05:30
frontend # added send bulk email for invitation and reminder 2026-11-20 15:05:08 +05:30
help # changed city and state field mandatory for Survey questions. 2026-11-20 18:05:01 +05:30
scripts first commit 2026-10-07 16:32:11 +05:30
.gitignore chages for email 2026-11-20 12:31:21 +05:30
README.md # added send bulk email for invitation and reminder 2026-11-20 15:05:08 +05:30
ecosystem.config.cjs first commit 2026-10-07 16:32:11 +05:30
eslint.config.js first commit 2026-10-07 16:32:11 +05:30
nginx.conf first commit 2026-10-07 16:32:11 +05:30
package-lock.json Change in Login flow, now email should be validated against the list from doctors 2026-11-05 13:00:30 +05:30
package.json Change in Login flow, now email should be validated against the list from doctors 2026-11-05 13:00:30 +05:30
playwright.config.js first commit 2026-10-07 16:32:11 +05:30

README.md

Extended-Dose Pack Study

Web app for CREST Private Limited. Physicians sign a consultation agreement, admins review it, and approved physicians receive a survey link.

This repository is an npm workspaces monorepo:

  • backend — Hapi API
  • frontend — React app (Vite)
  • docs — deployment notes

Requirements

  • Node.js 20 or newer
  • npm 10 or newer

MySQL 8 is required for migrations, admin login, and the test suite. The health check itself does not query the database. Tests use a separate database named ppaimt_crest_test on the same host, port, and user as backend/.env.

Setup

cp backend/.env.example backend/.env
cp frontend/.env.example frontend/.env
npm install

Run

npm run dev

The Vite dev server proxies /api to port 4000.

Frontend only

If you are not running the local API, proxy /api to the hosted backend:

npm install
npm run dev:frontend

Then open http://localhost:5173. Requests to /api go to https://pppaimt-crest.xltr.in. Do not submit live agreements unless you intend to change production data.

Database

Create the application database, then:

npm run migrate
ADMIN_EMAIL=admin@example.com ADMIN_PASSWORD='a-long-password' npm run seed:admin

JWT_SECRET must be at least 32 characters. The admin cookie is httpOnly.

Checks

npm test
npm run lint
npm run build

npm run build writes the frontend to frontend/dist.

Deploy

See docs/DEPLOY.md for Ubuntu on EC2, Nginx, PM2, RDS, and S3.

Import doctors from a CSV file

File path: files/import/*.csv. From the repo root:

npm run import:doctors -- import-doctors-18-11-2026.csv

Admin invitation / reminder emails

Admin → Send emails targets active doctors only (pppaimt_doctors.status). Reminder also requires at least one pending study step.

For local testing without mailing the full list, set BULK_EMAIL_ALLOWLIST in backend/.env (comma-separated emails), restart the API, then clear it again. Leave it unset on the server so all active doctors are included.