AstroSveltePortfolioBlogStarter

baselayer — Astro Portfolio Template

By baflow

Baselayer is a dark-mode blog and portfolio starter template built on Astro and Svelte, with content collections, design-token theming, and an optional Cloudflare Worker contact form solution.

Explore the design

Compare the page layouts and mobile experience. Open any screenshot for a closer look.

3 previews
Desktop homepage1 / 3
Desktop captureTop of page

Actual screenshot captured by the server browser.

All pages & views 3

Screenshots show visual appearance; interactive behavior may differ.

Recorded 2026-10-04View source

What stands out

A quick read of the recorded project description.

01

Manage blog posts and projects with Astro Content Collections, with typed frontmatter

02

Design-token-driven Tailwind theme, with colors, fonts, and spacing adjusted in one place

03

Mix of Astro and Svelte components, paired with Basecoat CSS and Solar icons

04

Built-in RSS, Sitemap, and Open Graph output, with code blocks rendered by Expressive Code

05

Optional contact form: a separately deployed Cloudflare Worker forwards emails via Resend, supporting Turnstile and rate limiting

Template Details

Baselayer is an Astro starter template for developers, used to build dark-mode blog and product showcase sites. It uses Astro Content Collections to manage blog posts and project entries, with typed frontmatter; the theme is driven by design tokens, with colors, fonts, and spacing adjusted from a single source. UI components are composed of Astro and Svelte, incorporating Basecoat CSS and Solar icons, with Inter and Newsreader fonts. The template includes RSS, Sitemap, and Open Graph output, and code blocks are rendered with Expressive Code.

The contact form is an optional feature implemented through a separate Cloudflare Worker: the Worker is placed as a git submodule in integrations/email-cloudflare-resend/, deployed separately, responsible for validating submissions and forwarding emails via Resend, and can be configured with Turnstile verification, per-IP rate limiting, and sender domain restrictions. The frontend points to this Worker via EMAIL_WORKER_URL.

Several configurations must be completed manually before use: set the site URL in astro.config.mjs, update the title, description, and contact link in src/consts.ts, replace the footer text in Footer.astro, add content to src/content/blog/ and src/content/projects/, and replace public/thumbnail.png. If enabling the contact form, you also need to initialize the submodule, install dependencies, configure variables and secrets in wrangler.toml and .env, and deploy the Worker and site separately.

AstroSveltePortfolioBlogStarter

Is it right for your project?

Use Cases

  • Build a personal developer blog, write posts in Markdown/MDX, and automatically generate RSS and Sitemap
  • Create product showcase or portfolio pages, maintaining project entries with content collections
  • Need a static site with a contact form and are willing to deploy a separate Cloudflare Worker to handle email
  • Want to control the dark theme's colors, fonts, and spacing uniformly through design tokens

Suitable For

  • Developers familiar with Astro and Svelte who are willing to manually configure site information and content according to the documentation
  • Individual developers who need a dark-mode blog or portfolio starter template
  • Users who accept splitting the contact form into a separately deployed Cloudflare Worker

Getting started & customization

Use these recorded setup notes alongside the repository instructions for your chosen version.

  1. 1

    After cloning, run npm install and npm run dev to start local development

  2. 2

    Set the site URL in astro.config.mjs, update the title, description, and contact link in src/consts.ts, and replace the footer text in Footer.astro

  3. 3

    Add content to src/content/blog/ and src/content/projects/, and replace public/thumbnail.png (1200x630 recommended)

  4. 4

    To enable the contact form, initialize the git submodule (git submodule update --init), install dependencies inside integrations/email-cloudflare-resend/, and configure wrangler.toml

  5. 5

    Set secrets such as RESEND_API_KEY and TURNSTILE_SECRET for the Worker, and after deployment fill in EMAIL_WORKER_URL and EMAIL_RECIPIENT in .env

Read repository instructions

License & source material

Usage conditions & limitations

Free to use · keep license notice

This entry covers the free version under the MIT license in the public repository; the free scope is the code of this version and does not mean external services or third-party assets are free.

Must comply with when using

  • Free use, modification, commercial use, and distribution of this version's code are permitted.
  • When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
  • The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.

Additional costs & items to verify

  • Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
  • External services such as domains, hosting, databases, payments, or AI may incur additional charges.
  • The contact form is an optional feature; once enabled, it requires external services such as Cloudflare Workers and the Resend API.
  • The contact form depends on a Cloudflare Worker in a separate repository, which must be deployed separately and is not part of this template's main site code.
  • Enabling email functionality requires applying for and configuring a Resend API key yourself.
  • Enabling email functionality requires configuring a Cloudflare Turnstile key.
  • Rate limiting depends on a Cloudflare KV namespace binding, which must be created in your Cloudflare account.
  • The email sending endpoint can be disabled via the EMAIL_ENABLED variable.
View Original Text Basis

Permission is hereby granted, free of charge

Original License Text

**Optional contact form** — Cloudflare Workers + Resend API

Original README

