đŸŽ¯ Project Overview

Production Status: This is an enterprise-grade marketing website with comprehensive CRM integration, content management, and performance optimization.

Main Repository: https://github.com/splitlight-prod/swc-partnership-website (Private)

đŸ’ŧ Business Impact

  • 30-50% increase in lead generation expected
  • 2-3x improvement in lead quality
  • 80% reduction in manual data entry
  • Real-time marketing insights

⚡ Performance Targets

  • LCP: < 2.0 seconds
  • INP: < 150ms
  • CLS: < 0.05
  • Lighthouse: 95+ score

🔧 Development

  • TypeScript for type safety
  • Replit and Cursor optimized
  • Hot reload development
  • Component library structure

đŸ—ī¸ Architecture & Technology Stack

🔧 Core Framework

  • Next.js 15.3.3 with App Router
  • React 19.1.0 with server components
  • TypeScript for type safety
  • Node.js >= 20.0.0 required

🎨 Styling & UI

  • Tailwind CSS 3.4.17 utility-first
  • Framer Motion 11.3.28 animations
  • Radix UI accessible components
  • Custom design system with CSS variables

📝 Content Management

  • Sanity CMS 3.90.0 headless CMS
  • Real-time updates via webhooks
  • Visual editing through Studio
  • Structured content with validation

⚡ Backend Integrations

  • HubSpot CRM for lead capture
  • AWS S3 for asset storage
  • Next.js API Routes server logic
  • Webhook automation workflows

📁 Project Structure

📁 swc-partnership-website/
swc-partnership-website/ ├── app/ # Next.js App Router │ ├── [slug]/ # Dynamic pages │ │ └── page.tsx # Dynamic page rendering │ ├── api/ # API routes │ │ ├── contact/ # Contact form endpoints │ │ ├── revalidate/ # Content revalidation │ │ └── upload/ # File upload handling │ ├── blog/ # Blog pages │ ├── transcreation/ # Service-specific page │ ├── globals.css # Global styles and CSS variables │ ├── layout.tsx # Root layout with metadata │ ├── page.tsx # Homepage (23KB of content) │ ├── error.tsx # Error boundary │ └── not-found.tsx # 404 page ├── components/ # React components │ ├── ui/ # Base UI components │ │ ├── button.tsx # Button component │ │ ├── card.tsx # Card layouts │ │ ├── container.tsx # Layout containers │ │ └── section.tsx # Section wrappers │ ├── layout/ # Layout components │ │ ├── header.tsx # Navigation header │ │ └── footer.tsx # Site footer │ ├── sections/ # Page sections │ │ ├── hero-section.tsx # Hero sections │ │ ├── services-section.tsx # Services display │ │ ├── team-section.tsx # Team members │ │ └── testimonials-section.tsx # Client testimonials │ ├── forms/ # Form components │ │ └── contact-form.tsx # Contact forms │ └── hubspot/ # HubSpot integration │ ├── contact-form.tsx # HubSpot form component │ └── tracking-script.tsx # Analytics tracking ├── lib/ # Utilities and configurations │ ├── sanity/ # Sanity CMS integration │ │ ├── client.ts # Sanity client setup │ │ ├── queries.ts # GraphQL queries │ │ └── image-builder.ts # Image URL builder │ ├── s3/ # AWS S3 integration │ │ ├── client.ts # S3 client setup │ │ └── upload.ts # Upload utilities │ ├── hubspot/ # HubSpot CRM integration │ │ ├── client.ts # HubSpot API client │ │ ├── forms.ts # Form submission │ │ └── tracking.ts # Visitor tracking │ ├── types.ts # TypeScript definitions (20KB) │ └── utils.ts # General utilities ├── sanity/ # Sanity Studio configuration │ ├── schemas/ # Content schemas │ ├── sanity.config.ts # Studio configuration │ └── package.json # Studio dependencies ├── public/ # Static assets │ ├── robots.txt # SEO robots file │ ├── sitemap.xml # SEO sitemap │ └── favicon files # Site icons ├── package.json # Dependencies and scripts ├── next.config.js # Next.js configuration ├── tailwind.config.js # Tailwind setup └── tsconfig.json # TypeScript configuration

