# luma-team/basketball-club-example architecture

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

- Interactive diagram: https://gitdiagram.com/luma-team/basketball-club-example
- Repository: https://github.com/luma-team/basketball-club-example

## Overview

##### Project type and purpose
- This is a full-stack example website built with Next.js (React + server-side capabilities) that integrates with an external service: the Luma API.
- Purpose: Demonstrate how to fetch and display event data (a basketball club schedule) from the Luma Calendar API and render it in a styled Next.js app.

##### File structure
Top-level:
- app/                – Next.js “App Router” directory containing pages, layouts, and global CSS
– calendar/page.tsx – “/calendar” route: fetches & displays events
– page.tsx          – homepage route
– layout.tsx, globals.css
- components/         – Reusable React components (EventList.tsx, HomePage.tsx)
- lib/                – Utility functions (e.g., data-fetching wrappers)
- .env.local.template – Template for API key
- next.config.mjs     – Next.js configuration
- tailwind.config.js
- bun.lock, package.json, tsconfig.json, ESLint & PostCSS configs

##### README for additional insights
- Uses Next.js and the Luma API.
- Runs via Bun (bun dev).
- Expects an environment variable (LUMA_API_KEY) in .env.local.

##### Elements
- Clear labels: Browser, Next.js Router, React Components, Data-fetch layer, Luma API
– Request flow (User → Browser → Next.js)
– Data flow (Next.js → Luma API → Next.js → Browser)
– Frontend (blue rectangles)
– Server/Rendering (green rectangles)
– External Service (orange cloud)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        User("User")
        Browser["Browser UI"]:::frontend
    end

    User -->|"Interacts"| Browser

    %% Server Layer
    subgraph "Next.js Server" 
        direction TB
        Router["Next.js Router"]:::server
        subgraph "Routing & Rendering"
            direction TB
            PageHome["Home Page (/)"]:::server
            PageCalendar["Calendar Page (/calendar)"]:::server
            Layout["App Layout"]:::server
        end
        subgraph "Styling & Assets"
            direction TB
            GlobalsCSS["Global Styles"]:::server
        end
        subgraph "Components"
            direction TB
            HomePage["HomePage Component"]:::server
            EventList["EventList Component"]:::server
        end
        DataFetch["Data-Fetch Utility"]:::server
        Env["Env Template (.env.local)"]:::config
    end

    Browser -->|"Request page"| Router
    Router -->|routes to| PageHome
    Router -->|routes to| PageCalendar
    PageHome -->|wraps with| Layout
    PageCalendar -->|wraps with| Layout
    PageHome -->|renders| HomePage
    PageCalendar -->|renders| EventList
    HomePage -->|uses styles| GlobalsCSS
    EventList -->|calls| DataFetch
    DataFetch -->|reads key from| Env
    DataFetch -->|"fetch events"| LumaAPI
    LumaAPI -->|"returns JSON"| DataFetch
    DataFetch -->|"provides data"| EventList
    PageHome -->|"send HTML/CSS/JS"| Browser
    PageCalendar -->|"send HTML/CSS/JS"| Browser

    %% Config & Build Layer
    subgraph "Config & Build Layer"
        direction TB
        Tailwind["tailwind.config.js"]:::config
        PostCSS["postcss.config.js"]:::config
        NextConfig["next.config.mjs"]:::config
        PackageJSON["package.json"]:::config
        BunLock["bun.lock"]:::config
        TSConfig["tsconfig.json"]:::config
        ESLint[".eslintrc.json"]:::config
        GitIgnore[".gitignore"]:::config
    end

    Router -->|reads config| NextConfig
    GlobalsCSS -->|built by| Tailwind
    GlobalsCSS -->|built by| PostCSS
    PackageJSON -->|defines scripts| Router
    BunLock -->|lockfile| PackageJSON
    TSConfig -->|type checking| Router
    ESLint -->|linting| Router

    %% External Services
    subgraph "External Services"
        direction TB
        LumaAPI["Luma Calendar API"]:::external
    end

    %% Click Events
    click PageHome "https://github.com/luma-team/basketball-club-example/blob/master/app/page.tsx"
    click PageCalendar "https://github.com/luma-team/basketball-club-example/blob/master/app/calendar/page.tsx"
    click Layout "https://github.com/luma-team/basketball-club-example/blob/master/app/layout.tsx"
    click GlobalsCSS "https://github.com/luma-team/basketball-club-example/blob/master/app/globals.css"
    click HomePage "https://github.com/luma-team/basketball-club-example/blob/master/components/HomePage.tsx"
    click EventList "https://github.com/luma-team/basketball-club-example/blob/master/components/EventList.tsx"
    click DataFetch "https://github.com/luma-team/basketball-club-example/blob/master/lib/utils.ts"
    click Env "https://github.com/luma-team/basketball-club-example/blob/master/.env.local.template"
    click Tailwind "https://github.com/luma-team/basketball-club-example/blob/master/tailwind.config.js"
    click PostCSS "https://github.com/luma-team/basketball-club-example/blob/master/postcss.config.js"
    click NextConfig "https://github.com/luma-team/basketball-club-example/blob/master/next.config.mjs"
    click PackageJSON "https://github.com/luma-team/basketball-club-example/blob/master/package.json"
    click BunLock "https://github.com/luma-team/basketball-club-example/blob/master/bun.lock"
    click TSConfig "https://github.com/luma-team/basketball-club-example/blob/master/tsconfig.json"
    click ESLint "https://github.com/luma-team/basketball-club-example/blob/master/.eslintrc.json"
    click GitIgnore "https://github.com/luma-team/basketball-club-example/blob/master/.gitignore"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085;
    classDef server fill:#d4edda,stroke:#155724;
    classDef external fill:#fff3cd,stroke:#856404;
    classDef config fill:#e2e3e5,stroke:#6c757d;
```
