# nidelson/nba architecture

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

- Interactive diagram: https://gitdiagram.com/nidelson/nba
- Repository: https://github.com/nidelson/nba

## Overview

##### Main Components

A. Monorepo Structure (Top Level)
- Turborepo workspace as the containing environment
- Three main sections: apps/, packages/, and configuration files

B. Applications Layer
- Web Application (Next.js)
- Native Application (React Native/Expo)
- Their independent configurations and build processes

C. Shared Package Layer
- UI Component Library
- TypeScript Configurations
- How these are consumed by both applications

**┌─────────────────────── Turborepo Workspace ────────────────────────┐**

- ┌─── Apps ────────────────────────┐ ┌──── Packages ─────────────┐│

- ┌─────────┐     ┌─────────┐   │ │  ┌────────┐  ┌────────┐  ││
- Web    │     │ Native  │   │ │  │   UI   │  │TSConfig│  ││
- (Next.js)│     │ (Expo)  │   │ │  │Package │  │Package │  ││
- ┬────┘     └────┬────┘   │ │  └───┬────┘  └────────┘  ││
- ┘ └──────│────────────────────┘│

- ┼──────────────────┘                      │

- ┼─────────────────────────────────────────┘

- ┌──────┴───────┐
- End Users   │
- ┘

##### Key Relationships to Highlight

A. Dependencies Flow
- How both apps consume the shared UI package
- How TSConfig is used across all TypeScript files
- Demonstrate the build process flow using Turborepo

B. Cross-Platform Sharing
- How the UI components are shared between web and native
- Platform-specific implementations where necessary

##### Technical Stack Indicators

Technology badges or labels for:
- Next.js (Web)
- Expo/React Native (Native)
- TypeScript
- Turborepo
- React Native Web

##### Additional Details

A. Configuration Layer
- Role of turbo.json in orchestrating the monorepo
- Presence of shared TypeScript configurations

B. Build Process
- How Turborepo handles the build pipeline
- Relationship between package.json scripts

##### Important Notes

- Keep the shared UI package central in the design as it's a critical shared resource
- Separation between web and native platforms while highlighting their shared aspects
- Notes about the TypeScript integration throughout the system
- Role of Expo in the native application build process

Remember to include version control and CI/CD considerations in a separate section if relevant to the project's deployment strategy.

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph Workspace[Turborepo Workspace]
        subgraph Apps[Applications Layer]
            Web["Web Application\n(Next.js)"]:::web
            Native["Native Application\n(Expo)"]:::native
            
            subgraph WebConfig[Web Configuration]
                NextConfig["Next.js Config"]:::config
                WebTS["Web TSConfig"]:::config
            end
            
            subgraph NativeConfig[Native Configuration]
                ExpoConfig["Expo Config"]:::config
                NativeTS["Native TSConfig"]:::config
            end
            
            Web --> WebConfig
            Native --> NativeConfig
        end
        
        subgraph Packages[Shared Packages]
            UI["UI Component Library"]:::ui
            TSConfig["TypeScript Configurations"]:::config
            
            subgraph UIComponents[UI Components]
                Button["Button Component"]:::component
                Other["Other Components"]:::component
            end
            
            UI --> UIComponents
        end
        
        subgraph Config[Root Configuration]
            Turbo["Turbo Config"]:::config
            RootPkg["Root Package.json"]:::config
        end
        
        Web --> UI
        Native --> UI
        Web --> TSConfig
        Native --> TSConfig
        UI --> TSConfig
    end
    
    Users((End Users)) --> Web
    Users --> Native
    
    %% Styling
    classDef web fill:#3498db,stroke:#2980b9,color:white
    classDef native fill:#e74c3c,stroke:#c0392b,color:white
    classDef ui fill:#2ecc71,stroke:#27ae60,color:white
    classDef config fill:#f1c40f,stroke:#f39c12,color:black
    classDef component fill:#95a5a6,stroke:#7f8c8d,color:white
    
    %% Click Events
    click Web "https://github.com/nidelson/nba/tree/main/apps/web"
    click Native "https://github.com/nidelson/nba/tree/main/apps/native"
    click UI "https://github.com/nidelson/nba/tree/main/packages/ui"
    click TSConfig "https://github.com/nidelson/nba/tree/main/packages/tsconfig"
    click NextConfig "https://github.com/nidelson/nba/blob/main/apps/web/next.config.js"
    click WebTS "https://github.com/nidelson/nba/blob/main/apps/web/tsconfig.json"
    click ExpoConfig "https://github.com/nidelson/nba/blob/main/apps/native/app.json"
    click NativeTS "https://github.com/nidelson/nba/blob/main/apps/native/tsconfig.json"
    click Button "https://github.com/nidelson/nba/blob/main/packages/ui/src/button.tsx"
    click Turbo "https://github.com/nidelson/nba/blob/main/turbo.json"
    click RootPkg "https://github.com/nidelson/nba/blob/main/package.json"

    %% Legend
    subgraph Legend
        WebL["Web Application"]:::web
        NativeL["Native Application"]:::native
        UIL["UI Library"]:::ui
        ConfigL["Configuration"]:::config
        CompL["Components"]:::component
    end
```
