# ilevi-code/ikariam-clone architecture

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

- Interactive diagram: https://gitdiagram.com/ilevi-code/ikariam-clone
- Repository: https://github.com/ilevi-code/ikariam-clone

## Overview

Ikariam Clone is a browser-based strategy-game application built on CodeIgniter. The principal workflow is a web request routed to game or action controllers, which implement game interactions and return game views; action code also performs database operations. The README identifies battles and barbarian villages as missing, so they are not represented as implemented capabilities. Several controller/model links are necessarily omitted because their source was not sampled; dashed links mark unverified runtime wiring.

Main entry points: [`application/controllers/game.php`](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/game.php) (Game controller), [`system/core/CodeIgniter.php`](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/CodeIgniter.php) (Framework bootstrap), [`application/controllers/actions.php`](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/actions.php) (Game actions), [`system/core/Router.php`](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Router.php) (URI router)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Request handling"]
  node_front["Front controller<br/>[index.php]"]
  node_routes["Route mapping<br/>[routes.php]"]
  node_main["Main controller<br/>[main.php]"]
end

subgraph group_gameplay["Game experience"]
  node_game["Game controller<br/>[game.php]"]
  node_actions["Game actions<br/>[actions.php]"]
  node_gameviews["Game views"]
  node_gameindex["Game shell<br/>[game_index.php]"]
  node_language["Game language<br/>[game_lang.php]"]
end

subgraph group_domain["Game domain"]
  node_map["Island map<br/>[map.php]"]
  node_buildings["Building rules<br/>[buildings.php]"]
  node_missions["Mission data<br/>[mission_data.php]"]
  node_playerdata["Player state<br/>[player_model.php]"]
  node_gamedata["Game data<br/>[data_model.php]"]
  node_islands["Island data<br/>[island_model.php]"]
  node_updates["Game updates<br/>[update_model.php]"]
  node_database[("Game database<br/>[database.php]")]
end

subgraph group_operations["Administration"]
  node_admin["Admin controller<br/>[acp.php]"]
  node_installer["Installer<br/>[install.php]"]
  node_installmodel["Install model<br/>[install_model.php]"]
end

subgraph group_framework["CodeIgniter runtime"]
  node_bootstrap["Framework bootstrap<br/>[CodeIgniter.php]"]
  node_router["URI router<br/>[Router.php]"]
  node_loader["Class loader<br/>[Loader.php]"]
  node_controller["Base controller<br/>[Controller.php]"]
  node_config["Configuration<br/>[Config.php]"]
end

node_player(("Player"))

node_player -->|"sends request"| node_front
node_front -->|"starts runtime"| node_bootstrap
node_bootstrap -->|"initializes"| node_router
node_router -->|"reads settings"| node_config
node_router -->|"loads routes"| node_routes
node_routes -->|"defaults to"| node_main
node_bootstrap -.->|"dispatches"| node_game
node_bootstrap -.->|"dispatches"| node_main
node_controller -->|"initializes"| node_loader
node_loader -->|"loads models"| node_gamedata
node_game -.->|"renders"| node_gameviews
node_game -.->|"renders"| node_gameindex
node_actions -->|"requires"| node_game
node_actions -->|"requires"| node_buildings
node_actions -->|"requires"| node_missions
node_actions -->|"queries"| node_database
node_game -.->|"uses"| node_playerdata
node_game -.->|"uses"| node_gamedata
node_game -.->|"uses"| node_islands
node_game -.->|"uses"| node_updates
node_game -.->|"uses"| node_map
node_game -.->|"displays text"| node_language
node_bootstrap -.->|"dispatches"| node_admin
node_bootstrap -.->|"dispatches"| node_installer
node_installer -.->|"uses"| node_installmodel

