A free, design-token-driven Astro 6 starter for dark-mode blogs and product showcases.
Deploy your own copy in under 2 minutes:
Or use the CLI:
# Clone
git clone https://github.com/baflow/baselayer.git my-site
cd my-site
# Install & dev
npm install
npm run dev
Built with Astro 6, Tailwind CSS v4, Basecoat CSS, Svelte 5, Solar icons, and Inter + Newsreader fonts. Deploys to Cloudflare Pages.
├── public/ # Static assets
├── src/
│ ├── assets/ # Images processed by Astro
│ ├── components/ # Astro + Svelte UI components
│ │ └── ui/ # Reusable Svelte components
│ ├── content/ # Markdown/MDX collections
│ ├── layouts/ # Page layouts
│ ├── pages/ # File-based routes
│ ├── styles/ # Tailwind theme + Basecoat imports
│ └── types/ # Local type definitions
├── integrations/ # Git submodules (optional)
│ └── email-cloudflare-resend/ # Email worker (separate deploy)
├── scripts/ # Dev / deploy helpers
├── DESIGN.md # Design system spec
├── astro.config.mjs
├── wrangler.toml
└── README.md
astro.config.mjs:site: 'https://your-domain.com',
src/consts.ts (title, description, contact links).src/components/Footer.astro.src/content/blog/ and src/content/projects/.public/thumbnail.png (1200x630 recommended).wrangler.toml and .env.This template uses a git submodule for the email worker so it can evolve independently while remaining version-pinned here.
# After cloning, initialise the submodule
git submodule update --init
# The submodule is mounted at:
# integrations/email-cloudflare-resend/
The submodule points to email-cloudflare-resend — a standalone Cloudflare Worker that acts as a secure email proxy (Turnstile, rate limiting, Resend relay). It is deployed separately from the Astro site. The frontend talks to it via EMAIL_WORKER_URL.
The worker lives in integrations/email-cloudflare-resend/ (git submodule). It validates contact-form submissions from the static Astro site and relays them in a secure way through Resend.
| Name | Type | How to set | Purpose |
|---|---|---|---|
RESEND_API_KEY |
Secret | wrangler secret put RESEND_API_KEY |
Resend API bearer token |
TURNSTILE_SECRET |
Secret | wrangler secret put TURNSTILE_SECRET |
Cloudflare Turnstile site secret |
RATE_LIMIT_KV |
KV binding | wrangler.toml ([[kv_namespaces]]) |
KV namespace for rate-limit storage |
SENDER_DOMAIN |
Variable | wrangler.toml ([vars]) |
Allowed sender domain |
RATE_LIMIT_MAX |
Variable | wrangler.toml ([vars]) |
Max requests per IP (default 2) |
RATE_LIMIT_WINDOW_MINUTES |
Variable | wrangler.toml ([vars]) |
Sliding window in minutes (default 15) |
EMAIL_ENABLED |
Variable | wrangler.toml ([vars]) |
Set false to disable /send (returns 503) |
Initialise the submodule (if you haven't yet):
git submodule update --init
Install & configure inside the submodule:
cd integrations/email-cloudflare-resend
npm install
Edit wrangler.toml with your SENDER_DOMAIN and create a KV namespace if needed.
Add secrets:
npx wrangler secret put RESEND_API_KEY
npx wrangler secret put TURNSTILE_SECRET
Deploy:
npm run email:deploy
# or manually: cd integrations/email-cloudflare-resend && npx wrangler deploy
Wire the frontend — set the worker URL in .env:
EMAIL_WORKER_URL=https://email-cloudflare-resend.<subdomain>.workers.dev/send
[email protected]
Feature requests and PRs are welcome. See CONTRIBUTING.md for guidelines.
MIT -- free for personal and commercial use.