Skip to content

Database

LeNDuyA edited this page Oct 23, 2025 · 11 revisions
---
title: MoveListDB Architecture
---
graph TB
    subgraph wikiWavu["wikiWavu feature module"]
        Interface["MoveListDB Interface"]
        UseCase["CacheMoveListUseCase"]
        UseCase -->|depends on| Interface
    end

    subgraph botModule["Discord bot"]
        InMemory["InMemoryMoveListDB"]
        BotDI["Koin DI module<br/>bind InMemoryDB β†’ Interface"]
        InMemory -.->|implements| Interface
        BotDI -->|provides| InMemory
    end

    subgraph composeApp["composeApp"]
        Room["RoomMoveListDB"]
        AppDI["Koin DI module<br/>bind RoomDB β†’ Interface"]
        Room -.->|implements| Interface
        AppDI -->|provides| Room
    end

    style wikiWavu fill:#fff4e1,stroke:#333,stroke-width:2px,color:#000
    style botModule fill:#e1f5ff,stroke:#333,stroke-width:2px,color:#000
    style composeApp fill:#ffe1f0,stroke:#333,stroke-width:2px,stroke-dasharray: 5 5,color:#000

    style Interface fill:#fff,color:#000
    style UseCase fill:#fff,color:#000
    style InMemory fill:#fff,color:#000
    style BotDI fill:#fff,color:#000
    style Room fill:#fff,color:#000
    style AppDI fill:#fff,color:#000
Loading

There are differences between the end clients:

  • Discord bot - uses in-memory database (something like Map<String,Move>) 1
  • mobile apps - use SQL database (Room)

Because of that split, each end client provides its own MoveListDB implementation.

I highly encourage you to use this approach when creating a Wiki-based feature module.


1 A simple in-memory implementation: LINK

Clone this wiki locally