click node_front "https://github.com/ilevi-code/ikariam-clone/blob/master/index.php"
click node_routes "https://github.com/ilevi-code/ikariam-clone/blob/master/application/config/routes.php"
click node_main "https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/main.php"
click node_game "https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/game.php"
click node_actions "https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/actions.php"
click node_gameviews "https://github.com/ilevi-code/ikariam-clone/tree/master/application/views/view"
click node_gameindex "https://github.com/ilevi-code/ikariam-clone/blob/master/application/views/game_index.php"
click node_map "https://github.com/ilevi-code/ikariam-clone/blob/master/application/libraries/map.php"
click node_buildings "https://github.com/ilevi-code/ikariam-clone/blob/master/application/libraries/buildings.php"
click node_missions "https://github.com/ilevi-code/ikariam-clone/blob/master/application/libraries/mission_data.php"
click node_playerdata "https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/player_model.php"
click node_gamedata "https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/data_model.php"
click node_islands "https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/island_model.php"
click node_updates "https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/update_model.php"
click node_database "https://github.com/ilevi-code/ikariam-clone/blob/master/application/config/database.php"
click node_admin "https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/acp.php"
click node_installer "https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/install.php"
click node_installmodel "https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/install_model.php"
click node_language "https://github.com/ilevi-code/ikariam-clone/blob/master/application/language/english/game_lang.php"
click node_bootstrap "https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/CodeIgniter.php"
click node_router "https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Router.php"
click node_loader "https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Loader.php"
click node_controller "https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Controller.php"
click node_config "https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Config.php"

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_front,node_routes,node_main toneBlue
class node_game,node_actions,node_gameviews,node_gameindex,node_language toneAmber
class node_map,node_buildings,node_missions,node_playerdata,node_gamedata,node_islands,node_updates,node_database toneMint
class node_admin,node_installer,node_installmodel toneRose
class node_bootstrap,node_router,node_loader,node_controller,node_config,node_player toneIndigo
```

## Components

### Request handling

- [Front controller](https://github.com/ilevi-code/ikariam-clone/blob/master/index.php): `index.php`
- [Route mapping](https://github.com/ilevi-code/ikariam-clone/blob/master/application/config/routes.php): `application/config/routes.php`
- [Main controller](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/main.php): `application/controllers/main.php`

### Game experience

- [Game controller](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/game.php): `application/controllers/game.php`
- [Game actions](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/actions.php): `application/controllers/actions.php`
- [Game views](https://github.com/ilevi-code/ikariam-clone/tree/master/application/views/view): `application/views/view`
- [Game shell](https://github.com/ilevi-code/ikariam-clone/blob/master/application/views/game_index.php): `application/views/game_index.php`
- [Game language](https://github.com/ilevi-code/ikariam-clone/blob/master/application/language/english/game_lang.php): `application/language/english/game_lang.php`

### Game domain

- [Island map](https://github.com/ilevi-code/ikariam-clone/blob/master/application/libraries/map.php): `application/libraries/map.php`
- [Building rules](https://github.com/ilevi-code/ikariam-clone/blob/master/application/libraries/buildings.php): `application/libraries/buildings.php`
- [Mission data](https://github.com/ilevi-code/ikariam-clone/blob/master/application/libraries/mission_data.php): `application/libraries/mission_data.php`
- [Player state](https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/player_model.php): `application/models/player_model.php`
- [Game data](https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/data_model.php): `application/models/data_model.php`
- [Island data](https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/island_model.php): `application/models/island_model.php`
- [Game updates](https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/update_model.php): `application/models/update_model.php`
- [Game database](https://github.com/ilevi-code/ikariam-clone/blob/master/application/config/database.php): `application/config/database.php`

### Administration

- [Admin controller](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/acp.php): `application/controllers/acp.php`
- [Installer](https://github.com/ilevi-code/ikariam-clone/blob/master/application/controllers/install.php): `application/controllers/install.php`
- [Install model](https://github.com/ilevi-code/ikariam-clone/blob/master/application/models/install_model.php): `application/models/install_model.php`

### CodeIgniter runtime

- [Framework bootstrap](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/CodeIgniter.php): `system/core/CodeIgniter.php`
- [URI router](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Router.php): `system/core/Router.php`
- [Class loader](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Loader.php): `system/core/Loader.php`
- [Base controller](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Controller.php): `system/core/Controller.php`
- [Configuration](https://github.com/ilevi-code/ikariam-clone/blob/master/system/core/Config.php): `system/core/Config.php`

### Other components

- **Player**

## Connections

- Player → Front controller: sends request (evidence: `index.php`)
- Front controller → Framework bootstrap: starts runtime (evidence: `index.php`)
- Framework bootstrap → URI router: initializes (evidence: `system/core/CodeIgniter.php`)
- URI router → Configuration: reads settings (evidence: `system/core/Router.php`)
- URI router → Route mapping: loads routes (evidence: `application/config/routes.php`)
- Route mapping → Main controller: defaults to (evidence: `application/config/routes.php`)
- Framework bootstrap → Game controller: dispatches
- Framework bootstrap → Main controller: dispatches
- Base controller → Class loader: initializes (evidence: `system/core/Controller.php`)
- Class loader → Game data: loads models (evidence: `system/core/Loader.php`)
- Game controller → Game views: renders
- Game controller → Game shell: renders
- Game actions → Game controller: requires (evidence: `application/controllers/actions.php`)
- Game actions → Building rules: requires (evidence: `application/controllers/actions.php`)
- Game actions → Mission data: requires (evidence: `application/controllers/actions.php`)
- Game actions → Game database: queries (evidence: `application/controllers/actions.php`)
- Game controller → Player state: uses
- Game controller → Game data: uses
- Game controller → Island data: uses
- Game controller → Game updates: uses
- Game controller → Island map: uses
- Game controller → Game language: displays text
- Framework bootstrap → Admin controller: dispatches
- Framework bootstrap → Installer: dispatches
- Installer → Install model: uses
