|
|
||
|---|---|---|
| backend | ||
| frontend | ||
| README.md | ||
README.md
TGICS (The Great Indian Cough Study)
Doctor magic-link patient questionnaire for LifeMankind / Rapport.
- Frontend:
https://tgics.cttr.in/{user_id}/{contact_id} - Backend: Hapi + MySQL
- Rapport partition:
rapport-lifemankind
Structure
tgics/
backend/ # Node.js Hapi API
frontend/ # Vite + React
Backend
cd backend
cp .env.example .env
# set DB_* and RAPPORT_ACCESS_TOKEN
npm install
npm run dev
API defaults to http://localhost:3050.
| Method | Path | Purpose |
|---|---|---|
| GET | /health |
Health |
| GET | /api/doctors/{userId}/{contactId} |
Resolve enrolled doctor |
| POST | /api/surveys |
Save patient survey |
| GET | /api/surveys/counts?contact_ids=a,b |
Batch counts for Rapport |
| GET | /api/surveys/count?contact_id= |
Single count |
| POST | /api/auth/login |
Dashboard login |
| GET | /api/auth/me |
Current user (Bearer token) |
| GET | /api/dashboard/stats |
Survey stats (auth) |
| GET | /api/dashboard/surveys |
Recent surveys (auth) |
Dashboard users
On startup the API ensures a users table and seeds the first admin if missing:
- Email:
ravi@stratawiz.com - Password:
qwerty
Login UI: /login → /dashboard
Frontend
cd frontend
cp .env.example .env
npm install
npm run dev
Set VITE_API_BASE=http://localhost:3050.
Nginx (production sketch)
Serve the React build on tgics.cttr.in and proxy /api (and /health) to the Hapi process, or set VITE_API_BASE to a separate API host.
Rapport Laravel
Set TGICS_API_BASE in Laravel .env (e.g. https://tgics.cttr.in or http://localhost:3050). The enrolment form uses App\Helpers\TgicsHelper for survey counts.