Demo User Seeding
After the platform is running, seed the four standard demo users into the CTMS platform using a one-shot Python script that calls the Zynexa signup API. This mirrors the same approach as ctms-init and ctms-supabase-seed — a single Docker command that runs, seeds, and exits.
Prerequisites
- The CTMS platform stack is running (
docker compose up -d) - The
zynexaservice is healthy (http://localhost:3000/api/healthreturns 200) - You are in the
ctms.devopsdeployment directory
Run the Seed (Docker Compose — Recommended)
The ctms-user-seed service is defined in docker-compose.yml under the init profile. It builds from scripts/ctms-seed/Dockerfile and connects to the zynexa service over ctms-network.
# One-off run (builds locally if image not present)
docker compose --env-file .env.production run --rm ctms-user-seed
Or together with the other init containers:
docker compose --env-file .env.production --profile init up ctms-user-seed
ctms-user-seed has depends_on: zynexa (service_healthy) so it waits for the app to be ready before posting.
Expected Output
Target: http://zynexa:3000/api/v1/user/signup
Seeding 4 user(s)...
✅ kiran.v@zynomi.com → Platform Administrator
✅ michael.x@zynomi.com → Study Coordinator
✅ roshini.s@zynomi.com → Study Designer
✅ peter.p@zynomi.com → Principal Investigator
Done. 4 succeeded, 0 failed.
Demo Users Created
| Name | Role | Password | |
|---|---|---|---|
| Kiran Vikranth | kiran.v@zynomi.com | Platform Administrator | Welcome@1234 |
| Michael Xavier | michael.x@zynomi.com | Study Coordinator | Welcome@1234 |
| Roshini Sharma | roshini.s@zynomi.com | Study Designer | Welcome@1234 |
| Peter Parker | peter.p@zynomi.com | Principal Investigator | Welcome@1234 |
These are synthetic demo credentials for local development and demo environments. Do not use in production. Change or remove them after initial setup.
Run Locally (Without Docker)
If you are running the stack locally with bun run dev (non-Docker), the zynexa hostname won't resolve. Use the compose service with the host network instead:
docker compose --env-file .env run --rm \
--network host \
ctms-user-seed
Or call the script directly with Python (no extra deps — stdlib only):
cd scripts/ctms-seed
API_HOST=http://localhost:3000 python3 seed_users.py
What the Script Does
The script POSTs each user to POST /api/v1/user/signup on the zynexa service:
{
"email": "kiran.v@zynomi.com",
"password": "Welcome@1234",
"first_name": "Kiran",
"last_name": "Vikranth",
"gender": "Male",
"mobile_no": "+91 999-999-991",
"user_type": "System User",
"roles": [{ "role": "Platform Administrator" }],
"send_welcome_email": 0
}
- Uses Python stdlib only — no pip install needed inside the container
- Exits
0on full success,1if any user fails - Logs each result with ✅/❌ to stdout
Relationship to Other Init Steps
This seed runs after the core provisioning steps:
| Step | Command | What it provisions |
|---|---|---|
| Frappe provisioning | docker compose --profile init up ctms-init | DocTypes, RBAC, master data |
| Supabase tables | docker compose --profile init run --rm ctms-supabase-seed | Auth tables, RLS, functions |
| Demo users | docker run ... python /scripts/seed_users.py | 4 demo user accounts |