Cloudflare Deployment
Fataplus is deployed entirely on Cloudflare infrastructure, utilizing Pages for the frontend, Workers for the backend API, and D1 for database storage.Prerequisites
Before deploying, ensure you have:- Node.js 18.0.0 or higher
- A Cloudflare account
- Wrangler CLI (Cloudflare’s deployment tool)
- Access to the fata.plus domain on Cloudflare
Wrangler Setup
D1 Database Setup
Fataplus uses Cloudflare D1 (SQLite at the edge) for data storage.Create D1 database
For the frontend/website:The output will include a
database_id. Copy this for your wrangler configuration.The current production database ID is
20b1fb8c-3e08-4e91-9083-53558750107dR2 Storage Setup (Optional)
For media storage, Fataplus uses Cloudflare R2:wrangler.toml:
Frontend Deployment (Cloudflare Pages)
The frontend applications are deployed using Cloudflare Pages.Backend Deployment (Cloudflare Workers)
The backend API runs on Cloudflare Workers atbknd.fata.plus.
Backend Configuration
The backend useswrangler.json for configuration:
Development Workflow
Deployment URLs
After successful deployment:- Production Worker:
https://fataplus-bknd-backend.fenohery.workers.dev - Admin Interface:
https://fataplus-bknd-backend.fenohery.workers.dev/admin - Custom Domain (when configured):
https://bknd.fata.plus
Verifying Deployment
Cloudflare Workers typically deploy globally within 30 seconds. D1 database changes may take a few minutes to propagate.
Troubleshooting
Worker not accessible
- Verify your account ID in
wrangler.jsonmatches your Cloudflare account - Check that routes are correctly configured
- Ensure the domain is managed by Cloudflare
Database connection errors
- Verify the database ID is correct in your wrangler configuration
- Run migrations:
npm run db:migrate - Check D1 database exists:
wrangler d1 list
Build failures
- Clear node_modules and reinstall:
rm -rf node_modules && npm install - Update Wrangler:
npm install -g wrangler@latest - Check TypeScript types:
npm run typegen
Next Steps
- Configure environment variables
- Set up custom domains
- Explore the API reference