Landing Template
Template for building a landing page
The Landing template is a Next.js application built with SST that serves as your product’s public-facing website. It’s designed for performance, SEO, and conversion optimization.
You can find the full source code for the Landing template here.
Project Structure
Let’s explore the key components of the landing template:
- Application Structure (
/app
)
The source code follows Next.js 14+ app router conventions:
Environment Configuration
Development
Create a .env.sandbox
file:
SST Configuration
The landing template uses SST for deployment and infrastructure management. The configuration is defined in sst.config.ts
and consists of several key aspects:
1. App Configuration
The base app configuration defines core settings for the SST application:
name
: Defines the app name used to prefix resourcesremoval
: Retains resources in production, removes them in other stageshome
: Uses AWS as the primary providerproviders
: Configures Cloudflare for DNS management
2. Domain Configuration
The domain configuration handles environment-specific domains and DNS settings:
- Automatically generates stage-specific subdomains
- Configures www to apex domain redirects
- Sets up Cloudflare DNS with proper proxying
- Defines environment variables for the app URL
3. Auto-deployment Configuration
The autodeploy configuration manages deployment rules for different branches:
Defines automatic deployment rules:
sandbox
branch → sandbox stagedev
branch → dev stagemain
branch → prod stage- Other branches → stage named after branch
Each deployment uses CodeBuild with large compute resources for optimal build performance.
For more details on SST configuration options, refer to the SST Config Documentation.
Deployment
The landing template supports multiple deployment options:
SST Deployment
Deployment to production is handled by SST Autodeploy when you do a PR from dev to main.
Was this page helpful?