# sakamochanq/nxtheme-lib architecture

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

- Interactive diagram: https://gitdiagram.com/sakamochanq/nxtheme-lib
- Repository: https://github.com/sakamochanq/nxtheme-lib

## Overview

##### Project Type and Purpose
- This is an **open-source asset library** (nxtheme-lib) containing custom Nintendo Switch themes (.nxtheme files).
- There is no application code or “service” logic—this repo simply hosts static theme packages and usage instructions.

##### File Structure Analysis
- Top-level files: LICENSE, README.md
- lib/
- NX_Makima/themes/*.nxtheme
- NX_Phosphophyllite/themes/*.nxtheme
- NX_UguisuAnko/themes/*.nxtheme
- Each theme folder holds five .nxtheme assets for Lock, Menu, News, Select, and Settings screens.
- No build scripts or backend folders—assets only.

##### README Insights
- Describes manual install (copy to sdmc:/themes/) and remote install via Switch Theme Injector (PC tool).
- References Atmosphere-NX CFW on the Switch.
- External dependencies: Atmosphere-NX, SwitchThemeInjector.exe.

a. Main Components
- **GitHub Repository** (nxtheme-lib)
- **Local Development Machine** (User PC)
- **Switch Theme Injector** (PC application)
- **Nintendo Switch Console**
- **SD Card Storage** (sdmc:/themes/)
- **Atmosphere-NX CFW** (runs on console)
- **Theme Asset Packages** (.nxtheme files grouped by NX_Makima, NX_Phosphophyllite, NX_UguisuAnko)

b. Relationships & Interactions
- User downloads or clones the repo from GitHub → local PC stores theme folders.
- **Manual Install Path**: PC → USB or file manager → SD Card → Switch (themes become available in CFW).
- **Remote Install Path**: Switch Theme Injector (PC) ←→ Console over LAN (TCP/IP) → writes .nxtheme to sdmc:/themes/.
- Atmosphere-NX reads these .nxtheme files on boot or when switching themes.

c. Architectural Patterns / Design Principles
- **Content Distribution Pipeline**: Source repo → local assets → installation tool/CFW.
- **Separation of Concerns**:
- Asset storage (GitHub)
- Delivery mechanism (manual copy vs. remote injector)
- Runtime environment (Atmosphere-NX on Switch)

d. Key Technologies & Formats
- Git & GitHub for versioning/distribution
- .nxtheme file format (theme package)
- Switch Theme Injector (v4.7.1)
- Atmosphere-NX Custom Firmware

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Components
    GH["GitHub Repository\n(nxtheme-lib)"]:::repo
    LICENSE["LICENSE"]:::repo
    README["README.md"]:::repo
    LIB["Asset Storage Directory\n(lib/)"]:::repo

    subgraph "NX_Makima Theme Package" 
        direction TB
        NM_DIR["/lib/NX_Makima/themes"]:::asset
        NM_LOCK["Lock.nxtheme"]:::asset
        NM_MENU["Menu.nxtheme"]:::asset
        NM_NEWS["News.nxtheme"]:::asset
        NM_SELECT["Select.nxtheme"]:::asset
        NM_SETTINGS["Settings.nxtheme"]:::asset
        NM_USER["User.nxtheme"]:::asset
        NM_DIR --> NM_LOCK
        NM_DIR --> NM_MENU
        NM_DIR --> NM_NEWS
        NM_DIR --> NM_SELECT
        NM_DIR --> NM_SETTINGS
        NM_DIR --> NM_USER
    end

    subgraph "NX_Phosphophyllite Theme Package"
        direction TB
        NP_DIR["/lib/NX_Phosphophyllite/themes"]:::asset
        NP_LOCK["Lock.nxtheme"]:::asset
        NP_MENU["Menu.nxtheme"]:::asset
        NP_NEWS["News.nxtheme"]:::asset
        NP_SELECT["Select.nxtheme"]:::asset
        NP_SETTINGS["Settings.nxtheme"]:::asset
        NP_USER["User.nxtheme"]:::asset
        NP_DIR --> NP_LOCK
        NP_DIR --> NP_MENU
        NP_DIR --> NP_NEWS
        NP_DIR --> NP_SELECT
        NP_DIR --> NP_SETTINGS
        NP_DIR --> NP_USER
    end

    subgraph "NX_UguisuAnko Theme Package"
        direction TB
        NU_DIR["/lib/NX_UguisuAnko/themes"]:::asset
        NU_LOCK["Lock.nxtheme"]:::asset
        NU_MENU["Menu.nxtheme"]:::asset
        NU_NEWS["News.nxtheme"]:::asset
        NU_SELECT["Select.nxtheme"]:::asset
        NU_SETTINGS["Settings.nxtheme"]:::asset
        NU_USER["User.nxtheme"]:::asset
        NU_DIR --> NU_LOCK
        NU_DIR --> NU_MENU
        NU_DIR --> NU_NEWS
        NU_DIR --> NU_SELECT
        NU_DIR --> NU_SETTINGS
        NU_DIR --> NU_USER
    end

    PC["Local Development Machine\n(User PC)"]:::tool
    STX["Switch Theme Injector\n(v4.7.1)"]:::tool
    SD["SD Card Storage\n(sdmc:/themes/)"]:::storage
    CFW["Atmosphere-NX CFW"]:::runtime
    SWITCH["Nintendo Switch Console"]:::runtime

    %% Relationships
    GH -->|"clone/download"| PC
    GH --> LICENSE
    GH --> README
    GH --> LIB
    LIB --> NM_DIR
    LIB --> NP_DIR
    LIB --> NU_DIR

    PC -->|"manual copy"| SD
    SD -->|"inserts into"| SWITCH
    SWITCH -->|"reads on boot"| CFW

    PC --> STX
    STX -->|"LAN (TCP/IP)"| SWITCH
    SWITCH -->|"writes themes to"| SD

    %% Click Events
    click GH "https://github.com/sakamochanq/nxtheme-lib/tree/master//"
    click LICENSE "https://github.com/sakamochanq/nxtheme-lib/tree/master//LICENSE"
    click README "https://github.com/sakamochanq/nxtheme-lib/blob/master//README.md"
    click LIB "https://github.com/sakamochanq/nxtheme-lib/tree/master//lib"
    click NM_DIR "https://github.com/sakamochanq/nxtheme-lib/tree/master//lib/NX_Makima/themes"
    click NM_LOCK "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Makima/themes/Lock.nxtheme"
    click NM_MENU "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Makima/themes/Menu.nxtheme"
    click NM_NEWS "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Makima/themes/News.nxtheme"
    click NM_SELECT "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Makima/themes/Select.nxtheme"
    click NM_SETTINGS "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Makima/themes/Settings.nxtheme"
    click NM_USER "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Makima/themes/User.nxtheme"
    click NP_DIR "https://github.com/sakamochanq/nxtheme-lib/tree/master//lib/NX_Phosphophyllite/themes"
    click NP_LOCK "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Phosphophyllite/themes/Lock.nxtheme"
    click NP_MENU "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Phosphophyllite/themes/Menu.nxtheme"
    click NP_NEWS "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Phosphophyllite/themes/News.nxtheme"
    click NP_SELECT "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Phosphophyllite/themes/Select.nxtheme"
    click NP_SETTINGS "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Phosphophyllite/themes/Settings.nxtheme"
    click NP_USER "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_Phosphophyllite/themes/User.nxtheme"
    click NU_DIR "https://github.com/sakamochanq/nxtheme-lib/tree/master//lib/NX_UguisuAnko/themes"
    click NU_LOCK "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_UguisuAnko/themes/Lock.nxtheme"
    click NU_MENU "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_UguisuAnko/themes/Menu.nxtheme"
    click NU_NEWS "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_UguisuAnko/themes/News.nxtheme"
    click NU_SELECT "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_UguisuAnko/themes/Select.nxtheme"
    click NU_SETTINGS "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_UguisuAnko/themes/Settings.nxtheme"
    click NU_USER "https://github.com/sakamochanq/nxtheme-lib/blob/master//lib/NX_UguisuAnko/themes/User.nxtheme"

    %% Styles
    classDef repo fill:#D0E6FF,stroke:#1E90FF,color:#000
    classDef asset fill:#E0FFE0,stroke:#32CD32,color:#000
    classDef tool fill:#E8FFE0,stroke:#228B22,color:#000
    classDef storage fill:#FFF4E0,stroke:#FFA500,color:#000
    classDef runtime fill:#FFE0E0,stroke:#FF4500,color:#000
```
