# japser34/celeracing architecture

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

- Interactive diagram: https://gitdiagram.com/japser34/celeracing
- Repository: https://github.com/japser34/celeracing

## Overview

##### Project type and purpose
- This is a Next.js (React + TypeScript) web application using the new “app/” directory.
- It delivers a static or server-rendered marketing site (“Celeracing”) with pages (About, Blog, Contact, Home), shared components, static data, and public assets.

##### File structure
- Top-level files
- next.config.ts, tsconfig.json, postcss.config.mjs, eslint.config.mjs – build, lint and framework configs
- package.json / package-lock.json – dependencies and scripts
- public/ – static assets served directly (images of team, vehicles, etc.)
- src/app/ – Next.js routes and layouts
- page.tsx files for each route
- layout.tsx – global layout wrapper
- hooks/useScrollDirection.tsx – custom client hook
- src/components/ – reusable UI components (Header, Footer, Card variants)
- src/data/ – in-memory JSON-like TypeScript modules (partners, team, vehicles)
- src/styles/ – global and component-scoped CSS

##### Additional insights from README
- The README gives only the project name (“Celeracing”) and no further architectural notes.

a. Main components to include
- Client Browser
- CDN / Static-asset layer (public/)
- Next.js Server (or Vercel/Netlify host)
- Application Core
- Routing layer (src/app)
- Layout & Pages
- Client hook (useScrollDirection)
- Component Library (src/components)
- Data Layer (src/data modules)
- Stylesheet processor (Tailwind/PostCSS or CSS pipelines)
- Build System (Next.js webpack bundler)
b. Relationships & interactions
- Browser → fetches HTML/CSS/JS from CDN or server
- Next.js Server → uses routing and page components to render HTML
- Page components → import Data modules + UI Components + CSS
- Components → reference public assets as needed (e.g., images)
- Styles → PostCSS transforms CSS, loaded into pages
- Hook → runs in browser to detect scroll direction and passes props to components
c. Architectural patterns & design principles
- File‐based routing (Next.js “app/” directory)
- Component–driven UI composition
- Data‐at‐build (no external API calls: data.ts modules)
- Static Site Generation (SSG) or hybrid SSR
d. Key technologies & libraries
- Next.js framework
- React + TypeScript
- PostCSS (and Tailwind if used)
- ESLint for linting
- Public folder for static asset delivery

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External Layers
    Browser["Client Browser"]:::external
    CDN["CDN / Static Asset Layer (public/)"]:::external
    NextServer["Next.js Server (Vercel/Netlify)"]:::external

    %% Build & Tooling
    subgraph "Build & Tooling" 
        direction TB
        NextConfig["next.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        ESLintConfig["eslint.config.mjs"]:::config
        PackageJSON["package.json / package-lock.json"]:::config
        PostCSSConfig["postcss.config.mjs"]:::config
    end

    %% Stylesheet Processor
    Styles["Stylesheet Processor (PostCSS)"]:::css

    %% Routing & Pages
    subgraph "Routing & Pages (src/app)" 
        direction TB
        Layout["layout.tsx"]:::frontend
        HomePage["page.tsx (Home)"]:::frontend
        AboutPage["about/page.tsx"]:::frontend
        BlogPage["blog/page.tsx"]:::frontend
        ContactPage["contact/page.tsx"]:::frontend
        NotFound["not-found.tsx"]:::frontend
        Hook["useScrollDirection.tsx"]:::frontend
    end

    %% Component Library
    subgraph "UI Component Library (src/components)"
        direction TB
        Header["Header.tsx"]:::frontend
        Footer["Footer.tsx"]:::frontend
        PartnerCard["PartnerCard.tsx"]:::frontend
        TeamCard["TeamCard.tsx"]:::frontend
        VehicleCard["VehicleCard.tsx"]:::frontend
    end

    %% Data Layer
    Data["Static Data Layer"]:::data
    subgraph "Data Modules (src/data)" 
        direction TB
        Partners["partners.ts"]:::data
        TeamData["team.ts"]:::data
        Vehicles["vehicles.ts"]:::data
    end

    %% Connections
    Browser -->|"HTTP GET HTML/CSS/JS"| CDN
    Browser -->|"HTTP GET SSR"| NextServer
    NextServer -->|"renders via"| Layout
    Layout --> HomePage
    Layout --> AboutPage
    Layout --> BlogPage
    Layout --> ContactPage
    Layout --> NotFound
    HomePage --> Header
    AboutPage --> Header
    BlogPage --> Header
    ContactPage --> Header
    NotFound --> Header
    HomePage --> Footer
    AboutPage --> Footer
    BlogPage --> Footer
    ContactPage --> Footer
    NotFound --> Footer
    HomePage --> PartnerCard
    AboutPage --> TeamCard
    BlogPage --> VehicleCard
    ContactPage --> PartnerCard
    Hook --> Header
    Hook --> Footer

    HomePage -->|imports data| Partners
    AboutPage -->|imports data| TeamData
    BlogPage -->|imports data| Vehicles

    Header -->|loads CSS| Styles
    Footer -->|loads CSS| Styles
    PartnerCard -->|loads CSS| Styles
    TeamCard -->|loads CSS| Styles
    VehicleCard -->|loads CSS| Styles

    PartnerCard -->|image src| CDN
    TeamCard -->|image src| CDN
    VehicleCard -->|image src| CDN

    NextConfig -->|build config| NextServer
    TSConfig -->|type config| NextServer
    ESLintConfig -->|linting| NextServer
    PackageJSON -->|dependencies| NextServer
    PostCSSConfig -->|css pipeline| Styles

    %% Click Events
    click NextConfig "https://github.com/japser34/celeracing/blob/master/next.config.ts"
    click TSConfig "https://github.com/japser34/celeracing/blob/master/tsconfig.json"
    click ESLintConfig "https://github.com/japser34/celeracing/blob/master/eslint.config.mjs"
    click PackageJSON "https://github.com/japser34/celeracing/blob/master/package.json"
    click PostCSSConfig "https://github.com/japser34/celeracing/blob/master/postcss.config.mjs"
    click Layout "https://github.com/japser34/celeracing/blob/master/src/app/layout.tsx"
    click HomePage "https://github.com/japser34/celeracing/blob/master/src/app/page.tsx"
    click AboutPage "https://github.com/japser34/celeracing/blob/master/src/app/about/page.tsx"
    click BlogPage "https://github.com/japser34/celeracing/blob/master/src/app/blog/page.tsx"
    click ContactPage "https://github.com/japser34/celeracing/blob/master/src/app/contact/page.tsx"
    click NotFound "https://github.com/japser34/celeracing/blob/master/src/app/not-found.tsx"
    click Hook "https://github.com/japser34/celeracing/blob/master/src/app/hooks/useScrollDirection.tsx"
    click Header "https://github.com/japser34/celeracing/blob/master/src/components/Header.tsx"
    click Footer "https://github.com/japser34/celeracing/blob/master/src/components/Footer.tsx"
    click PartnerCard "https://github.com/japser34/celeracing/blob/master/src/components/PartnerCard.tsx"
    click TeamCard "https://github.com/japser34/celeracing/blob/master/src/components/TeamCard.tsx"
    click VehicleCard "https://github.com/japser34/celeracing/blob/master/src/components/VehicleCard.tsx"
    click Partners "https://github.com/japser34/celeracing/blob/master/src/data/partners.ts"
    click TeamData "https://github.com/japser34/celeracing/blob/master/src/data/team.ts"
    click Vehicles "https://github.com/japser34/celeracing/blob/master/src/data/vehicles.ts"
    click Styles "https://github.com/japser34/celeracing/blob/master/src/styles/globals.css"
    click Styles "https://github.com/japser34/celeracing/blob/master/src/styles/components/card.css"
    click Styles "https://github.com/japser34/celeracing/blob/master/src/styles/components/footer.css"
    click Styles "https://github.com/japser34/celeracing/blob/master/src/styles/components/header.css"
    click Styles "https://github.com/japser34/celeracing/blob/master/src/styles/components/section.css"

    %% Styles
    classDef external fill:#dddddd,stroke:#888888,color:#333333
    classDef config fill:#f9d29d,stroke:#e38b00,color:#333333
    classDef frontend fill:#bbdefb,stroke:#1e88e5,color:#0d47a1
    classDef data fill:#c8e6c9,stroke:#43a047,color:#1b5e20
    classDef css fill:#fff9c4,stroke:#fbc02d,color:#f57f17
```
