A production-ready SaaS company website template with integrated authentication, Stripe payments, and lead generation. Built with Hono framework for Cloudflare Pages.
See it in action: https://configurable-saas-template.pages.dev
The demo showcases all features with placeholder content. You can explore:
- π Homepage - Hero, features, pricing, testimonials
- π Custom Pages - About, Blog, Contact pages
- π¨ Default Theme - Modern purple gradient theme
- π Auth Pages - Login and signup interfaces
Note: The demo uses placeholder data. Replace {{PLACEHOLDERS}} in config.ts with your actual content.
- Home (
/) - Full landing page with all sections - About (
/about) - About page with team section - Blog (
/blog) - Blog placeholder page - Contact (
/contact) - Contact form page - Privacy (
/privacy) - Privacy policy page - Terms (
/terms) - Terms of service page - Login (
/login) - User login page - Signup (
/signup) - User registration page
- Landing Page: Hero section, features, pricing, testimonials, CTA, footer
- Authentication: Email/password signup and login pages (OAuth ready)
- Stripe Integration: Subscription checkout flow with multiple pricing tiers
- Lead Generation: Contact form with email notifications via Resend
- Database Schema: D1 SQLite tables for users, subscriptions, leads, sessions
- Responsive Design: Mobile-first design with Tailwind CSS
- API Routes: RESTful API endpoints for all features
- Configuration System: Single config.ts file for all customization
- π¨ Advanced Theme System:
- 6 button variants (solid, outline, ghost, gradient, small, large)
- 5 card styles (default, flat, elevated, outlined, gradient)
- Complete typography control (9 font sizes, weights, line heights, letter spacing)
- Comprehensive color system (primary/secondary with light/dark variants)
- Full spacing scale (40+ spacing values)
- Component-specific styling (navbar, footer, forms, hero, features, pricing, testimonials)
- Animation controls (enable/disable, durations, easing)
- π Dynamic Page Routing: Automatic page generation from config
- π― Component Library: Themed buttons, cards, and navigation
All content AND design is managed through a single config.ts file:
Content Configuration:
- Company information and branding
- Hero section content
- Features list
- Pricing plans (linked to Stripe)
- Testimonials
- Social media links
- Authentication providers
- Lead form fields
- SEO metadata
π¨ NEW: UI Theme Configuration:
- Colors: Primary, secondary, success, error, backgrounds
- Typography: Font families (Google Fonts), sizes
- Layout: Max width, header height, nav position
- Borders: Border radius for all components
- Shadows: Box shadows for depth
- Buttons: Complete button style system
- Cards: Card styling and hover effects
π NEW: Custom Pages:
- Define unlimited custom pages in config
- Automatic routing (e.g., /about, /privacy, /terms)
- Flexible content sections (text, team, forms)
- Choose which pages appear in menu
- Shared navigation and footer
- Stripe - Payment processing and subscriptions
- Resend - Transactional emails and notifications
- Cloudflare D1 - SQLite database for data persistence
- Google OAuth - Social authentication (ready to configure)
- GitHub OAuth - Social authentication (ready to configure)
Edit config.ts and replace all placeholders:
export const siteConfig = {
company: {
name: "Your Company Name",
tagline: "Your Tagline",
email: "hello@yourcompany.com",
// ... etc
},
// ... update all sections
}Copy the template and add your API keys:
cp .dev.vars.example .dev.vars
# Edit .dev.vars with your actual keysRequired keys:
STRIPE_SECRET_KEY- From https://dashboard.stripe.com/apikeysRESEND_API_KEY- From https://resend.com/api-keysJWT_SECRET- Generate with:openssl rand -base64 32
# Create D1 database
npm run db:create
# Update wrangler.jsonc with the database_id from output
# Run migrations
npm run db:migrate:local- Go to https://dashboard.stripe.com/products
- Create 3 products matching your pricing tiers
- Copy the Price IDs to
config.tsunderpricing.plans[].stripePriceId
# Build the project
npm run build
# Start development server with PM2
pm2 start ecosystem.config.cjs
# Test the application
npm test
# Check logs
pm2 logs webapp --nostreamwebapp/
βββ config.ts # Single configuration file (MAIN CUSTOMIZATION)
βββ src/
β βββ index.tsx # Hono backend with all routes
βββ public/static/
β βββ app.js # Frontend JavaScript (lead form, Stripe)
β βββ auth.js # Authentication JavaScript
βββ migrations/
β βββ 0001_initial_schema.sql # Database schema
βββ wrangler.jsonc # Cloudflare configuration
βββ .dev.vars.example # Environment variables template
βββ ecosystem.config.cjs # PM2 configuration
βββ package.json # Dependencies and scripts
// config.ts
company: {
name: "CloudFlow",
logo: "/static/logo.png", // Add your logo to public/static/
// ...
}// config.ts
pricing: {
plans: [
{
name: "Starter",
price: "$29",
period: "month",
stripePriceId: "price_xxxxx", // From Stripe Dashboard
features: [
"10 Projects",
"Basic Support"
]
}
// ... add more plans
]
}// config.ts
features: [
{
icon: "fas fa-rocket", // FontAwesome icon
title: "Fast Performance",
description: "Lightning-fast edge deployment"
}
// ... add/remove as needed
]// config.ts
leadForm: {
fields: [
{
name: "custom_field",
label: "Custom Field",
type: "text",
required: true,
placeholder: "Enter value"
}
// ... add/remove fields
]
}// config.ts
theme: {
colors: {
primary: "#667eea", // Your brand color
primaryDark: "#764ba2", // Darker shade
secondary: "#4c9aff", // Accent color
// ... more colors
},
fonts: {
primary: "'Poppins', sans-serif", // Main font
heading: "'Montserrat', sans-serif", // Heading font
},
borderRadius: {
lg: "1rem", // Rounded corners
},
buttons: {
primary: {
background: "primary",
borderRadius: "lg",
padding: "0.75rem 2rem",
}
}
}// config.ts
pages: [
{
path: "/about",
title: "About Us",
inMenu: true, // Show in navigation
content: {
hero: {
title: "About Our Company",
subtitle: "Our story and mission"
},
sections: [
{
type: "text",
title: "Who We Are",
content: "Your company story here..."
},
{
type: "team",
title: "Meet Our Team",
members: [
{
name: "John Doe",
role: "CEO",
bio: "Leader with 10 years experience",
image: "/static/team/john.jpg",
social: {
linkedin: "https://linkedin.com/in/johndoe",
twitter: "https://twitter.com/johndoe"
}
}
]
}
]
}
}
// Add unlimited pages!
]- Signup and login forms are ready
- TODO: Implement password hashing (bcrypt)
- TODO: Implement JWT token generation
- TODO: Add email verification flow
- Go to https://console.cloud.google.com/apis/credentials
- Create OAuth 2.0 Client ID
- Add authorized redirect URI:
https://your-domain.com/api/auth/google/callback - Update
config.ts:
auth: {
providers: {
google: {
enabled: true,
clientId: "your-client-id"
}
}
}- Add
GOOGLE_CLIENT_SECRETto .dev.vars
- Go to https://github.com/settings/developers
- Create OAuth App
- Set callback URL:
https://your-domain.com/api/auth/github/callback - Update
config.ts:
auth: {
providers: {
github: {
enabled: true,
clientId: "your-client-id"
}
}
}- Add
GITHUB_CLIENT_SECRETto .dev.vars
- Products are configured in
config.ts - When user clicks "Get Started", it calls
/api/stripe/create-checkout-session - User is redirected to Stripe Checkout
- After payment, they're redirected to
/success
Setup webhook endpoint in Stripe Dashboard:
- URL:
https://your-domain.com/api/stripe/webhook - Events:
customer.subscription.created,customer.subscription.updated,customer.subscription.deleted
Lead form submissions automatically send emails via Resend:
// config.ts
integrations: {
email: {
provider: "resend",
fromEmail: "noreply@yourdomain.com",
notificationEmail: "leads@yourdomain.com"
}
}# First deployment
npm run deploy:prod
# This will:
# 1. Build the project
# 2. Deploy to Cloudflare Pages
# 3. Give you a URL: https://webapp.pages.dev# Add secrets one by one
wrangler secret put STRIPE_SECRET_KEY --project-name webapp
wrangler secret put RESEND_API_KEY --project-name webapp
wrangler secret put JWT_SECRET --project-name webappnpm run db:migrate:prod- Authentication and user management
- Supports email, Google, and GitHub providers
- Linked to Stripe subscriptions
- Tracks subscription status and billing periods
- Stores contact form submissions
- Status tracking: new β contacted β qualified β converted
- JWT session management
- Automatic expiration
npm run dev # Vite dev server
npm run build # Build for production
npm run dev:sandbox # Wrangler dev server (sandbox)
npm run dev:d1 # Wrangler with D1 database
npm test # Test local server
npm run clean-port # Kill process on port 3000
npm run db:migrate:local # Apply migrations locally
npm run db:migrate:prod # Apply migrations to production# Query local database
npm run db:console:local -- --command="SELECT * FROM users"
# Query production database
npm run db:console:prod -- --command="SELECT * FROM leads WHERE status='new'"This template features the most configurable styling system available - every visual aspect is controlled through config.ts.
For the full styling guide with examples, see:
- STYLING_GUIDE.md - Complete styling configuration guide (15,000+ words)
- THEME_EXAMPLES.md - 6+ ready-to-use theme presets
<button class="btn-primary">Primary</button>
<button class="btn-secondary">Secondary</button>
<button class="btn-ghost">Ghost</button>
<button class="btn-gradient">Gradient</button>
<button class="btn-small">Small</button>
<button class="btn-large">Large</button><div class="card-default">Default Card</div>
<div class="card-flat">Flat Card</div>
<div class="card-elevated">Elevated Card</div>
<div class="card-outlined">Outlined Card</div>
<div class="card-gradient">Gradient Card</div>Every component has individual styling controls:
components: {
navbar: { /* height, colors, spacing */ },
footer: { /* layout, colors, gaps */ },
forms: { /* inputs, labels, validation */ },
hero: { /* background, sizes, alignment */ },
features: { /* icons, grid, gaps */ },
pricing: { /* highlighting, badges */ },
testimonials: { /* avatars, ratings */ },
}animations: {
enabled: true, // Master toggle
duration: { fast: "150ms", normal: "300ms", slow: "500ms" },
hoverScale: "1.05",
hoverTranslateY: "-5px",
}Change your entire website theme in seconds:
// Modern Blue Theme
theme: {
colors: {
primary: "#3b82f6",
primaryDark: "#2563eb",
// ...
}
}
// Or Vibrant Startup Theme
theme: {
colors: {
primary: "#ec4899", // Pink
primaryDark: "#db2777",
secondary: "#8b5cf6", // Purple
// ...
}
}
// Or Minimalist Dark Theme
theme: {
colors: {
primary: "#22c55e",
background: "#0f172a",
surface: "#1e293b",
text: { primary: "#f1f5f9" }
}
}See STYLING_GUIDE.md for complete examples and configuration options!
Create unlimited custom pages without writing code!
- Text Sections - Rich content with headings
- Team Sections - Team member profiles with photos
- Blog List - Coming soon placeholder
- Contact Forms - Uses lead form configuration
Each page needs:
path- URL route (e.g., "/about")title- Page titleinMenu- Show in navigation (true/false)content- Page content definition
About Page with Team:
{
path: "/about",
title: "About Us",
inMenu: true,
content: {
hero: { title: "About", subtitle: "Our Story" },
sections: [
{ type: "text", title: "Mission", content: "..." },
{ type: "team", title: "Team", members: [...] }
]
}
}Legal Pages (Privacy/Terms):
{
path: "/privacy",
title: "Privacy Policy",
inMenu: false, // Not in main nav
content: {
hero: { title: "Privacy", subtitle: "Updated: 2024" },
sections: [
{ type: "text", title: "Data Collection", content: "..." },
{ type: "text", title: "Data Usage", content: "..." }
]
}
}All pages automatically include:
- Themed navigation bar
- Consistent footer
- Responsive layout
- SEO metadata
- Implement bcrypt password hashing
- Generate and verify JWT tokens
- Add email verification flow
- Implement password reset
- Complete OAuth flows (Google, GitHub)
- Create
/dashboardroute - User profile management
- Subscription management UI
- Billing history
- Lead management interface
- User management
- Analytics dashboard
- Welcome email
- Email verification
- Password reset
- Subscription confirmation
- Lead notification formatting
- Add unit tests
- Integration tests for API routes
- E2E tests for critical flows
See config.ts for the complete configuration schema. Every piece of content on the website can be customized through this file.
All placeholders follow the pattern: {{PLACEHOLDER_NAME}}
Example:
company: {
name: "{{COMPANY_NAME}}" // Replace with: "Your Company"
}The exampleConfig export in config.ts shows a fully populated example for reference.
npm run clean-port- Verify
STRIPE_SECRET_KEYis set in .dev.vars - Check
stripePriceIdvalues in config.ts match Stripe Dashboard - Ensure Stripe publishable key is set in config.ts
# Reset local database
rm -rf .wrangler/state/v3/d1
npm run db:migrate:local# Clean and rebuild
rm -rf dist .wrangler
npm run buildLive Production Demo: This template is already deployed and running at:
- URL: https://configurable-saas-template.pages.dev
- Platform: Cloudflare Pages
- Status: β Active
- Build Time: ~2 seconds
- Global CDN: Edge-deployed in 200+ cities worldwide
Deployment Steps Used:
# 1. Build the project
npm run build
# 2. Deploy to Cloudflare Pages
npx wrangler pages deploy dist --project-name configurable-saas-template
# Result: Live in seconds! β¨Want to deploy your own? See the complete deployment guide above!
MIT License - Feel free to use this template for your SaaS projects.
For issues or questions, please check the documentation in config.ts or consult the Cloudflare Workers/Hono documentation.
- Live Demo: https://configurable-saas-template.pages.dev
- GitHub: https://github.com/MichaelTheMay/configurable-SaaS-starter-webpage
- Hono Framework: https://hono.dev
- Cloudflare Pages: https://developers.cloudflare.com/pages
Last Updated: 2025-10-27 Status: β Production-ready with live demo Tech Stack: Hono + TypeScript + Cloudflare Pages + D1 + Stripe + Resend Demo: https://configurable-saas-template.pages.dev