Loading...
Loading...
Comprehensive Astro development with React, Tailwind v4, and Cloudflare Workers deployment
npx skill4agent add augurproject/augur-reboot-website astro-dev./scripts/init_astro_cloudflare.sh my-app./scripts/init_astro_standard.sh my-sitepython scripts/setup_content_collection.py blogsrc/content/blog/src/content/config.tsblogdocsproductspython scripts/add_view_transitions.pysrc/layouts/# Initialize project
./scripts/init_astro_cloudflare.sh my-blog
cd my-blog
# Set up content collections
python ../scripts/setup_content_collection.py blog
# Add View Transitions
python ../scripts/add_view_transitions.py
# Start development
npm run dev
# Deploy to Cloudflare Workers
npx wrangler deployreferences/cloudflare-d1.mdreferences/react-integration.mdreferences/tailwind-setup.md# One-time setup
npm install -g wrangler
wrangler login
# Deploy
npm run build
npx wrangler deploywrangler.jsonc./dist/_worker.js./distreferences/cloudflare-workers.mdreferences/github-actions.md// astro.config.mjs
// Server-Side Rendering (all pages on-demand)
export default defineConfig({
output: 'server',
});
// Hybrid (static by default, opt-in to SSR)
export default defineConfig({
output: 'hybrid',
});
// Static (pre-rendered at build time)
export default defineConfig({
output: 'static',
});my-astro-app/
├── src/
│ ├── pages/ # File-based routing
│ │ ├── index.astro
│ │ ├── blog/
│ │ │ └── [...slug].astro
│ │ └── api/ # API endpoints
│ │ └── data.ts
│ ├── layouts/ # Page layouts
│ │ └── BaseLayout.astro
│ ├── components/ # Astro components
│ │ └── Card.astro
│ ├── components/ # React components
│ │ └── Button.tsx
│ ├── content/ # Content collections
│ │ ├── config.ts
│ │ └── blog/
│ ├── styles/ # Global CSS
│ │ └── global.css
│ └── env.d.ts # TypeScript types
├── public/ # Static assets
│ └── .assetsignore # Workers asset config
├── astro.config.mjs # Astro configuration
├── wrangler.jsonc # Cloudflare Workers config
├── package.json
└── tsconfig.json<!-- Hydrate immediately -->
<Counter client:load />
<!-- Hydrate when idle -->
<SocialShare client:idle />
<!-- Hydrate when visible -->
<Comments client:visible />
<!-- Hydrate on specific media query -->
<MobileMenu client:media="(max-width: 768px)" />
<!-- Client-only (no SSR) -->
<BrowserWidget client:only="react" />---
// In .astro files
const { env, cf, ctx } = Astro.locals.runtime;
// Use KV
const data = await env.MY_KV.get('key');
// Use D1
const { results } = await env.DB.prepare('SELECT * FROM users').all();
// Request properties
const country = cf.country;
---<Image />platformProxywrangler typeswrangler tailnpx astro check.astroclient:*client:onlywrangler.jsoncCLOUDFLARE_API_TOKENwrangler tailglobal.cssastro.config.mjs@import "tailwindcss"cloudflare-workers.mdcloudflare-d1.mdreact-integration.mdtailwind-setup.mdcontent-collections.mdview-transitions.mdgithub-actions.md