# theliamladia/mfmmoserver architecture

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

- Interactive diagram: https://gitdiagram.com/theliamladia/mfmmoserver
- Repository: https://github.com/theliamladia/mfmmoserver

## Overview

This repository is a multiplayer game server: clients make authenticated requests to an Express API, which loads and updates player state, applies game rules, and persists shared and per-player data in SQLite. The visible capabilities include character management, game actions, markets, grading and registries, housing, and altcoins. The README is empty; domain coverage is based on the sampled route excerpts, and the large server and game-logic files were only partially excerpted.

Main entry points: [`server.js`](https://github.com/theliamladia/mfmmoserver/blob/main/server.js) (Express API), [`auth.js`](https://github.com/theliamladia/mfmmoserver/blob/main/auth.js) (Authentication), [`db.js`](https://github.com/theliamladia/mfmmoserver/blob/main/db.js) (SQLite persistence), [`gameLogic.js`](https://github.com/theliamladia/mfmmoserver/blob/main/gameLogic.js) (Game rules)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and identity"]
  node_api["Express API<br/>[server.js]"]
  node_identity["Authentication<br/>[auth.js]"]
end

subgraph group_game["Game systems"]
  node_character["Character actions<br/>[server.js]"]
  node_gameplay["Game rules<br/>[gameLogic.js]"]
  node_social["Player presence<br/>[server.js]"]
  node_housing["Crib system<br/>[server.js]"]
  node_economy["Economy actions<br/>[server.js]"]
end

subgraph group_markets["Markets and collections"]
  node_markets["Shared markets<br/>[server.js]"]
  node_grading["Grading registry<br/>[server.js]"]
  node_altcoins["Altcoins<br/>[server.js]"]
end

subgraph group_storage["Persistence"]
  node_sqlite[("SQLite persistence<br/>[db.js]")]
end

node_player(("Game client"))

node_player -->|"requests"| node_api
node_api -->|"authenticates"| node_identity
node_identity -->|"updates presence"| node_sqlite
node_api -->|"applies rules"| node_gameplay
node_api -->|"reads and writes"| node_sqlite
node_api -->|"routes character"| node_character
node_api -->|"routes presence"| node_social
node_api -->|"routes housing"| node_housing
node_api -->|"routes actions"| node_economy
node_api -->|"routes trading"| node_markets
node_api -->|"routes grading"| node_grading
node_api -->|"routes altcoins"| node_altcoins

click node_api "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_identity "https://github.com/theliamladia/mfmmoserver/blob/main/auth.js"
click node_character "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_gameplay "https://github.com/theliamladia/mfmmoserver/blob/main/gameLogic.js"
click node_social "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_housing "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_economy "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_markets "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_grading "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_altcoins "https://github.com/theliamladia/mfmmoserver/blob/main/server.js"
click node_sqlite "https://github.com/theliamladia/mfmmoserver/blob/main/db.js"

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_api,node_identity,node_player toneBlue
class node_character,node_gameplay,node_social,node_housing,node_economy toneAmber
class node_markets,node_grading,node_altcoins toneMint
class node_sqlite toneRose
```

## Components

### API and identity

- [Express API](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`
- [Authentication](https://github.com/theliamladia/mfmmoserver/blob/main/auth.js): `auth.js`

### Game systems

- [Character actions](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`
- [Game rules](https://github.com/theliamladia/mfmmoserver/blob/main/gameLogic.js): `gameLogic.js`
- [Player presence](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`
- [Crib system](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`
- [Economy actions](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`

### Markets and collections

- [Shared markets](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`
- [Grading registry](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`
- [Altcoins](https://github.com/theliamladia/mfmmoserver/blob/main/server.js): `server.js`

### Persistence

- [SQLite persistence](https://github.com/theliamladia/mfmmoserver/blob/main/db.js): `db.js`

### Other components

- **Game client**

## Connections

- Game client → Express API: requests (evidence: `server.js`)
- Express API → Authentication: authenticates (evidence: `server.js`)
- Authentication → SQLite persistence: updates presence (evidence: `auth.js`)
- Express API → Game rules: applies rules (evidence: `server.js`)
- Express API → SQLite persistence: reads and writes (evidence: `server.js`)
- Express API → Character actions: routes character (evidence: `server.js`)
- Express API → Player presence: routes presence (evidence: `server.js`)
- Express API → Crib system: routes housing (evidence: `server.js`)
- Express API → Economy actions: routes actions (evidence: `server.js`)
- Express API → Shared markets: routes trading (evidence: `server.js`)
- Express API → Grading registry: routes grading (evidence: `server.js`)
- Express API → Altcoins: routes altcoins (evidence: `server.js`)
