Remove ProcureFlow/Celery legacy, Cursor rules bundle, and scratch artifacts; add claim API routes, deploy docs with auto-deploy, and a claim-focused README. Co-authored-by: Cursor <cursoragent@cursor.com>
1.9 KiB
1.9 KiB
Deploy Claim App on Cloudflare + MongoDB Atlas
1. MongoDB Atlas
- Create a free M0 cluster.
- Database user + password.
- Network access: allow Cloudflare egress or
0.0.0.0/0for initial setup. - Copy connection string →
MONGO_URL, setDB_NAME=claim.
2. Cloudflare R2
- Create bucket (e.g.
claim-files). - Create API token with Object Read & Write.
- Set
R2_*variables on the API host (seebackend/.env.example).
3. Google OAuth
- Google Cloud Console → OAuth client (Web).
- Authorized redirect URI:
https://api.YOUR_DOMAIN/api/auth/google/callback - Set
GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET,GOOGLE_REDIRECT_URIon API. - Set
FRONTEND_URL=https://YOUR_DOMAINand matchingCORS_ORIGINS.
4. API host (FastAPI)
Cloudflare Workers do not run this Python stack natively. Options:
- Recommended v1: Run
uvicorn server:appon Fly.io, Railway, or a small VM; pointREACT_APP_BACKEND_URLto that URL. - Set all
backend/.envvariables on the host.
cd backend
pip install -r requirements.txt
uvicorn server:app --host 0.0.0.0 --port 8001
5. Frontend — Cloudflare Pages
cd frontend
yarn install
REACT_APP_BACKEND_URL=https://api.YOUR_DOMAIN yarn build
npx wrangler pages deploy build --project-name=claim-app
frontend/public/_redirects enables SPA routing.
6. Custom domain
- Pages:
claims.yourcompany.com→ Cloudflare Pages project. - API:
api.yourcompany.com→ your API host (CNAME).
7. Android APK (Capacitor)
cd frontend
yarn add @capacitor/core @capacitor/cli @capacitor/android
npx cap init "Claim App" com.yourcompany.claim --web-dir build
yarn build
npx cap add android
npx cap sync android
npx cap open android
In capacitor.config.ts, set server.url to your production web URL for live reload, or ship static assets in the APK.