# yanamirei/lovesol architecture

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

- Interactive diagram: https://gitdiagram.com/yanamirei/lovesol
- Repository: https://github.com/yanamirei/lovesol

## Overview

1. **Project type and runtime**
   - This is a **LÖVE 2D** project written in **Lua**.
   - It is a **WIP Solitaire collection**, so the whole app is a desktop game, not a web or service architecture.

2. **Top-level execution boundary**
   - `main.lua` is the primary application entry point and likely contains the game loop, state management, rendering, and input handling.
   - `conf.lua` is the LÖVE configuration boundary, controlling app/window settings before the game starts.

3. **Core code organization**
   - There are no separate source directories, so the codebase appears to be **single-module / small-project shaped**.
   - That usually means most gameplay logic is centralized rather than split into many packages or services.

4. **Asset subsystem**
   - `Sprites/` holds all visual card-game art.
   - The folder structure is domain-specific: `Clubs`, `Diamonds`, `Hearts`, `Spades`, `Joker`, plus UI-related `Backs`, `Button`, and `DialogBox`.
   - This suggests the game draws standard playing cards, card backs, and interface overlays from local files.

5. **UI and interaction assets**
   - `Sprites/Button` and `Sprites/DialogBox` indicate the project includes interactive menus or dialogs in addition to the card table.
   - These assets likely support variant selection, game prompts, restart/undo actions, or status messages.

6. **Card rendering model**
   - The suit-based asset folders imply the app renders cards by composing or selecting images based on rank/suit rather than generating them procedurally.
   - `Sprites/Backs` is a separate boundary for face-down cards, which is important for the solitaire deal/play state.

7. **Typography and presentation**
   - `Fonts/` is a dedicated asset folder, so text rendering is part of the UI layer and not just debug output.
   - This likely supports score, instructions, menu labels, or game messages.

8. **Game flow**
   - LÖVE loads `conf.lua`, then `main.lua`, which initializes assets from `Fonts/` and `Sprites/`.
   - From there, the app runs the standard update/draw/input cycle, with game state changes driving what card and UI sprites are shown.

9. **Data and persistence**
   - No database, backend, or save subsystem is visible in the tree.
   - The architecture is therefore **fully local and asset-driven**, with transient in-memory game state unless `main.lua` implements saves internally.

10. **External dependencies**
   - The only meaningful runtime dependency implied by the repo layout is the **LÖVE engine** itself.
   - There are no signs of network APIs, packaging services, or third-party frameworks affecting the architecture.

