# riz254/greenwise-travels architecture

> Architecture diagram of the GitHub repository riz254/greenwise-travels, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/riz254/greenwise-travels
- Repository: https://github.com/riz254/greenwise-travels

## Overview

##### 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)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    subgraph "Client Browser" 
        direction TB
        Browser["Web/Desktop/Mobile"]:::client
    end

    %% Server Layer
    subgraph "Next.js Server (Node.js SSR/SSG)" 
        direction TB
        NextServer["Next.js App Server"]:::server
        NextServer -->|"handles HTTP request"| Routing["File-System Routing"]:::server
    end

    Browser -->|"HTTP request"| NextServer
    NextServer -->|"renders HTML"| Browser

    %% Source Modules
    subgraph "Source Code Modules" 
        direction TB
        Layout["layout.tsx"]:::code
        Page["page.tsx"]:::code
        GlobalsCSS["globals.css"]:::asset
        Utils["utils.ts"]:::code
        subgraph "Components" 
            direction TB
            Navbar["Navbar.tsx"]:::code
            Hero["Hero.tsx"]:::code
            Destinations["Destinations.tsx"]:::code
            Greenwise["GreenwiseDifference.tsx"]:::code
            Intro["Intro.tsx"]:::code
            Itineraries["Itineraries.tsx"]:::code
            Process["Process.tsx"]:::code
            Services["Services.tsx"]:::code
            Header["Header.tsx"]:::code
            Footer["Footer.tsx"]:::code
            Bootstrap["BootstrapProvider.tsx"]:::code
        end
        Routing --> Layout
        Layout --> Page
        Page --> Components
        Layout --> GlobalsCSS
        Page --> GlobalsCSS
        Page --> Utils
    end

    %% Static Assets
    subgraph "Static Asset Store" 
        direction TB
        PublicImages["public/images/"]:::asset
        PublicVideos["Magical Kenya.mp4"]:::asset
        NextServer --> PublicImages
        NextServer --> PublicVideos
    end

    %% Build & Tooling
    subgraph "Build & Tooling Layer" 
        direction TB
        Tailwind["tailwind.config.js"]:::build
        PostCSS["postcss.config.mjs"]:::build
        ESLint["eslint.config.mjs"]:::build
        NextConfig["next.config.ts"]:::build
        TSConfig["tsconfig.json"]:::build
        Package["package.json / package-lock.json"]:::build
        Tailwind -->|"CSS generation"| NextServer
        PostCSS -->|"CSS processing"| NextServer
        ESLint --> NextServer
        NextConfig --> NextServer
        TSConfig --> NextServer
        Package --> NextServer
    end

    %% Deployment
    Vercel["Vercel Hosting"]:::external
    NextServer -->|"deploy/build"| Vercel

    %% Click Events
    click Layout "https://github.com/riz254/greenwise-travels/blob/master/src/app/layout.tsx"
    click Page "https://github.com/riz254/greenwise-travels/blob/master/src/app/page.tsx"
    click GlobalsCSS "https://github.com/riz254/greenwise-travels/blob/master/src/app/globals.css"
    click Navbar "https://github.com/riz254/greenwise-travels/blob/master/src/components/Navbar.tsx"
    click Hero "https://github.com/riz254/greenwise-travels/blob/master/src/components/Hero.tsx"
    click Destinations "https://github.com/riz254/greenwise-travels/blob/master/src/components/Destinations.tsx"
    click Greenwise "https://github.com/riz254/greenwise-travels/blob/master/src/components/GreenwiseDifference.tsx"
    click Intro "https://github.com/riz254/greenwise-travels/blob/master/src/components/Intro.tsx"
    click Itineraries "https://github.com/riz254/greenwise-travels/blob/master/src/components/Itineraries.tsx"
    click Process "https://github.com/riz254/greenwise-travels/blob/master/src/components/Process.tsx"
    click Services "https://github.com/riz254/greenwise-travels/blob/master/src/components/Services.tsx"
    click Header "https://github.com/riz254/greenwise-travels/blob/master/src/components/Header.tsx"
    click Footer "https://github.com/riz254/greenwise-travels/blob/master/src/components/Footer.tsx"
    click Bootstrap "https://github.com/riz254/greenwise-travels/blob/master/src/components/BootstrapProvider.tsx"
    click Utils "https://github.com/riz254/greenwise-travels/blob/master/src/lib/utils.ts"
    click PublicImages "https://github.com/riz254/greenwise-travels/tree/master/public/images/"
    click PublicVideos "https://github.com/riz254/greenwise-travels/blob/master/public/videos/Magical Kenya.mp4"
    click Tailwind "https://github.com/riz254/greenwise-travels/blob/master/tailwind.config.js"
    click PostCSS "https://github.com/riz254/greenwise-travels/blob/master/postcss.config.mjs"
    click ESLint "https://github.com/riz254/greenwise-travels/blob/master/eslint.config.mjs"
    click NextConfig "https://github.com/riz254/greenwise-travels/blob/master/next.config.ts"
    click TSConfig "https://github.com/riz254/greenwise-travels/blob/master/tsconfig.json"
    click Package "https://github.com/riz254/greenwise-travels/blob/master/package.json"
    click Vercel "https://github.com/riz254/greenwise-travels/blob/master/README.md"

    %% Styles
    classDef client fill:#E8F0FE,stroke:#4285F4,color:#1A73E8
    classDef server fill:#F1F8E9,stroke:#689F38,color:#33691E
    classDef code fill:#FFF8E1,stroke:#F9A825,color:#FF6F00
    classDef asset fill:#E0F7FA,stroke:#00ACC1,color:#006064
    classDef build fill:#F3E5F5,stroke:#8E24AA,color:#6A1B9A
    classDef external fill:#FFEBEE,stroke:#D32F2F,color:#C62828
    class Routing,Components code
```
