Architecture & Cloudflare Setup
100% Free Tier, zero-build, auto-deploying digital academy & marketplace on Cloudflare Pages.
1. Architecture Overview
Ahama Academy runs natively on the Cloudflare edge without expensive servers, npm build scripts, or recurring hosting bills:
- Cloudflare Pages (Frontend): Pure HTML5, modern CSS3, and native JavaScript. Loads instantly worldwide with 0ms cold starts.
- Cloudflare Pages Functions (Backend): Edge workers located in
/functions/api/handling authentication, checkout, CRM, and dynamic CMS. - Cloudflare D1 (Database): Edge SQLite database with 5 million read rows/day free tier.
- Zero-Card Hybrid Storage: YouTube unlisted embeds for unlimited video bandwidth + GitHub Releases / Supabase for large template downloads.
2. 1-Click Deployment to Cloudflare Pages
- Push this repository to your GitHub account:
git init git add . git commit -m "Ahama Academy Production Release" git remote add origin https://github.com/your-username/ahama-academy.git git push -u origin main - Log in to Cloudflare Dashboard.
- Go to Workers & Pages → Create Application → Pages → Connect to Git.
- Select your repository. Under Build Settings:
- Framework preset: None
- Build command: (leave empty)
- Build output directory: /
- Click Save and Deploy. Your site is now live with automatic deployment on every push!
3. Connecting Cloudflare D1 Database
Run the following commands using the free Wrangler CLI:
# 1. Create your free edge database
npx wrangler d1 create ahama-db
# 2. Execute the schema
npx wrangler d1 execute ahama-db --file=./d1/schema.sql
# 3. Seed demo courses, templates, and admin user
npx wrangler d1 execute ahama-db --file=./d1/seed.sql
In Cloudflare Dashboard, go to your Pages project → Settings → Functions → D1 database bindings, and add variable name DB bound to ahama-db.
4. Default Demo Credentials
👑 Admin:
admin@ahama.academy / Password: admin123👨🎓 Student:
student@ahama.academy / Password: student123