11. **Diagram boundaries to show**
   - A useful architecture diagram would have:
     - **LÖVE runtime** as the host
     - **main.lua** as the game/application logic boundary
     - **conf.lua** as startup configuration
     - **Fonts/** and **Sprites/** as static asset inputs
     - **Rendered game UI / solitaire states** as the output layer

12. **Overall shape**
   - Architecturally, this is a **small, single-process, asset-heavy game project**.
   - The main distinction is between **engine/config**, **Lua gameplay logic**, and **static visual resources**.

Main entry points: [`Sprites`](https://github.com/yanamirei/lovesol/tree/main/Sprites) (Sprites), [`main.lua`](https://github.com/yanamirei/lovesol/blob/main/main.lua) (main.lua), [`conf.lua`](https://github.com/yanamirei/lovesol/blob/main/conf.lua) (conf.lua), [`Fonts`](https://github.com/yanamirei/lovesol/tree/main/Fonts) (Fonts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_love{{"LÖVE<br/>engine host"}}
end

subgraph group_code["Lua Code"]
  node_conf["conf.lua<br/>startup config<br/>[conf.lua]"]
  node_main["main.lua<br/>game loop<br/>[main.lua]"]
  node_state(("Game State<br/>solitaire state"))
  node_ui["Card UI<br/>render layer"]
end

subgraph group_assets["Assets"]
  node_fonts[("Fonts<br/>type assets")]
end

subgraph group_sprites["Sprites"]
  node_sprites[("Sprites<br/>art assets")]
  node_backs["Backs"]
  node_buttons["Button<br/>ui art"]
  node_dialogs["DialogBox<br/>ui art"]
  node_clubs["Clubs<br/>suit art"]
  node_diamonds["Diamonds<br/>suit art"]
  node_hearts["Hearts<br/>suit art"]
  node_spades["Spades<br/>suit art"]
  node_joker["Joker<br/>card art"]
end

node_love -->|"loads"| node_conf
node_love -->|"runs"| node_main
node_conf -.->|"configures"| node_main
node_main -->|"manages"| node_state
node_main -->|"draws"| node_ui
node_main -->|"uses"| node_fonts
node_main -->|"loads"| node_sprites
node_sprites -->|"contains"| node_backs
node_sprites -->|"contains"| node_buttons
node_sprites -->|"contains"| node_dialogs
node_sprites -->|"contains"| node_clubs
node_sprites -->|"contains"| node_diamonds
node_sprites -->|"contains"| node_hearts
node_sprites -->|"contains"| node_spades
node_sprites -->|"contains"| node_joker
node_state -->|"drives"| node_ui

click node_conf "https://github.com/yanamirei/lovesol/blob/main/conf.lua"
click node_main "https://github.com/yanamirei/lovesol/blob/main/main.lua"
click node_fonts "https://github.com/yanamirei/lovesol/tree/main/Fonts"
click node_sprites "https://github.com/yanamirei/lovesol/tree/main/Sprites"
click node_backs "https://github.com/yanamirei/lovesol/tree/main/Sprites/Backs"
click node_buttons "https://github.com/yanamirei/lovesol/tree/main/Sprites/Button"
click node_dialogs "https://github.com/yanamirei/lovesol/tree/main/Sprites/DialogBox"
click node_clubs "https://github.com/yanamirei/lovesol/tree/main/Sprites/Clubs"
click node_diamonds "https://github.com/yanamirei/lovesol/tree/main/Sprites/Diamonds"
click node_hearts "https://github.com/yanamirei/lovesol/tree/main/Sprites/Hearts"
click node_spades "https://github.com/yanamirei/lovesol/tree/main/Sprites/Spades"
click node_joker "https://github.com/yanamirei/lovesol/tree/main/Sprites/Joker"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_love toneBlue
class node_conf,node_main,node_state,node_ui toneAmber
class node_fonts toneMint
class node_sprites,node_backs,node_buttons,node_dialogs,node_clubs,node_diamonds,node_hearts,node_spades,node_joker toneRose
```

## Components

### Runtime

LÖVE host and startup boundary

- **LÖVE**: engine host · Desktop game runtime that loads and runs the project

### Lua Code

Primary application logic

- [conf.lua](https://github.com/yanamirei/lovesol/blob/main/conf.lua): startup config · Engine configuration boundary for window and app settings · `conf.lua`
- [main.lua](https://github.com/yanamirei/lovesol/blob/main/main.lua): game loop · Primary gameplay entry point with update, draw, and input handling · `main.lua`
- **Game State**: solitaire state · In-memory game flow and current board state driven by the main loop
- **Card UI**: render layer · Rendered table, controls, and dialogs shown to the player

### Assets

Static visual and text resources

- [Fonts](https://github.com/yanamirei/lovesol/tree/main/Fonts): type assets · Font resources used for labels, scores, and messages · `Fonts`

### Sprites

Card and UI imagery

- [Sprites](https://github.com/yanamirei/lovesol/tree/main/Sprites): art assets · Root container for all card and interface imagery · `Sprites`
- [Backs](https://github.com/yanamirei/lovesol/tree/main/Sprites/Backs): card backs · Face-down card artwork · `Sprites/Backs`
- [Button](https://github.com/yanamirei/lovesol/tree/main/Sprites/Button): ui art · Button artwork for menus and in-game actions · `Sprites/Button`
- [DialogBox](https://github.com/yanamirei/lovesol/tree/main/Sprites/DialogBox): ui art · Dialog and message box artwork · `Sprites/DialogBox`
- [Clubs](https://github.com/yanamirei/lovesol/tree/main/Sprites/Clubs): suit art · Club card face artwork · `Sprites/Clubs`
- [Diamonds](https://github.com/yanamirei/lovesol/tree/main/Sprites/Diamonds): suit art · Diamond card face artwork · `Sprites/Diamonds`
- [Hearts](https://github.com/yanamirei/lovesol/tree/main/Sprites/Hearts): suit art · Heart card face artwork · `Sprites/Hearts`
- [Spades](https://github.com/yanamirei/lovesol/tree/main/Sprites/Spades): suit art · Spade card face artwork · `Sprites/Spades`
- [Joker](https://github.com/yanamirei/lovesol/tree/main/Sprites/Joker): card art · Joker artwork used by the collection · `Sprites/Joker`

## Connections

- LÖVE → conf.lua: loads · Engine reads startup configuration before the game runs
- LÖVE → main.lua: runs · Engine executes the main gameplay entry point
- conf.lua → main.lua: configures · Configuration sets the runtime conditions under which the game starts
- main.lua → Game State: manages · Main loop owns the current solitaire state and transitions
- main.lua → Card UI: draws · Gameplay code renders the table and interaction layers
- main.lua → Fonts: uses · Text rendering pulls from the font asset set
- main.lua → Sprites: loads · Main logic loads and selects sprite resources
- Sprites → Backs: contains · Card back artwork lives under the sprite asset root
- Sprites → Button: contains · Button artwork lives under the sprite asset root
- Sprites → DialogBox: contains · Dialog box artwork lives under the sprite asset root
- Sprites → Clubs: contains · Club card faces are organized as a suit-specific asset set
- Sprites → Diamonds: contains · Diamond card faces are organized as a suit-specific asset set
- Sprites → Hearts: contains · Heart card faces are organized as a suit-specific asset set
- Sprites → Spades: contains · Spade card faces are organized as a suit-specific asset set
- Sprites → Joker: contains · Joker artwork is stored alongside the suit assets
- Game State → Card UI: drives · Board and rule state determine what is shown to the player
