How iku-earth/terrum-home-site works
Project Type and Purpose
• This is a full-stack web application built with Next.js (React + Node.js).
• It serves a marketing/landing site (with pages like home, events, policies, contact us) and exposes a serverless API endpoint for handling “Contact Us” form submissions.
File Structure Analysis
• app/ (Next.js App Directory)
• page.tsx and subfolders: React Server Components for each route (home, events/[id], cancellation-policy, privacy, etc.)
• api/submit-contact-us-form/route.ts: serverless function (Node.js) for form submissions
• layout.tsx: global layout wrapper
• globals.css: global stylesheet
• components/
• landing/: reusable landing-page sections (header, welcome, focus, carousel, etc.)
• ui/: design system primitives (Button, Card, Input, Form, etc.)
• other shared React components (contact-form.tsx, experience-card.tsx, footer, warning-stripes, etc.)
• lib/utils.ts and utils/fonts.ts: shared business logic and font configuration
• config files: next.config.js, tailwind.config.js, tsconfig.json, postcss.config.js
• package.json / lock file: dependencies and scripts
Key Architectural Patterns
• Monorepo-style single Next.js app combining SSR/SSG pages and API routes.
• Component-driven UI with a separation between design system primitives (components/ui) and use-case-specific sections (components/landing).
• Serverless backend via Next.js API Routes, deployed on Vercel.
• Static asset hosting (public/) and CSS utility framework (Tailwind CSS).
Main Components
a. Browser (client)
b. CDN / Edge Network (Vercel)
c. Next.js Application Server (serverless)
• React Server Components (app/pages)
• API Route: submit-contact-us-form
• Layout and CSS pipeline (global styles, Tailwind)
d. Component Library
• UI primitives
• Landing page sections
e. Static Assets Store (public/)
f. External Services (optionally)
• Email service or CRM for form data (if used by route.ts)
• Analytics, if integrated later
Relationships and Data Flows
1. Client → CDN: requests HTML/CSS/JS, images, fonts
2. CDN → Next.js Serverless: SSR or SSG page rendering
3. Next.js → Public assets: serves static files
4. Client UI Components ←→ React Server Components / Props
5. Client → API Route (POST /api/submit-contact-us-form)
6. API Route → External Service (e.g., email/CRM)
7. Response → Client (success/failure UI)
Essential Elements Checklist
• Shaded grouping for related folders (e.g., all UI components in one cluster)