# EPIP - Echo Prayer Integration Project (epip.compedgesolutions.us)

Standalone multi-tenant relay service between church-website prayer forms
(Squarespace/Wix/WordPress embeds) and the Echo Prayer API. Extracted from the
single-tenant relay inside emmanuellc.org after the 2026-08-01 outage that broke
the Emmanuel Lutheran Church prayer form silently.

**The authoritative build spec is `docs/project-scope.md`. Read it fully before
writing any code.** This file adds only the decisions made after that spec was
drafted, plus fleet conventions the spec assumes.

## Decisions resolved since the spec was drafted

1. **Naming (spec section 9, open question 1): RESOLVED.** The project and Phase 1
   subdomain are `epip.compedgesolutions.us` (EPIP = Echo Prayer Integration
   Project). Ignore the spec's `prayerlink`/`echorelay` placeholder suggestions.
   A consumer-facing brand name remains a Phase 2/3 question for Steve.
2. **Gitea dependency paths (spec section 2): CONFIRMED 2026-08-03.** Both exist:
   - `ssh://git@git.compedgesolutions.us:2222/CompEdgeSolutions/spam-shield.git`
   - `ssh://git@git.compedgesolutions.us:2222/CompEdgeSolutions/emmanuellc.org.git`
   Point composer at the Gitea spam-shield URL. Never any GitHub URL anywhere.
3. **Monitoring (spec section 5 uptime note): the fleet now has its own status
   monitor**, built 2026-08-03 at status.compedgesolutions.us. Phase 1 "done"
   includes: ship `api/health.php` in this project and register EPIP monitors,
   following `docs/adding-monitors.md` in the status.compedgesolutions.us repo
   (health endpoint template, json_field assertions, dns/ssl/keyword layers,
   client contact wiring). Do not use UptimeRobot for this.

## Key coordinates

| What | Where |
|------|-------|
| Owner host (build agent) | Larry (Pi 5, 8 GB), repo at /home/larry/htdocs/epip.compedgesolutions.us |
| Reference implementation | emmanuellc.org repo, cloned at /home/larry/htdocs/emmanuellc.org (read-only reference; do not modify) |
| Local Windows clone | e:\xampp\htdocs\epip.compedgesolutions.us |
| Git home | ssh://git@git.compedgesolutions.us:2222/CompEdgeSolutions/epip.compedgesolutions.us.git |
| Production | https://epip.compedgesolutions.us on 146.190.73.121 (webroot /var/www/epip.compedgesolutions.us) |
| Database | `epip_db` on droplet MySQL; users `epip_app` (localhost). Note the spec's warning about the managed-cluster capacity: use droplet-local MySQL like nuknuknuk and status_db do. |
| Env files | E:/xampp/private/epip.env local, /var/private/epip.env production, parse_ini_file() loader |
| Production PHP | 8.3 FPM. Write code PHP 8.1-compatible unless FPM 8.3 is confirmed on the vhost. |

## Fleet hard rules (apply on top of the spec)

1. No em dashes anywhere in code, copy, comments, or docs.
2. `parse_ini_file()` for platform secrets; tenant Echo Prayer keys live in the
   database per the spec. Never dotenv libraries.
3. feat/fix/chore branches, ISO 9001 commits, no-ff merge to main, push to Gitea,
   deploy via the project's `deploy.sh` on the droplet. Read
   `~/.claude/DEPLOYMENT_GUIDE.md` before first deploy.
4. Complete files and functions; no partial implementations.
5. Node.js for any tooling scripts; no Python.
6. Mobile-first for any admin UI (Tailwind CDN + Alpine is the house pattern).
7. Prayer request text is never persisted at the relay layer (spec section 5
   privacy note). Metadata only in `submission_log`, hashed IPs.
8. DNS for epip.compedgesolutions.us does not exist yet; Steve adds the A record,
   then certbot. Sequence it like any new subdomain.

## Where to start

1. Read `docs/project-scope.md` end to end.
2. Read the reference files listed in its section 2 from the local
   emmanuellc.org clone.
3. Build Phase 1 against the MVP definition in spec section 9, in this order:
   schema, core relay endpoint, spam stack, per-tenant CORS, embed generation
   (simplest theme first), internal admin, health endpoint plus status monitors,
   deploy, then the byte-equivalence smoke test against the existing ELC feeds.
4. Spec section 8 open questions 2-5 remain open. Flag to Steve when they block
   you; do not guess.

## Phase status

| Phase | Status |
|-------|--------|
| 1 Multi-tenant relay MVP | NOT STARTED |
| 2 Self-service SaaS | design-only constraint on Phase 1 data model |
| 3 Own brand/domain | future |
