Architecture Overview
This document provides a high-level overview of the Infowebplus architecture.
System Architecture
Infowebplus is built as a modern, serverless web application with the following components:
┌─────────────────┐
│ Next.js App │
│ (Frontend + │
│ API Routes) │
└────────┬────────┘
│
├─────────────────┐
│ │
┌────────▼────────┐ ┌─────▼──────┐
│ Sanity CMS │ │ Redis │
│ (Content) │ │ (Cache) │
└─────────────────┘ └────────────┘
│
│
┌────────▼────────┐
│ HubSpot CRM │
│ (Quote Leads) │
└─────────────────┘
Technology Stack
Frontend
- Next.js 15 - React framework with App Router
- TypeScript - Type safety
- Tailwind CSS - Utility-first CSS
- Framer Motion - Animations
- next-intl - Internationalization
Backend
- Next.js API Routes - Serverless functions
- Sanity CMS - Headless CMS
- Redis/In-Memory Cache - Caching layer
- HubSpot API - CRM integration
Infrastructure
- Vercel - Hosting and deployment
- Cloudflare Pages - Documentation hosting
- Sanity CDN - Content delivery
Data Flow
Content Delivery
- User requests a page
- Next.js checks cache (Redis or in-memory)
- If cache miss, fetch from Sanity CMS
- Cache the response
- Render page with content
Quote Submission
- User fills quote calculator
- Real-time tracking via
/api/quote/track - Form submission via
/api/quote/submit - Data saved to Sanity CMS
- Contact created in HubSpot
- PDF generated and emailed
Caching Strategy
Multi-layer caching:
- In-Memory Cache - Fast, local cache (fallback)
- Redis Cache - Distributed cache (production)
- Next.js ISR - Incremental Static Regeneration
- Sanity CDN - Always enabled
See Caching Documentation for details.
Security
- Environment variables for sensitive data
- API route authentication tokens
- Sanity webhook secret validation
- CORS configuration
- Rate limiting (via Vercel)
Performance
- Static generation where possible
- ISR with 1-hour revalidation
- Image optimization via Next.js Image
- Code splitting and lazy loading
- CDN delivery for static assets