diff --git a/CLAUDE.md b/CLAUDE.md index c741088d..769095c4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -45,7 +45,10 @@ ### What's In Progress - User preferences (export format default) -- Deployment to Railway/Render + +### Deployment +- **Production:** Railway (app.patherly.com / api.patherly.com) +- **PR Environments:** Enabled - auto-created for each pull request --- @@ -557,6 +560,43 @@ const response = await api.get('/api/v1/trees') --- +## Railway Deployment + +### Production +- **Frontend:** https://app.patherly.com +- **Backend:** https://api.patherly.com +- **Database:** Railway-managed PostgreSQL +- Deploys automatically on push to `main` + +### PR Environments +Railway creates isolated preview environments for each pull request. + +**Workflow:** +1. Create feature branch: `git checkout -b feature/my-feature` +2. Make changes, commit, push to origin +3. Open Pull Request on GitHub +4. Railway auto-creates preview environment (backend + frontend + DB) +5. **Generate domains manually** in Railway dashboard: + - Switch to the PR environment + - Click on each service → Settings → Networking → Generate Domain +6. **Set `VITE_API_URL`** on frontend service to point to the PR backend URL +7. Redeploy frontend if needed +8. Test at preview URLs +9. Merge PR → auto-deploys to production +10. Railway cleans up PR environment after merge + +**Environment Variables:** +- PR environments inherit from `production` base environment +- `REQUIRE_INVITE_CODE=true` is inherited (create invite codes in PR DB if needed) +- `DATABASE_URL` is auto-provided for isolated PR database + +**Notes:** +- Each PR gets a fresh database - no existing users/trees +- Migrations run automatically via `releaseCommand` +- Domains must be generated manually for each PR service + +--- + ## Contact **Primary User:** Michael Chihlas