# 0xn0x/go-artifactsmmo architecture

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

- Interactive diagram: https://gitdiagram.com/0xn0x/go-artifactsmmo
- Repository: https://github.com/0xn0x/go-artifactsmmo

## Overview

##### Project type and purpose
- This is a Go SDK (client library) for the ArtifactsMMO game API.
- Its job is to abstract the HTTP calls, marshal/unmarshal JSON, and expose idiomatic Go methods for game operations (movement, fights, crafting, inventory, etc.).

##### File structure
- Top‐level executable commands in cmd/first-fight and cmd/getting-started – example binaries illustrating SDK usage.
- Public entry points: artifactsmmo.go and client.go define the exported API (e.g. NewClient, client methods).
- internal/api: low‐level HTTP request/response machinery and endpoint definitions.
- internal/client: configuration, HTTP client instantiation, token & character name handling.
- models/: Go structs for API resources (Character, Fight, Item, Bank, GrandExchange, Task, etc.), errors, and responses.
- go.mod/go.sum: dependency management.
- CI/CD: GitHub workflows for build, lint, and coverage.

##### README for additional insights
- Confirms it’s a Go SDK for interacting with a RESTful JSON API.
- Highlights supported features: authentication, movements, fights, gathering, crafting, tasks, inventory, bank, recycling, grand exchange.
- Shows a minimal usage example: NewClient + GetCharacterInfo().

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "User Applications"
        UA1["First-Fight CLI"]:::public
        UA2["Getting-Started CLI"]:::public
    end

    PublicAPI["SDK Public API"]:::public

    subgraph "Internal Modules"
        IC["Client Config & HTTP Wrapper"]:::internal
        IA["API Endpoint & HTTP Machinery"]:::internal
        subgraph "Models"
            M1["character.go"]:::models
            M2["fight.go"]:::models
            M3["item.go"]:::models
            M4["bank.go"]:::models
            M5["grand_exchange.go"]:::models
            M6["task.go"]:::models
            M7["achievement.go"]:::models
            M8["cooldown.go"]:::models
            M9["map.go"]:::models
            M10["responses.go"]:::models
            M11["errors.go"]:::models
        end
    end

    ExternalAPI["External ArtifactsMMO HTTP API"]:::external

    subgraph "CI/CD Workflows"
        CI1["build.yml"]:::ci
        CI2["coverage.yml"]:::ci
        CI3["lint.yml"]:::ci
    end

    UA1 -->|"calls"| PublicAPI
    UA2 -->|"calls"| PublicAPI
    PublicAPI -->|"uses config"| IC
    IC -->|"builds requests"| IA
    IA -->|"HTTP Request\n(JSON)"| ExternalAPI
    ExternalAPI -->|"HTTP Response\n(JSON)"| IA
    IA -->|"unmarshal JSON into models"| Models
    Models -->|"return data"| IC
    IC -->|"return results"| PublicAPI
    PublicAPI -->|"return to app"| UA1
    PublicAPI -->|"return to app"| UA2

    click UA1 "https://github.com/0xn0x/go-artifactsmmo/blob/main/cmd/first-fight/main.go"
    click UA2 "https://github.com/0xn0x/go-artifactsmmo/blob/main/cmd/getting-started/main.go"
    click PublicAPI "https://github.com/0xn0x/go-artifactsmmo/blob/main/artifactsmmo.go"
    click PublicAPI "https://github.com/0xn0x/go-artifactsmmo/blob/main/client.go"
    click IC "https://github.com/0xn0x/go-artifactsmmo/blob/main/internal/client/config.go"
    click IA "https://github.com/0xn0x/go-artifactsmmo/blob/main/internal/api/api.go"
    click M1 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/character.go"
    click M2 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/fight.go"
    click M3 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/item.go"
    click M4 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/bank.go"
    click M5 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/grand_exchange.go"
    click M6 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/task.go"
    click M7 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/achievement.go"
    click M8 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/cooldown.go"
    click M9 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/map.go"
    click M10 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/responses.go"
    click M11 "https://github.com/0xn0x/go-artifactsmmo/blob/main/models/errors.go"
    click CI1 "https://github.com/0xn0x/go-artifactsmmo/blob/main/.github/workflows/build.yml"
    click CI2 "https://github.com/0xn0x/go-artifactsmmo/blob/main/.github/workflows/coverage.yml"
    click CI3 "https://github.com/0xn0x/go-artifactsmmo/blob/main/.github/workflows/lint.yml"

    classDef public fill:#E8F4FD,stroke:#1E90FF,color:#000
    classDef internal fill:#F3E8FD,stroke:#9932CC,color:#000
    classDef models fill:#E8FDE8,stroke:#228B22,color:#000
    classDef external fill:#FDE8E8,stroke:#FF4500,color:#000
    classDef ci fill:#FFF4E8,stroke:#FF8C00,color:#000
```
