How darkamui/seaview-penthouse works
Project Type & Purpose
• This is a full-stack, production-ready vacation-rental website built on Next.js (App Router) with static generation (SSG) and PWA capabilities, backed by a Sanity headless CMS. It also includes a standalone Sanity Studio for content management, plus integrations with external services (Google Analytics, CDN, etc.).
File-Structure–Based Architecture Analysis
• Next.js “app” directory – the public-facing frontend. File-based, locale-prefixed routes under app/[locale], PWA manifest, global layout and CSS.
• components/ – UI building blocks (shadcn/ui wrappers, image carousel, modals, hero sections, forms, etc.).
• lib/ – data-fetching and utility functions (Sanity client, structured data/SEO, scroll-animation hooks).
• i18n/ + messages/ – next-intl configuration and JSON translation files for 3 locales (he, en, fr) with RTL/LTR handling.
• sanity-studio/ – separate admin panel code (custom schemas, actions, scripts, styles) that connects to the same Sanity dataset.
• CI/CD – GitHub Actions workflow for deploy, Dockerfile for containerized production.
Key README Insights
• SSG for all routes + lazy client components.
• PWA via public/manifest.ts + custom sw.js.
• SEO via JSON-LD, Open Graph, hreflang, manual sitemap.
• Deployable as Docker container (standalone output) or on platforms like Vercel.
Main Components & Relationships
a. Client (Browser & PWA Service Worker)
• Fetches static or server-rendered pages from Next.js.
• Registers service worker for offline support, caching, “Install App.”
• Loads static assets (images, CSS, JS) via CDN or Next.js static server.
• Sends analytics events to Google Analytics.
b. Next.js Frontend
• Routes under app/[locale], uses getStaticProps/getStaticPaths + dynamic metadata.
• Components consume lib/sanity.client.ts to fetch data at build time or runtime.
• Integrates next-intl for translations + automatic RTL/LTR switches.
• Exposes API routes (if any) or uses direct Sanity HTTP calls.
c. Sanity Headless CMS (Content API)
• Stores all content (events, gallery images, amenities, translations).
• Queried by the Next.js app via Sanity client.
• Driven by custom GROQ queries in lib/sanity.queries.ts.
d. Sanity Studio (Admin UI)
• Separate React/TypeScript app under sanity-studio/.
• Deploys to its own URL.
• Reads/writes from the same Sanity dataset; includes custom actions & scripts for bulk upload, auto-tagging.
e. External Services
• Google Analytics for usage metrics.
• CDN or static file hosting for images, video, fonts.
• DNS/SSL provider, Docker registry (if containerized).
f. CI/CD Pipeline
• GitHub Actions → Build & Deploy Docker image → Production environment.
Architectural Patterns & Principles
• File-based routing & SSG – clear separation of pages per locale.
• Headless CMS – content–presentation decoupling.
• Client/Server Component Split – interactive bits lazy-loaded as client components.
• Progressive Enhancement – PWA, offline service worker, manifest.
• i18n – next-intl config, locale subpaths, JSON translation files.
• SEO best practices – structured data, dynamic meta, sitemap, robots.