# anthonycroft/french-tutoring-website-react architecture

> Architecture diagram of the GitHub repository anthonycroft/french-tutoring-website-react, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anthonycroft/french-tutoring-website-react
- Repository: https://github.com/anthonycroft/french-tutoring-website-react

## Overview

##### Project type and purpose
- This is a static, single-page application (SPA) built in React.js.
- Its purpose is to allow users to browse three themed learning-paths (“Business”, “Kids”, “Fun”), listen to audio clips, view images, watch a YouTube video, and book lessons via an embedded Calendly widget or a form.

##### File structure
- Top level:
– package.json / node_modules → build & dependency management (npm).
– public/ → static assets served directly (index.html, manifest, audio clips, redirects).
– src/ → React source code, split into:
- components/ → presentational & widget components (Navbar, Footer, SoundClip, Calendly, etc.).
- pages/ → route targets for each theme and 404 handling.
- data/ → JSON files that drive content in components (navbarData.json, bioData.json, etc.).
- assets/ → images, wireframes, supporting JS scripts.
- App.js, index.js → root of the SPA and React-Router setup.

##### Readme insights
- Confirms SPA, built with React.
- Uses external APIs/services:
– Calendly (booking widget)
– YouTube embed
– Unsplash (fetching images via API)
- Hosted via Netlify (inferred from deployed link and use of public/_redirects).

##### Main components & their interactions
a. Client/User Browser
– Loads index.html from Netlify CDN → downloads bundled JS/CSS.
– Executes React application.
b. React SPA
– App Shell (App.js + React-Router)
– Components: Navbar (theme toggle), Jumbotron, Bio, PackageCard, SoundClip, Testimonials, Footer
– Pages: Business, Kids, Fun
– Data Layer: JSON files in src/data drive content; loaded at build time or via import.
c. Static Assets
– Audio files (public/sounds) served by CDN.
– Images (public & src/assets/images)
d. External Services
– Unsplash API → React components call to fetch theme-relevant images at runtime.
– YouTube iframe → embedded in VocalVideo component.
– Calendly widget → embedded in Calendly component for booking.
– (Optional) Form submission provider – if follow-up lessons form posts to a third-party endpoint.
e. Build & Deployment
– npm scripts / webpack (Create-React-App under the hood) produce a /build folder.
– Deployed to Netlify; uses public/_redirects for client-side routing fallbacks.

##### Architectural patterns & design principles
- Component-based architecture (React).
- Client-side routing (React-Router).
- Separation of concerns: Presentational vs data-driven components.
- Static site + JS interactions with external REST/iframe APIs.

