# arlaudcyril/test-landing architecture

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

- Interactive diagram: https://gitdiagram.com/arlaudcyril/test-landing
- Repository: https://github.com/arlaudcyril/test-landing

## Overview

##### Project type and purpose
- This is a single-page frontend application (SPA) bootstrapped with Create React App.
- It presents marketing pages, user flows (login, reset password, unsubscribe, verify email), rich typography (custom fonts), and on-chain interactions (claim tokens via smart contracts).

##### File structure
- Top-level:
- public/ – static assets served by the web server or CDN (index.html, manifest, robots.txt, images, fonts).
- src/ – application source code:
– App.js + routing entry point (React Router manages pages under src/pages/).
– src/components/ – reusable UI components grouped by domain (articles, claimToken, contactForm, layout, etc.).
– src/context/ – global state management (Context + reducers + actions).
– src/utils/ – API wrappers (henceforthApi) and validation constants.
– src/assets/ – fonts, images, and SCSS styles.
- .github/workflows/main.yml – CI pipeline (build/test/deploy).

##### README for additional insights
- Confirms standard CRA lifecycle (npm start, build, test, eject), no custom backend here.
- Uses standard Webpack/Babel under the hood.

##### Main components and interactions
1) User’s Browser/Client
– Static Host/CDN (serves public/*)
– React SPA
- Routing Module (React Router)
- UI Components (src/components)
- Pages (src/pages)
- State Layer (Context Provider + Reducers)
- Style Layer (SCSS modules imported into components)
- Utility Layer (henceforthApi calls, validation)
- Blockchain Connector (Web3/Ethers + ABI JSON under src/components/claimToken/contract)
2) External Services
– REST API Backend (henceforthApi endpoints)
– Ethereum (or EVM-compatible) Network / Smart Contracts
3) CI/CD Pipeline
– GitHub Actions (checkout → install → test → build → deploy)
- Browser → Static Host (initial GET /index.html)
- index.html loads React bundle → React App bootstraps
- React App (UI) ←→ State Layer (dispatch actions, subscribe to state)
- State Layer → Utility Layer → Backend REST API (HTTP) → returns JSON → updates State → rerenders UI
- ClaimToken Component → Blockchain Connector → Smart Contract → returns tx receipt → updates State → UI
- GitHub Actions → on push to main → runs tests → builds assets → deploys to Static Host/CDN
c. Architectural patterns & design principles:
– SPA with client routing (no full-page reloads)
– Flux-style unidirectional data flow (Context + Reducers)
– Separation of concerns: UI vs. State vs. Services vs. Assets
– Modular SCSS for styling
– Immutable state updates in reducers
– CI/CD promotion of code through test → build → deploy
d. Key technologies & frameworks:
– React, React Router, Context API
– Webpack/Babel (via CRA)
– SCSS modules
– GitHub Actions
– Web3/Ethers + Smart Contracts (ABI JSON)
– REST API (henceforthApi wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Browser and Static Host
    Browser["User's Browser/Client"]:::client
    StaticHost["Static Host/CDN\n(public/)"]:::client
    click StaticHost "https://github.com/arlaudcyril/test-landing/tree/main/public/"

    Browser -->|"GET /index.html"| StaticHost
    StaticHost -->|"serves React bundle\n(index.html + JS/CSS)"| ReactBundle

    %% React Application Bundle
    ReactBundle["React App Bundle\n(src/index.js, src/App.js)"]:::client
    click ReactBundle "https://github.com/arlaudcyril/test-landing/blob/main/src/index.js"
    click ReactBundle "https://github.com/arlaudcyril/test-landing/blob/main/src/App.js"

    ReactBundle -->|"bootstraps"| ReactApp

    %% React App Internal Layers
    subgraph "React App" 
        direction TB
        Router["Routing Module\n(src/App.js)"]:::client
        click Router "https://github.com/arlaudcyril/test-landing/blob/main/src/App.js"
        UI["UI Components\n(src/components/)"]:::client
        click UI "https://github.com/arlaudcyril/test-landing/tree/main/src/components/"
        Pages["Pages\n(src/pages/)"]:::client
        click Pages "https://github.com/arlaudcyril/test-landing/tree/main/src/pages/"
        State["State Layer\nProvider, Actions, Reducers"]:::client
        subgraph "Context API"
            Provider["Provider\n(src/context/Provider.js)"]:::client
            click Provider "https://github.com/arlaudcyril/test-landing/blob/main/src/context/Provider.js"
            Actions["Actions\n(src/context/actions/)"]:::client
            click Actions "https://github.com/arlaudcyril/test-landing/tree/main/src/context/actions/"
            Reducers["Reducers\n(src/context/reducers/)"]:::client
            click Reducers "https://github.com/arlaudcyril/test-landing/tree/main/src/context/reducers/"
            InitState["Initial States\n(src/context/initialStates/)"]:::client
            click InitState "https://github.com/arlaudcyril/test-landing/tree/main/src/context/initialStates/"
        end
        Style["Style Layer\nSCSS, Fonts, Images"]:::client
        subgraph "Assets"
            SCSS["SCSS Styles\n(src/assets/styles/)"]:::client
            click SCSS "https://github.com/arlaudcyril/test-landing/tree/main/src/assets/styles/"
            Fonts["Fonts\n(src/assets/fonts/)"]:::client
            click Fonts "https://github.com/arlaudcyril/test-landing/tree/main/src/assets/fonts/"
            Images["Images\n(src/assets/images/)"]:::client
            click Images "https://github.com/arlaudcyril/test-landing/tree/main/src/assets/images/"
        end
        Utils["Utility Layer\nAPI & Validation"]:::client
        subgraph "Utils"
            API["henceforthApi.js\n(src/utils/henceforthApi.js)"]:::client
            click API "https://github.com/arlaudcyril/test-landing/blob/main/src/utils/henceforthApi.js"
            Validation["validation_regex.js\n(src/utils/validation_regex.js)"]:::client
            click Validation "https://github.com/arlaudcyril/test-landing/blob/main/src/utils/validation_regex.js"
        end
        ClaimComp["ClaimToken Component\n(src/components/claimToken/index.js)"]:::client
        click ClaimComp "https://github.com/arlaudcyril/test-landing/blob/main/src/components/claimToken/index.js"
        Blockchain["Blockchain Connector\nWeb3/Ethers + ABIs"]:::client
        subgraph "ABIs"
            CliffABI["CliffAndVesting.json"]:::client
            click CliffABI "https://github.com/arlaudcyril/test-landing/blob/main/src/components/claimToken/contract/CliffAndVesting.json"
            LybABI["Lyb.json"]:::client
            click LybABI "https://github.com/arlaudcyril/test-landing/blob/main/src/components/claimToken/contract/Lyb.json"
        end
    end

    ReactApp["React App"]:::client

    ReactApp --> Router
    ReactApp --> UI
    ReactApp --> Pages
    ReactApp --> State
    ReactApp --> Style
    ReactApp --> Utils
    ReactApp --> ClaimComp
    ClaimComp --> Blockchain

    %% State and UI interaction
    UI <-->|"renders & dispatches"| State
    State -->|"uses utils"| Utils
    Utils -->|">> HTTP request"| RESTAPI
    RESTAPI["REST API Backend"]:::external
    click RESTAPI "https://github.com/arlaudcyril/test-landing/blob/main/src/utils/henceforthApi.js"
    RESTAPI -->|"JSON response"| State
    State --> UI

    %% Claim token flow
    ClaimComp -->|"calls"| BlockchainNetwork
    BlockchainNetwork["EVM Network / Smart Contracts"]:::external
    BlockchainNetwork -->|"tx receipt"| State
    State --> UI

    %% CI/CD Pipeline
    subgraph "CI/CD Pipeline"
        direction TB
        ActionsCI["GitHub Actions\n(.github/workflows/main.yml)"]:::cicd
        click ActionsCI "https://github.com/arlaudcyril/test-landing/blob/main/.github/workflows/main.yml"
        Test["Run Tests"]:::cicd
        Build["Build Assets"]:::cicd
        Deploy["Deploy to Static Host"]:::cicd
    end
    ActionsCI --> Test --> Build --> Deploy
    Deploy --> StaticHost

    %% Connections from ReactBundle to ReactApp
    ReactBundle --> ReactApp

    %% Styles
    classDef client fill:#D0E8FF,stroke:#0366d6,color:#0366d6,stroke-width:1px;
    classDef external fill:#E6FFEB,stroke:#28a745,color:#28a745,stroke-width:1px;
    classDef cicd fill:#F0F0F0,stroke:#666666,color:#333333,stroke-width:1px;
```
