How riz254/greenwise-travels works
Project Type and Purpose
• This is a frontend web application built with Next.js (React + TypeScript) and styled with Tailwind CSS.
• Its primary function is to serve a static/SSR marketing site with multiple UI sections (Hero, Services, Itineraries, etc.) and deliver static assets (images, videos).
File Structure Analysis
• Top‐level files:
• next.config.ts, tsconfig.json, tailwind.config.js, postcss.config.mjs, eslint.config.mjs – configuration for Next.js build, TypeScript, Tailwind, PostCSS, and linting.
• package.json / package-lock.json – dependencies and NPM scripts (dev, build, start).
• public/ – static assets (images + videos) served directly.
• src/app/ – Next.js “App Router” directory:
• layout.tsx – root layout that wraps all pages (e.g., Header, Footer).
• page.tsx – the home page content.
• globals.css – global styles.
• src/components/ – reusable React UI components (Navbar, Hero, Destinations, Process, Footer, etc.).
• src/lib/utils.ts – shared utility functions.
Insights from README
• Bootstrapped with create-next-app.
• Uses next/font for automatic font optimization.
• Deploys easily on Vercel.
a. Main Components
• Client Browser (web/desktop/mobile)
• Next.js App Server (Node.js SSR/SSG runtime)
• React Component Layer (src/app + src/components)
• Static Asset Store (public/)
• Utility Module (src/lib/utils.ts)
• Build & Tooling Layer (Webpack/RSC/Next compiler, Tailwind + PostCSS)
• External Hosting (Vercel or any Node hosting)
b. Relationships & Data Flow
1. Browser → HTTP request → Next.js Server
2. Next.js Server uses file‐system routing (src/app) to resolve the route.
3. The server invokes React components (layout.tsx + page.tsx + shared components) to render HTML (SSR or SSG).
4. During render, components pull in CSS (globals.css + Tailwind), fonts (next/font), and utils from src/lib/utils.ts.
5. Server serves optimized JS/CSS bundles and static assets (images/videos) from public/.
6. Browser hydrates the page with React.
c. Architectural Patterns & Principles
• Component‐Based UI (React)
• File‐System Routing (Next.js App Router)
• Server‐Side Rendering (SSR) / Static Site Generation (SSG)
• Utility abstraction (shared functions in lib/)
• Configuration‐driven build (Tailwind, PostCSS, ESLint)
d. Key Technologies & Frameworks
• Next.js (App Router, next/font)
• React + TypeScript
• Tailwind CSS + PostCSS
• Vercel (hosting & deployment)
• Node.js (SSR runtime)