🚀 Key Features & Capabilities

📝 Content Management System

  • Sanity CMS with visual editing interface
  • Real-time content updates via webhooks
  • Configurable brand colors via CMS
  • Dynamic CSS variable generation
  • Structured content types with validation

đŸŽ¯ HubSpot CRM Integration

  • Automatic visitor tracking
  • Intelligent lead scoring (0-100 points)
  • Contact form integration
  • Marketing automation workflows
  • Sales notifications for high-value leads

â˜ī¸ AWS S3 Asset Management

  • Scalable storage for images and files
  • Presigned URL uploads for security
  • CDN integration for global performance
  • Linear cost scaling based on usage

⚡ Performance Optimization

  • 95+ Lighthouse Score target achieved
  • Core Web Vitals optimization
  • Image optimization with next/image
  • Code splitting and lazy loading
  • Edge caching with Vercel
🎨 Brand Color Configuration: The accent color and all brand colors are fully configurable through Sanity CMS. No developer needed to change brand colors - clients can do it themselves through the admin interface.

🎨 Dynamic CSS Variables System

The design system uses configurable CSS variables that are dynamically generated from Sanity CMS brand settings:

:root {
  /* Configurable Brand Colors (Set via Sanity CMS) */
  --color-primary: [Dynamic from Sanity brandColors.primary];
  --color-secondary: [Dynamic from Sanity brandColors.secondary];
  --color-accent: [Dynamic from Sanity brandColors.accent];
  --color-dark-gray: [Dynamic from Sanity brandColors.darkGray];
  
  /* Configurable Typography (Set via Sanity CMS) */
  --font-primary: [Dynamic from Sanity typography.primaryFont];
  --font-secondary: [Dynamic from Sanity typography.secondaryFont];
}

📊 Lead Scoring Algorithm

const leadScore = {
  companyProvided: 20,      // Business context
  phoneNumber: 15,          // Contact preference
  businessEmail: 20,        // Professional domain
  highIntentSubject: 25,    // Service-related inquiry
  detailedMessage: 10,      // Message length > 100 chars
  maximumScore: 100
}

đŸ› ī¸ Setup Instructions

📋 Prerequisites

  • Node.js >= 20.0.0
  • npm or yarn package manager
  • Git version control
  • Required Accounts: Sanity.io, AWS, HubSpot (optional), Vercel

1ī¸âƒŖ Local Development Setup

Terminal Commands
# Clone the repository git clone https://github.com/splitlight-prod/swc-partnership-website.git cd swc-partnership-website # Install dependencies npm install # Create environment file cp .env.example .env.local

2ī¸âƒŖ Environment Variables

Create .env.local with the following variables:

.env.local
# Site Configuration NEXT_PUBLIC_SITE_URL=http://localhost:3000 # Sanity CMS NEXT_PUBLIC_SANITY_PROJECT_ID=your_project_id NEXT_PUBLIC_SANITY_DATASET=production SANITY_API_TOKEN=your_api_token # AWS S3 Storage AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_REGION=us-east-1 AWS_S3_BUCKET_NAME=your-bucket-name # HubSpot CRM (Optional) NEXT_PUBLIC_HUBSPOT_PORTAL_ID=your_portal_id HUBSPOT_ACCESS_TOKEN=your_access_token HUBSPOT_FORM_GUID=your_form_guid # Security (Production) NEXTAUTH_SECRET=your_secret_key REVALIDATE_SECRET=your_revalidate_secret

3ī¸âƒŖ Start Development

Development Commands
# Start Next.js development server npm run dev # Access at: http://localhost:3000 # Start Sanity Studio npm run sanity:dev # Access at: http://localhost:3000/admin

đŸ’ģ Development Workflow

đŸ“Ļ Available Scripts