The submodule points to [`email-cloudflare-resend`](https://github.com/baflow/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.

Original README

| `RESEND_API_KEY` | Secret | `wrangler secret put RESEND_API_KEY` | Resend API bearer token |

Original README

| `TURNSTILE_SECRET` | Secret | `wrangler secret put TURNSTILE_SECRET` | Cloudflare Turnstile site secret |

Original README

| `RATE_LIMIT_KV` | KV binding | `wrangler.toml` (`[[kv_namespaces]]`) | KV namespace for rate-limit storage |

Original README

| `EMAIL_ENABLED` | Variable | `wrangler.toml` (`[vars]`) | Set `false` to disable `/send` (returns `503`) |

Original README
https://github.com/baflow/baselayer/blob/main/LICENSEhttps://github.com/baflow/baselayer/blob/main/README.md

Compiled by DeepSeek based on repository license and README ·2026-10-05. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.

Project checks & description sources

Template Information

Source platforms
GitHub
Documentation and maintenance reference score
More documented · 88 / 100
Technologies
Astro · Svelte
Website type
Portfolio · Blog · Starter
How this score is calculated

Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.

What to verify for this project

Repository update recorded
2026-05-13
Screenshot last checked
2026-10-05

A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.

The catalog identifies Astro as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.

Use a selection guide →

How this description was prepared

AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.

Review declaration: [email protected] · 2026-10-05

Inspect the recorded source material

SHA-256: 466551fbc5d3788e20133ad78ca50a2faa14310f7e48805ae137fe2d3d7292c4

2026-10-05T01:00:28.175Z

Source file / repository
# Astro Dev Template

[![Astro](https://img.shields.io/badge/Astro-6-BC52EE?logo=astro)](https://astro.build)
[![Tailwind CSS](https://img.shields.io/badge/Tailwind-4-06B6D4?logo=tailwindcss)](https://tailwindcss.com)
[![Svelte](https://img.shields.io/badge/Svelte-5-FF3E00?logo=svelte)](https://svelte.dev)
[![License](https://img.shields.io/badge/License-MIT-green.svg)](./LICENSE)

> A free, design-token-driven Astro 6 starter for dark-mode blogs and product showcases.

**[Live Demo](https://baselayer-pk4.pages.dev/)**

![Baselayer Thumbnail](public/thumbnail.png)

---

## One-Click Deploy

Deploy your own copy in under 2 minutes:

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/baflow/baselayer)
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/baflow/baselayer)

Or use the CLI:

```bash
# Clone
git clone https://github.com/baflow/baselayer.git my-site
cd my-site

# Install & dev
npm install
npm run dev
```

---

## Stack

Built with **Astro 6**, **Tailwind CSS v4**, **Basecoat CSS**, **Svelte 5**, Solar icons, and Inter + Newsreader fonts. Deploys to Cloudflare Pages.

---

## Features

- **Content Collections** with typed frontmatter for blog posts and projects
- **Design-token-driven** Tailwind theme — tweak colors, typography, and spacing through a single source of truth
- **Basecoat UI** — debloated components, no React needed
- **Expressive Code** for beautiful fenced code blocks
- **RSS, Sitemap, Open Graph** out of the box, thanks to Astro
- **Optional contact form** — Cloudflare Workers + Resend API

---

## Project Structure

```text
├── 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
```

---

## Before you publish your site

1. **Set your site URL** in `astro.config.mjs`:
   ```js
   site: 'https://your-domain.com',
   ```
2. **Update placeholders** in `src/consts.ts` (title, description, contact links).
3. **Replace the footer** text in `src/components/Footer.astro`.
4. **Add your own content** to `src/content/blog/` and `src/content/projects/`.
5. **Replace thumbnail** — add `public/thumbnail.png` (1200x630 recommended).
6. **Configure Wrangler** (optional) in `wrangler.toml` and `.env`.
7. **Update repo URL** in the deploy buttons above.



---

## Git Submodules

This template uses a **git submodule** for the email worker so it can evolve independently while remaining version-pinned here.

```bash
# 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`](https://github.com/baflow/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`.

---

## Email Worker (submodule)

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**.

### Required secrets & variables (inside submodule)

| 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`) |

### Quick start

1. **Initialise the submodule** (if you haven't yet):
   ```bash
   git submodule update --init
   ```

2. **Install & configure** inside the submodule:
   ```bash
   cd integrations/email-cloudflare-resend
   npm install
   ```
   Edit `wrangler.toml` with your `SENDER_DOMAIN` and create a KV namespace if needed.

3. **Add secrets**:
   ```bash
   npx wrangler secret put RESEND_API_KEY
   npx wrangler secret put TURNSTILE_SECRET
   ```

4. **Deploy**:
   ```bash
   npm run email:deploy
   # or manually: cd integrations/email-cloudflare-resend && npx wrangler deploy
   ```

5. **Wire the frontend** — set the worker URL in `.env`:
   ```bash
   EMAIL_WORKER_URL=https://email-cloudflare-resend.<subdomain>.workers.dev/send
   [email protected]
   ```

---

## Contributing

Feature requests and PRs are welcome. See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.

---

## License

MIT -- free for personal and commercial use.
Report a correction

Explore similar templates

Compare previews and descriptions within the same stack and category.