-
Notifications
You must be signed in to change notification settings - Fork 0
Deployment
Alex Neamtu edited this page Jan 15, 2026
·
1 revision
htoprc.dev runs on Cloudflare's free tier.
| Component | Service |
|---|---|
| Frontend | Cloudflare Pages |
| API | Cloudflare Workers |
| Database | Cloudflare D1 (SQLite) |
| Auth | Clerk |
| DNS | Cloudflare |
- Cloudflare account
- Clerk account (optional, for auth)
- GitHub account (for scraper token)
git clone https://github.com/alexneamtu/htoprc.dev.git
cd htoprc.dev
pnpm installpnpm exec wrangler login# Create databases
pnpm exec wrangler d1 create htoprc-db-staging
pnpm exec wrangler d1 create htoprc-db-production
# Update wrangler.toml with the database IDs# Staging
pnpm exec wrangler d1 migrations apply DB --env staging --remote
# Production
pnpm exec wrangler d1 migrations apply DB --env production --remote# Clerk (optional)
pnpm exec wrangler secret put CLERK_SECRET_KEY --env staging
pnpm exec wrangler secret put CLERK_SECRET_KEY --env production
# GitHub token (for scraper)
pnpm exec wrangler secret put GITHUB_TOKEN --env production# Deploy API
pnpm exec wrangler deploy --env staging
pnpm exec wrangler deploy --env production
# Deploy Web (via Pages)
pnpm exec wrangler pages deploy apps/web/dist --project-name=htoprc-staging
pnpm exec wrangler pages deploy apps/web/dist --project-name=htoprc-productionSet via wrangler secret:
-
CLERK_SECRET_KEY- Clerk API key -
GITHUB_TOKEN- GitHub API token
Set in Pages dashboard or .env:
-
VITE_API_URL- API endpoint URL -
VITE_CLERK_PUBLISHABLE_KEY- Clerk public key
GitHub Actions automatically:
- Run tests on PR
- Deploy to production on merge to main
- Create GitHub Release with changelog
See .github/workflows/ for workflow definitions.
Configure in Cloudflare dashboard:
- Pages: Add custom domain in project settings
- Workers: Add route in wrangler.toml
| Resource | Free Tier |
|---|---|
| Workers requests | 100K/day |
| D1 reads | 5M/day |
| D1 writes | 100K/day |
| Pages bandwidth | Unlimited |
The project runs entirely on free tier for typical usage.