A high-performance, enterprise-grade web application boilerplate built with Astro 5, Svelte 5, and Tailwind CSS v4.
This repository hosts a high-performance, enterprise-grade web application boilerplate built with Astro 5. It is architected for scalability, hybrid rendering, and visual content management.
The project combines the raw performance of Astro's server-side rendering (SSR) with Svelte 5's next-generation reactivity for interactive islands. It features a robust UI system based on Tailwind CSS v4 and Shadcn/UI architecture, all powered by Storyblok as a Headless CMS.
- β‘οΈ Astro 5 Hybrid Rendering: Optimized for speed with Server-Side Rendering (SSR) via the Vercel Adapter.
- π₯ Svelte 5 Reactivity: Utilizes the latest Svelte runes and reactivity model for interactive UI components.
- π¨ XR Tailwind CSS v4: Implements the latest zero-runtime CSS engine with native CSS variable theming and dark mode support.
- ποΈ CMS Storyblok Integration: Seamless content fetching with a live Visual Editor and dynamic component mapping.
- π¨ Shadcn/UI Architecture: Uses clsx and tailwind-merge for type-safe, reusable component styling.
- π§ͺ Testing & Performance: Pre-configured with Playwright for E2E testing and Partytown for third-party script offloading.
- πΊοΈ SEO Ready: Automatic sitemap generation and metadata handling.
- π¦ Type-Safe: Full TypeScript support with Storyblok type synchronization
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Get up and running in less than 5 minutes.
To successfully run this project, you will need the following installed on your development machine:
- Node.js: v20.0.0 or higher (LTS recommended).
- Package Manager: pnpm v9.x (Strictly enforced via CI).
- Storyblok Account: Required for content management and API tokens.
# Node.js v20.0.0 or higher (LTS recommended)
node -v
# pnpm v9.x (Strictly enforced via CI)
pnpm -vFollow this step-by-step series of examples to get your development environment running.
1. Clone the Repository
Start by cloning the repository to your local machine.
git clone \[https://github.com/adammerrill/AstroJS-template.git\](https://github.com/adammerrill/AstroJS-template.git)
cd AstroJS-template2. Install Dependencies
This project uses pnpm to ensure strict dependency management and faster installation.
pnpm install3. Environment Configuration
Create a .env file in the root directory by copying the example file.
cp .env.example .envYou must configure the following variables in your new .env file. These are required for the astro.config.mjs loader and Storyblok integration:
\# Base URL used for sitemap generation and canonical URLs
SITE\_URL="http://localhost:4321"
\# Storyblok Access Token (Found in Storyblok: Settings \-\> Access Tokens \-\> Preview)
STORYBLOK\_TOKEN="your\_storyblok\_preview\_token\_here"4. Sync Content Types
Synchronize your local Astro types with your integrations (like Storyblok) to ensure type safety.
pnpm astro sync5. Start the Development Server
Launch the local development server with Hot Module Replacement (HMR).
pnpm dev
You can now access the application at http://localhost:4321.If you need to test the application on a mobile device connected to the same network, use the host command:
pnpm dev:hostThis system employs a robust testing strategy combining End-to-End (E2E) testing with static analysis and coding style checks.
We use Playwright for E2E testing to simulate real user interactions across multiple browsers and device viewports.
To run the full test suite using our custom CI wrapper (which handles server lifecycle and reporting):
pnpm testThis command executes scripts/ci-wrapper.ts, which:
- Starts the Astro server.
- Waits for the port to be ready.
- Runs the Playwright suite.
- Generates a colored summary in the terminal.
- Gracefully shuts down the server.
If you want to debug tests with the interactive UI:
pnpm test:e2e:ui
We use a combination of ESLint, Prettier, TypeScript, and a custom Style Auditor to ensure code quality.
Linting & Type Checking:
\# Run ESLint
pnpm lint
\# Run TypeScript Type Check
pnpm typecheck
\# Run Astro Template Check
pnpm checkStyle Risk Audit:
We include a custom static analysis tool (audit-styles.js) that scans the codebase for high-risk CSS patterns, such as inline styles or excessive use of Tailwind arbitrary values (e.g., w-[53px]).
node audit-styles.js
The project follows a strict modular architecture:
/
βββ public/ \# Static assets (favicons, robots.txt)
βββ src/
β βββ assets/ \# Optimized assets (SVGs, Images)
β βββ components/ \# UI Components (Header, Footer, Shadcn primitives)
β βββ layouts/ \# Global layouts (Layout.astro)
β βββ lib/ \# Utilities (cn helper for Tailwind)
β βββ pages/ \# Astro routes & Storyblok \[...slug\] entry point
β βββ storyblok/ \# Svelte components mapped to CMS blocks
β βββ styles/ \# Global CSS, Tailwind directives, & Theme vars
βββ astro.config.mjs \# Configuration for Integrations & Vercel Adapter
βββ components.json \# Shadcn/UI configuration
βββ package.json \# Project dependenciesThe project is pre-configured for Vercel serverless deployment via the @astrojs/vercel adapter.
- Push Code: Push your code to your git repository.
- Import to Vercel: Import the project into your Vercel dashboard.
- Environment Variables: Add the STORYBLOK_TOKEN in the Vercel Project Settings > Environment Variables.
- Deploy: Trigger a deployment.
The astro.config.mjs is already set up to use vercel() as the adapter, ensuring SSR functions work correctly in the serverless environment.
- Astro 5 - The web framework used for content-focused websites.
- Svelte 5 - Reactive component framework (Runes).
- Tailwind CSS v4 - Utility-first CSS framework.
- Storyblok - Headless CMS.
- Shadcn/UI - Reusable component architecture.
- Playwright - End-to-End testing framework.
- Vercel - Serverless deployment platform.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us. (Note: File to be created).
- Fork the repository.
- Create your feature branch (git checkout -b feature/AmazingFeature).
- Commit your changes (git commit -m 'Add some AmazingFeature').
- Push to the branch (git push origin feature/AmazingFeature).
- Open a Pull Request.
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Atom Merrill - Initial work & Architecture - AdamMerrill
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.