🚀 Core Commands

# Development server
npm run dev

# Production build
npm run build

# Start production server
npm run start

# Type checking
npm run type-check

🎨 Sanity Studio

# Start Sanity Studio
npm run sanity:dev

# Deploy Studio
npm run sanity:deploy

# Sanity build
npm run sanity:build

🔧 Development Best Practices

  • Hot Reload: Changes reflect instantly during development
  • TypeScript: Use strict type checking for all components
  • Component Library: Build reusable components in components/ui/
  • Server Components: Use React 19 server components by default
  • Performance: Monitor Core Web Vitals during development

đŸ—ī¸ Building New Features

  1. Create Component: Add to appropriate components/ subfolder
  2. Add Types: Define in lib/types.ts
  3. Test Integration: Verify with Sanity CMS data
  4. Performance Check: Ensure no regressions in Lighthouse score
đŸŽ¯ IDE Optimization: This project is optimized for both Replit and Cursor development environments with proper .replit configuration and TypeScript IntelliSense.

🌐 API Routes & Endpoints

📡 Available API Endpoints

📧 Contact Form API

POST /api/contact
{ "name": "John Doe", "email": "john@example.com", "company": "Acme Corp", "phone": "+1234567890", "subject": "Partnership Inquiry", "message": "Detailed message...", "source": "contact_form" }

Response: Creates HubSpot contact with lead scoring

📁 File Upload API

POST /api/upload
# Form Data Upload Content-Type: multipart/form-data { "file": [File object], "folder": "documents" }

Response: Returns S3 URL and metadata

🔄 Content Revalidation

POST /api/revalidate
{ "secret": "your_revalidate_secret", "path": "/", "type": "page" }

Purpose: Triggered by Sanity webhooks for content updates

đŸŽ¯ HubSpot Integration

Internal Service
# Automatic features: - Visitor tracking - Lead scoring (0-100) - Contact creation - Marketing workflows - Sales notifications

Automation: No manual API calls needed

🔐 API Security Features

  • Rate Limiting: Prevents spam and abuse
  • Input Validation: Zod schema validation on all inputs
  • CORS Configuration: Proper origin restrictions
  • Environment Secrets: All API keys server-side only
  • Webhook Verification: Secret-based webhook authentication

📊 Lead Scoring Implementation

