If something breaks, start here
One page that tells the next person where the Med&X portal lives, how to tell if it's healthy, what to do when it isn't, and how to get the data back. No prior knowledge assumed.
Where everything runs
The whole system is four moving parts. Two servers (the portals), one database, one code home. All free-tier or low-cost, all reachable from a browser.
medx-user-portal, Node, free plan).medx-admin-portal, Node, free plan). This handbook is served from it.TURSO_DATABASE_URL.main). Pushing to main auto-deploys both Render services.Check that it's up
Two-minute health check, no login needed.
- Open the member portal in a browser. If the login screen loads, the app is up. (First hit after a quiet spell can take ~30s — that's the free-tier waking up, not a fault.)
- Add
/healthto a portal address in the browser bar. A page that says OK / healthy means the server and database are talking. An error means the server is down or can't reach Turso. - Sign into the admin portal → System Health for the fuller picture — database, email, payments, and recent errors in one screen.
- Open the Render dashboard — a green "Live" badge on each service is the source of truth. Red or "Deploy failed" tells you where to look.
If the portal is down
Work top to bottom. Stop as soon as it's back.
- Wait 30 seconds and reload. The free tier sleeps after 15 minutes idle, and the first visitor wakes it. This is the single most common "outage" and it's not one.
- Check Render. If the service is "Live" but slow, it's just waking. If it says Deploy failed, a recent code change broke the boot.
- Read the logs. In Render, open the service → Logs. The error at the bottom usually names the problem (a missing key, a database it can't reach).
- Roll back if a deploy caused it. In Render → the service → Events / Manual Deploy, choose Rollback to the last version that was Live. The portal comes back on the previous working code.
- Restart if it's stuck. Render → the service → Manual Deploy → Clear build cache & deploy, or use Restart. Boots that crash on
/healthauto-roll-back, so a restart is safe. - Still down? Check Turso (section 05) is reachable, then contact Alen (section 06) with a screenshot of the Render log.
main redeploys both portals./health returns OK. A broken deploy keeps the old, working version live automatically.Who has access
Keep this list current — it's how a new person knows who to ask for a login.
Backups & restore
All the real data (registrations, members, payments) lives in the Turso database. Backing it up means saving a copy of that database. Restoring means loading a copy back. You do this from a terminal with the Turso CLI.
First-time setup (once per computer):
# Install the Turso CLI, then log in
curl -sSfL https://get.tur.so/install.sh | bash
turso auth login
Make a backup (do this before anything risky):
# List databases to confirm the name
turso db list
# Dump the live database to a timestamped file on your machine
turso db shell <database-name> .dump > medx-backup-$(date +%Y%m%d).sql
Restore from a backup (only if data was lost):
# SAFEST: create a NEW database from the dump and verify it first
turso db create medx-restore-test
turso db shell medx-restore-test < medx-backup-20260704.sql
# Check the restored copy looks right, THEN point the portals at it
# by updating TURSO_DATABASE_URL in Render for both services.