Overview
Astro Launchpad is an Astro 2.0 template project that provides a starting point for launching projects with Astro. It is configured with static site generation (SSG) and server-side rendering (SSR) routes in a single Astro project using Astro 2.0’s hybrid output. The project is deployed on Vercel for hosting, SSR, and API microservices. It follows best practices for eslint, prettier, tsconfig, code sharing, and build caching. Astro Launchpad also includes image optimization using the sharp package.
Features
- SSG and SSR routes in a single Astro project
- Deployable on Vercel
- API microservices with automatic API client generation
- Turbo repository management
- Pre-configured with @vercel/analytics, preact, astrojs-service-worker, @astrojs/image, astro-robots-txt, astro-sitemap, astro-webmanifest, eslint, browserslist, dotenv, prettier, tsconfig custom base config
- Local image optimization with sharp package
- Shared packages for components, internationalization, authentication, icons, reactive functions, theming, and configuration
Installation
To install and deploy Astro Launchpad, follow these steps:
- Clone the repository.
- Set the root directory to
apps/server. - Configure Vercel to use turbo by modifying
apps/server/vercel.json. - Activate remote caching.
- Run
npm installto install the required dependencies. - Run
brew uninstall vips(if already installed) and thennpm install --ignore-scripts=false --foreground-scripts --verbose sharpto install the sharp package for local image optimization. - Optionally, customize and reuse code from the shared packages located in the
packages/directory.
Summary
Astro Launchpad is a template project that simplifies the setup and configuration of Astro 2.0 projects. It provides a hybrid output with SSG and SSR routes, making it easy to deploy on Vercel. The project includes various additional packages and features such as API microservices, image optimization, and shared packages for components, theming, and configuration. With its comprehensive setup and best practices for linting, formatting, and caching, Astro Launchpad allows developers to quickly launch and build projects using Astro.