a. Layers horizontally or vertically:
– Left: User Browser (UI Layer)
– Middle: React SPA (App Shell, Components, Data Imports)
– Right: External Resources (CDN, APIs, Embeds)
– Browser → CDN (initial asset download)
– React Components → JSON data imports (at build time)
– Runtime calls:
- React → Unsplash API
- React → Calendly widget iframe
- React → YouTube iframe
c. Build process:
– Node/npm → webpack/babel → bundle → deploy to Netlify
d. Technologies:
– React.js, React-Router, Create-React-App
– Netlify CDN, public/_redirects
– Unsplash API, YouTube embed, Calendly embed

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% UI Layer
    subgraph "UI Layer"
        direction TB
        Browser["User Browser"] 
        subgraph "React SPA"
            direction TB
            Index["index.js"]:::reactComp
            AppShell["App.js (App Shell & Routing)"]:::reactComp
            subgraph "Components"
                direction TB
                Navbar["Navbar Component"]:::reactComp
                Jumbotron["Jumbotron Component"]:::reactComp
                Bio["Bio Component"]:::reactComp
                PackageCard["PackageCard Component"]:::reactComp
                SoundClip["SoundClip Component"]:::reactComp
                Testimonials["Testimonials Component"]:::reactComp
                ButtonBar["ButtonBar Component"]:::reactComp
                CalendlyComp["Calendly Widget Component"]:::reactComp
                UnsplashWrap["Unsplash API Wrapper Component"]:::reactComp
                UnsplashImg["Unsplash Image Display Component"]:::reactComp
                VocalVideo["VocalVideo Component"]:::reactComp
            end
            subgraph "Pages"
                direction TB
                BusinessPage["Business Page"]:::reactComp
                KidsPage["Kids Page"]:::reactComp
                FunPage["Fun Page"]:::reactComp
                NotFound["404 NotFound Page"]:::reactComp
            end
            subgraph "Data Layer"
                direction TB
                JSONData["Static Data (JSON files)"]:::staticData
            end
            subgraph "Assets"
                direction TB
                AudioAssets["Audio Assets (public/sounds/)"]:::staticData
                ImageAssets["Image & Wireframe Assets"]:::staticData
                Redirects["public/_redirects"]:::staticData
            end
        end
    end

    %% Build & Deployment
    subgraph "Build & Deploy"
        direction TB
        NPM["package.json / package-lock.json"]:::reactComp
        BuildProcess["npm scripts / CRA build"]:::reactComp
        BuildFolder["/build Folder"]:::staticData
        Netlify["Netlify CDN"]:::cdn
    end

    %% External Services
    subgraph "External Services"
        direction TB
        UnsplashAPI["Unsplash API"]:::external
        YouTube["YouTube Embed"]:::external
        Calendly["Calendly Embed"]:::external
        FormEndpoint["Form Submission Endpoint"]:::external
    end

    %% Connections
    Browser -->|Loads index.html & bundles| Netlify
    Netlify -->|Serves index.html, JS, CSS| Browser
    Browser -->|Executes SPA| Index
    Index --> AppShell
    AppShell --> Navbar
    AppShell --> Jumbotron
    AppShell --> Pages
    AppShell --> Footer["Footer Component"]:::reactComp
    AppShell --> JSONData
    JSONData -->|Build-time import| Navbar
    JSONData --> Bio
    JSONData --> PackageCard
    JSONData --> Testimonials
    JSONData --> Footer
    AppShell --> AudioAssets
    SoundClip --> AudioAssets
    UnsplashWrap --> UnsplashAPI
    UnsplashWrap --> UnsplashImg
    VocalVideo --> YouTube
    CalendlyComp --> Calendly
    ButtonBar --> CalendlyComp
    ButtonBar --> VocalVideo
    Footer --> Redirects
    BuildProcess --> BuildFolder
    BuildFolder --> Netlify
    Browser -->|Form submit| FormEndpoint

    %% Click Events
    click Index "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/index.js"
    click AppShell "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/App.js"
    click Navbar "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/Navbar.js"
    click Jumbotron "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/Jumbotron.js"
    click Bio "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/Bio.js"
    click PackageCard "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/PackageCard.js"
    click SoundClip "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/SoundClip.js"
    click Testimonials "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/Testimonials.js"
    click ButtonBar "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/ButtonBar.js"
    click CalendlyComp "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/Calendly.js"
    click UnsplashWrap "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/UnsplashComp.js"
    click UnsplashImg "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/UnsplashImg.js"
    click VocalVideo "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/components/VocalVideo.js"
    click BusinessPage "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/pages/Business.js"
    click KidsPage "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/pages/Kids.js"
    click FunPage "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/pages/Fun.js"
    click NotFound "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/src/pages/NotFound.js"
    click JSONData "https://github.com/anthonycroft/french-tutoring-website-react/tree/main/src/data/"
    click AudioAssets "https://github.com/anthonycroft/french-tutoring-website-react/tree/main/public/sounds/"
    click ImageAssets "https://github.com/anthonycroft/french-tutoring-website-react/tree/main/src/assets/images/"
    click Redirects "https://github.com/anthonycroft/french-tutoring-website-react/tree/main/public/_redirects"
    click NPM "https://github.com/anthonycroft/french-tutoring-website-react/blob/main/package.json"

    %% Styles
    classDef reactComp fill:#ADD8E6,stroke:#000
    classDef staticData fill:#90EE90,stroke:#000
    classDef external fill:#FFA500,stroke:#000
    classDef cdn fill:#D3D3D3,stroke:#000
```