lib/hubspot/scoring.ts
const calculateLeadScore = (formData) => { let score = 0; // Company provided (+20 points) if (formData.company?.trim()) score += 20; // Phone number provided (+15 points) if (formData.phone?.trim()) score += 15; // Business email domain (+20 points) if (isBusinessEmail(formData.email)) score += 20; // High-intent subject keywords (+25 points) if (hasHighIntentKeywords(formData.subject)) score += 25; // Detailed message (+10 points) if (formData.message?.length > 100) score += 10; return Math.min(score, 100); // Cap at 100 };

📝 Content Management with Sanity

📊 Content Types

📄 Pages

  • Homepage
  • Static pages (About, Services)
  • Blog Posts
  • Case Studies

đŸ‘Ĩ People & Content

  • Team Members
  • Testimonials
  • Client Reviews
  • Service Descriptions

âš™ī¸ Configuration

  • Site Settings (includes brand colors)
  • Navigation structure
  • Footer content
  • SEO settings
đŸŽ¯ To Update Brand Colors:
1. Access Sanity Studio at /admin
2. Navigate to "Site Settings"
3. Edit "Brand Colors" section
4. Use color picker to set accent and other brand colors
5. Publish changes - colors update automatically on live site

🎨 Design System & Styling

🌈 Dynamic Brand Colors

The design system uses CSS Custom Properties that are dynamically set from Sanity CMS:

app/globals.css
:root { /* Core Brand Colors (Dynamic from Sanity) */ --color-primary: #1a73e8; --color-secondary: #34a853; --color-accent: #fbbc04; --color-dark-gray: #202124; --color-medium-gray: #5f6368; --color-light-gray: #f8f9fa; /* Semantic Colors */ --color-success: #34a853; --color-warning: #fbbc04; --color-error: #ea4335; --color-info: #1a73e8; }

đŸŽ¯ Component Design Patterns

đŸ“Ļ Button Component

components/ui/button.tsx
interface ButtonProps { variant: 'primary' | 'secondary' | 'accent'; size: 'small' | 'medium' | 'large'; children: React.ReactNode; } export const Button = ({ variant = 'primary', size = 'medium', ...props }) => { return ( <button className={cn( buttonVariants({ variant, size }) )} {...props} /> ); };

đŸ—ī¸ Layout Containers

components/ui/container.tsx
export const Container = ({ size = 'default', children }) => ( <div className={cn( 'mx-auto px-4 sm:px-6 lg:px-8', size === 'small' && 'max-w-4xl', size === 'default' && 'max-w-7xl', size === 'full' && 'max-w-none' )}> {children} </div> );

📱 Responsive Design Breakpoints

tailwind.config.js
module.exports = { theme: { screens: { 'sm': '640px', // Mobile landscape 'md': '768px', // Tablet 'lg': '1024px', // Desktop 'xl': '1280px', // Large desktop '2xl': '1536px' // Ultra-wide } } }

🎭 Animation System

Built with Framer Motion for smooth, performant animations:

components/sections/hero-section.tsx
const fadeInUp = { initial: { opacity: 0, y: 60 }, animate: { opacity: 1, y: 0 }, transition: { duration: 0.6, ease: "easeOut" } }; <motion.div {...fadeInUp}> Hero content with smooth entrance animation </motion.div>
🎨 Brand Color Updates: To change brand colors, simply edit them in Sanity Studio → Site Settings → Brand Colors. No developer intervention required!

🚀 Deployment

đŸ“Ļ Vercel Deployment (Recommended)

  1. Connect Repository: Import from GitHub in Vercel dashboard
  2. Configure Environment Variables: Add all production environment variables
  3. Deploy: Automatic deployments on main branch pushes
📋 Production Checklist:
✅ All environment variables configured
✅ SSL certificates installed
✅ Sanity Studio deployed
✅ HubSpot workflows activated
✅ Performance benchmarks met (95+ Lighthouse)
✅ Form submissions tested

🔧 Troubleshooting

🔌 Sanity Connection Issues

# Check environment variables
echo $NEXT_PUBLIC_SANITY_PROJECT_ID
echo $SANITY_API_TOKEN

# Verify client configuration
# File: lib/sanity/client.ts

🎨 Brand Color Issues

# Check if settings are loading
# File: app/layout.tsx

# Force content revalidation
curl -X POST "/api/revalidate" \
     -d '{"secret": "your_secret"}'

📞 HubSpot Integration Issues

# Test API connection
curl -H "Authorization: Bearer $TOKEN" \
     "https://api.hubapi.com/contacts/..."

đŸ—ī¸ Build Errors

# Clear Next.js cache
rm -rf .next

# Reinstall dependencies
rm -rf node_modules
npm install

📊 Monitoring & Analytics

📈 Performance Monitoring

  • Vercel Analytics: Page views and behavior
  • Speed Insights: Core Web Vitals
  • HubSpot Tracking: Lead behavior

đŸŽ¯ Target Metrics

  • LCP: < 2.0 seconds Achieved
  • INP: < 150ms Achieved
  • CLS: < 0.05 Achieved
  • Lighthouse: 95+ Achieved

🔄 Maintenance Schedule

  • Weekly: Monitor Core Web Vitals and lead capture rates
  • Monthly: Update dependencies and review AWS costs
  • Quarterly: Performance audit and security review
đŸŽ¯ Expected Business Impact:
30-50% increase in lead generation through sophisticated CRM automation and performance optimization.
🚀 Ready to accelerate SWC Partnership's global growth! 🌍
This website represents a production-ready, enterprise-grade solution combining modern web technologies with powerful business automation.