# basementstudio/website-2k25 architecture

> Architecture diagram of the GitHub repository basementstudio/website-2k25, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/basementstudio/website-2k25
- Repository: https://github.com/basementstudio/website-2k25

## Overview

##### Project Type and Purpose
- This is a full-stack web application built with Next.js and TypeScript.
- The website doubles as a digital studio’s branding showcase, mixing creative front-end visual elements (including interactive components like arcade games, animations, and asset providers) with a series of content pages (blog, contact, showcase, people, services, etc).

##### Analyzing the File Structure
- The top-level files (next.config.ts, package.json, tsconfig.json, etc.) and configuration directories indicate a modern Next.js/React project setup, complete with linting, formatting, and deployment configuration for edge and server (as seen in sentry.[edge|server].config.ts).
- The “public” directory houses static assets (images, fonts, web assembly files for a transcoder, etc.) used by the website.
- The “src” folder is subdivided into:
- app: Contains page definitions and route handling in a Next.js “app” directory approach. There are different sub-folders for pages like home, blog, people, post, services, and showcase.
- components: A large number of fine-grained React components organized by purpose (e.g., arcade-game, blog, camera, contact, custom-cursor, layout, etc). This shows a highly modularized UI design.
- actions: Server or client actions such as contact forms and laboratory fetching indicate that not only static rendering but also dynamic interactions are supported.
- api: Contains API endpoints (for scores, Sentry examples, etc.) that likely serve as serverless functions.
- services and store: Handle business logic, state management, and external integrations (such as Basehub and Supabase).
- hooks, lib, shaders, and workers: Provide utility functions, custom hooks for React, shader implementations for graphics effects, and background workers for non-blocking operations.
- The directory structure (e.g., pages structured under names like (pages), blog, post, showcase) implies that an MVC-like approach is in place where pages (views), components (UI elements / controllers), actions (business logic), and services (model/data layers) are clearly separated.

##### Key Components
- Frontend / Presentation Layer:
- Next.js Frontend: “src/app” pages rendering the website’s various sections.
- UI Components: “src/components” (layout, arcade game, blog, contact screens, etc.) that are used within these pages.
- Custom Hooks & Assets: “src/hooks” and “src/components/assets-provider” that support dynamic interaction and asset loading.
- API and Backend Functionality:
- API Endpoints: Located in “src/app/api”, these provide data or integrate with logging/monitoring systems (e.g., Sentry).
- Server Actions: Under “src/actions” (like contact-form actions) that process form submissions or data fetching.
- Services & Data Management:
- Integration Services: “src/service/basehub” and “src/service/supabase” abstract external systems or databases.
- State Management: “src/store” aspects handle client-side or server-side state (arcade state, minigame state, etc.).
- Multimedia & Creative Modules:
- Arcade & Interactive Modules: “src/components/arcade-game”, “src/components/basketball”, etc. are distinct creative blocks.
- Shaders and Postprocessing: “src/shaders/*” provide custom graphics and effects.
- Static Assets & Configuration:
- Public Assets: Images, fonts, web assembly modules, and media from the “public” folder.
- Configuration: Files like next.config.ts, tailwind.config.ts, and various ESLint/Prettier settings.

##### Relationships and Interactions
- The pages (frontend routes) call specific components which themselves can interact with services (via hooks or direct API calls) and also trigger actions (contact-form submissions, laboratory-fetch) and update stores.
- API endpoints (in “src/app/api”) serve as backend responses for dynamic data or error logging (Sentry).
- Services in the “service” directory offer abstracted business logic and connect to external data sources or platforms (e.g., Supabase for a database backend).
- Custom hooks and libraries encapsulate shared utilities that are consumed across the UI components.
- Static assets in the “public” folder are referenced directly by pages and components, while configuration files set up and support the development and deployment pipelines.

##### Architectural Patterns and Design Principles
- Modularity: The project is split into many self-contained directories (pages, components, hooks, api, services) which promotes separation of concerns.
- Declarative UI: Next.js and React promote a component-based structure where UI logic is cleanly separated.
- API-driven interactions: With dedicated API endpoints and action directories, the project adheres to a service-oriented approach.
- Performance and Visual Effects: The use of workers and shader modules indicates a focus on advanced front-end processing and multimedia/dynamic effects.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        A["Next.js Pages"]:::frontend
        B["UI Components (Layout, Arcade-game, Blog, Contact, Custom-Cursor, etc.)"]:::frontend
    end

    %% Backend/API Layer
    subgraph "Backend/API Layer"
        C["API Endpoints (Scores, Sentry Examples)"]:::backend
        D["Server/Client Actions (Contact-form, Laboratory-Fetch)"]:::backend
    end

    %% Services & Data Management
    subgraph "Services & Data Management"
        E["Integration Service: Basehub"]:::services
        F["Integration Service: Supabase"]:::services
        G["State Management (Arcade/Minigame State)"]:::services
    end

    %% Utilities & Multimedia
    subgraph "Utilities & Multimedia"
        H["Custom Hooks & Utilities"]:::utilities
        I["Workers (Background Operations)"]:::utilities
        J["Shaders & Multimedia Modules"]:::utilities
    end

    %% Static Assets & Configuration
    subgraph "Static Assets & Configuration"
        K["Static Assets (Images, Fonts, WASM Modules)"]:::static
    end

    %% Relationships between Components
    A -->|"renders"| B
    B -->|"uses"| H
    B -->|"triggers"| D
    D -->|"calls"| C
    B -->|"fetches"| C
    E -->|"updates"| G
    F -->|"updates"| G
    H -->|"utilizes"| I
    B -->|"integrates"| J
    A -->|"may invoke"| D

    %% Click Events
    click A "https://github.com/basementstudio/website-2k25/tree/main/src/app/(pages)"
    click B "https://github.com/basementstudio/website-2k25/tree/main/src/components"
    click C "https://github.com/basementstudio/website-2k25/tree/main/src/app/api"
    click D "https://github.com/basementstudio/website-2k25/tree/main/src/actions"
    click E "https://github.com/basementstudio/website-2k25/tree/main/src/service/basehub"
    click F "https://github.com/basementstudio/website-2k25/tree/main/src/service/supabase"
    click G "https://github.com/basementstudio/website-2k25/tree/main/src/store"
    click H "https://github.com/basementstudio/website-2k25/tree/main/src/hooks"
    click I "https://github.com/basementstudio/website-2k25/tree/main/src/workers"
    click J "https://github.com/basementstudio/website-2k25/tree/main/src/shaders"
    click K "https://github.com/basementstudio/website-2k25/tree/main/public"

    %% Styles
    classDef frontend fill:#F7ECDE,stroke:#000,stroke-width:2px;
    classDef backend fill:#E3F8F0,stroke:#000,stroke-width:2px;
    classDef services fill:#F6D186,stroke:#000,stroke-width:2px;
    classDef utilities fill:#D2E9FF,stroke:#000,stroke-width:2px;
    classDef static fill:#FDEBD0,stroke:#000,stroke-width:2px;
```
