Scaffold a new chirag127 tool site (Astro + dark theme + CI)
Scaffold a tool site
Use this when
You're filling in any of the 15 stub tool repos
(<category>-tools-site for category in: pdf, image, finance, dev,
text, convert, qr, data, audio, video, seo, crypto, health, random,
print) with its first deployable Astro app.
Prerequisites
- Tokens rotated and org secrets set per
../security/credentials/rotate-cf-and-npm-tokens.md. - Local clone:
git submodule update --init repos/websites/tools/<r>-tools-site. - Working dir:
repos/websites/tools/<r>-tools-site.
Files to create
<r>-tools-site/
├── .env.example # synced from master per rules/security/env-example-synced-from-master.md
├── .gitignore # node_modules, dist, .astro, .env
├── astro.config.mjs # output: 'static', sitemap integration, mdx
├── biome.json # extends shared family config
├── package.json # name: "<r>-tools-site", deps below
├── pnpm-lock.yaml # generated by pnpm install
├── README.md # already there from stub
├── LICENSE # already there from stub
├── tailwind.config.ts # extends @chirag127/theme preset
├── tsconfig.json # extends shared family config
├── public/
│ ├── favicon.svg # category icon
│ └── robots.txt # default allow
├── src/
│ ├── components/ # category-specific components
│ ├── layouts/Base.astro # imports @chirag127/header, /footer, /seo, /analytics
│ ├── pages/index.astro # category landing — list of tools
│ └── pages/[tool].astro # dynamic per-tool page
└── .github/workflows/
└── deploy.yml # build + deploy to CF Pages
package.json baseline
{
"name": "@chirag127/<r>-tools-site",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"lint": "biome check .",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@astrojs/mdx": "^4",
"@astrojs/react": "^4",
"@astrojs/sitemap": "^3",
"@astrojs/tailwind": "^6",
"@chirag127/analytics": "^0.1.0",
"@chirag127/auth-ui": "^0.1.0",
"@chirag127/config": "^0.1.0",
"@chirag127/consent": "^0.1.0",
"@chirag127/firebase-init": "^0.1.0",
"@chirag127/footer": "^0.1.0",
"@chirag127/header": "^0.1.0",
"@chirag127/multi-search": "^0.1.0",
"@chirag127/seo": "^0.1.0",
"@chirag127/sidebar": "^0.1.0",
"@chirag127/theme": "^0.1.0",
"astro": "^6",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"tailwindcss": "^4"
},
"devDependencies": {
"@biomejs/biome": "^2",
"@types/node": "^22",
"@types/react": "^19",
"typescript": "^5.7"
}
}
.github/workflows/deploy.yml
name: Deploy
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 10 }
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm build
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: <r>-tools-site
directory: dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
Cloudflare Pages connect
# Once per project, via wrangler:
pnpm dlx wrangler pages project create <r>-tools-site \
--production-branch main \
--compatibility-date 2026-06-20
# Custom domain:
pnpm dlx wrangler pages project domain add <r>-tools-site <r>.oriz.in
DNS CNAME
# Get zone ID
ZONE_ID=$(curl -s -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
"https://api.cloudflare.com/client/v4/zones?name=oriz.in" \
| jq -r '.result[0].id')
# Create CNAME <r>.oriz.in -> <r>-tools-site.pages.dev
curl -X POST "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records" \
-H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
-H "Content-Type: application/json" \
-d "{
\"type\": \"CNAME\",
\"name\": \"<r>\",
\"content\": \"<r>-tools-site.pages.dev\",
\"proxied\": true
}"
Smoke test
pnpm install
pnpm typecheck
pnpm build
pnpm preview # opens localhost:4321
Push to main → CI deploys → confirm at https://<r>.oriz.in.
Then
Update workspace pointer:
cd /path/to/workspace
git add repos/websites/tools/<r>-tools-site
git commit -m "feat(<r>-tools-site): bump pointer — initial Astro scaffold"
git push origin main
(Updated 2026-06-20.)