A modern, conversion-optimized website for B2B SaaS companies built with Next.js 15, TypeScript, and Tailwind CSS. Features interactive tools, lead capture, and comprehensive SEO optimization.
- Interactive ROI Calculator - Real-time revenue projections with lead capture
- Exit Intent Popup - News-site style popup with slow blur effect
- Multi-step Lead Capture - Progressive forms with validation
- A/B Testing Ready - Component structure for easy testing
- Responsive Design - Mobile-first approach with Tailwind CSS
- Dark Theme - Professional dark UI with electric blue accents
- Smooth Animations - CSS-based animations for performance
- Typography System - Scalable typography with proper hierarchy
- Structured Data - Complete JSON-LD markup for better SEO
- Meta Tags - Comprehensive Open Graph and Twitter cards
- Performance Optimized - Image optimization, lazy loading, and more
- Accessibility - WCAG 2.1 compliant with proper focus management
- Revenue Calculator - Slider-based input with real-time calculations
- Lead Scoring - Automatic lead qualification based on company size/MRR
- Resource Library - Downloadable guides, case studies, and templates
- Company Logo Showcase - Real logos via Clearbit API
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- UI Components: Radix UI + shadcn/ui
- Forms: React Hook Form + Zod validation
- Icons: Lucide React
- Animation: CSS transitions and transforms
- Deployment: Vercel (recommended)
-
Clone the repository
git clone https://github.com/yourusername/astragtm.git cd astragtm -
Install dependencies
npm install # or pnpm install -
Set up environment variables
cp .env.example .env.local
Edit
.env.localwith your configuration:NEXT_PUBLIC_SITE_URL=http://localhost:3000 NEXT_PUBLIC_SITE_NAME="Astra GTM" # Add your API keys and configuration HUBSPOT_API_KEY=your_hubspot_key MAILCHIMP_API_KEY=your_mailchimp_key # ... see .env.example for full list
-
Run the development server
npm run dev
-
Open in browser Navigate to http://localhost:3000
astragtm/
βββ app/ # Next.js App Router pages
β βββ about/ # About page
β βββ blog/ # Blog listing
β βββ case-studies/ # Case studies
β βββ contact/ # Contact form
β βββ pricing/ # Pricing page
β βββ api/ # API routes
β β βββ leads/ # Lead capture endpoint
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Homepage
βββ components/ # React components
β βββ ui/ # Base UI components
β β βββ cta-button.tsx # Call-to-action button
β β βββ roi-calculator.tsx # ROI calculator tool
β β βββ exit-intent-popup.tsx # Exit intent popup
β β βββ lead-capture-form.tsx # Lead forms
β β βββ metric-stat.tsx # Animated statistics
β βββ sections/ # Page sections
β β βββ hero-section.tsx # Hero with animations
β β βββ client-logo-bar.tsx # Company logos
β β βββ resources-section.tsx # Content library
β β βββ ...
β βββ layout/ # Layout components
β βββ navbar.tsx # Navigation
β βββ footer.tsx # Footer
βββ lib/ # Utilities
β βββ utils.ts # Helper functions
βββ public/ # Static assets
βββ images/ # Image assets
The design system uses CSS variables in app/globals.css:
:root {
--dark-navy: #0B1426;
--deep-purple: #1E0B2E;
--electric-blue: #00D4FF;
--star-white: #F8FAFC;
}Responsive typography is defined in app/globals.css with utility classes:
.text-large {
@apply text-lg md:text-xl lg:text-2xl leading-relaxed;
}Use the component classes for consistent styling:
.btn-primary {
@apply bg-gradient-to-r from-electric-blue to-purple-400 text-dark-navy;
}POST /api/leads- Capture leads with validationGET /api/leads- Health check
- ROI Calculator submissions
- Exit intent popup
- Contact form submissions
- Resource downloads
- Newsletter signups
The lead capture system is designed to integrate with:
- CRM: HubSpot, Salesforce, Pipedrive
- Email Marketing: Mailchimp, ConvertKit, Campaign Monitor
- Analytics: Google Analytics, Mixpanel, Amplitude
- Notifications: Slack, Discord, email alerts
- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on every push
npm run build
npm startNEXT_PUBLIC_SITE_URL=https://yourdomain.com
HUBSPOT_API_KEY=your_production_key
DATABASE_URL=your_database_url
# ... see .env.example for complete listnpm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run type-check # Run TypeScript checks- Image Optimization: Next.js Image component with lazy loading
- Font Optimization: Google Fonts with
font-display: swap - Code Splitting: Automatic code splitting by Next.js
- CSS Optimization: Tailwind CSS purging and compression
- Bundle Analysis: Built-in bundle analyzer
npm run build
npm run analyze # Analyze bundle size- Input Validation: Zod schemas for all forms
- CSRF Protection: Built-in Next.js protection
- Rate Limiting: API route protection (add your own)
- Environment Variables: Secure credential management
- Content Security Policy: Ready for CSP headers
npm install --save-dev @testing-library/react @testing-library/jest-dom jest- Unit tests for utility functions
- Component tests for UI components
- Integration tests for API routes
- E2E tests for critical user flows
Report bugs and feature requests in the GitHub Issues
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Hero section copy variations
- CTA button colors and text
- Exit intent timing and offers
- Pricing page layouts
- Form field combinations
- ROI calculator completion rate
- Exit intent popup conversion
- Time spent on pricing page
- Resource download rates
- Contact form abandonment
- Core Web Vitals scores
- Page load times
- Mobile usability
- SEO ranking improvements
Built with β€οΈ for SaaS growth teams