# scorzy/idlespace2 architecture

> Architecture diagram of the GitHub repository scorzy/idlespace2, 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/scorzy/idlespace2
- Repository: https://github.com/scorzy/idlespace2

## Overview

IdleSpace2 is an Angular idle space game. The principal runtime is the game model: it advances production and queued work, while progression systems update research, fleets, combat, challenges, prestige, and automation. The UI and MainService provide the player-facing application and save/platform boundary. The README identifies Angular, but does not detail feature wiring; edges below are limited to relationships visible in excerpts or the SOURCE INDEX, so several UI-to-domain links are omitted.

Main entry points: [`src/app/model/game.ts`](https://github.com/scorzy/idlespace2/blob/master/src/app/model/game.ts) (Game State), [`src/app/model/job/jobManager.ts`](https://github.com/scorzy/idlespace2/blob/master/src/app/model/job/jobManager.ts) (Job Queues), [`src/app/model/units/resourceManager.ts`](https://github.com/scorzy/idlespace2/blob/master/src/app/model/units/resourceManager.ts) (Resources & Units), [`src/app/model/researches/researchManager.ts`](https://github.com/scorzy/idlespace2/blob/master/src/app/model/researches/researchManager.ts) (Research & Tech)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_ui["Game Interface<br/>[app.component.ts]"]
  node_service["Main Service<br/>[main.service.ts]"]
end

subgraph group_core["Game Runtime"]
  node_game["Game State<br/>[game.ts]"]
  node_resources["Resources &amp; Units<br/>[resourceManager.ts]"]
  node_jobs["Job Queues<br/>[jobManager.ts]"]
  node_bonus["Bonus Calculation<br/>[bonusStack.ts]"]
end

subgraph group_progress["Progression"]
  node_research["Research &amp; Tech<br/>[researchManager.ts]"]
  node_challenges["Challenges"]
  node_achievements["Achievements"]
  node_prestige["Prestige<br/>[prestigeManager.ts]"]
  node_computing["Spells &amp; Warp"]
end

subgraph group_space["Space Operations"]
  node_shipyard["Shipyard<br/>[shipyardManager.ts]"]
  node_enemy["Enemy Search &amp; Battle<br/>[enemyManager.ts]"]
  node_stations["Space Stations"]
  node_automation["Automation"]
end

subgraph group_support["Game Systems"]
  node_stats["Statistics<br/>[statsManager.ts]"]
  node_notifications["Notifications"]
end

node_player(("Player"))
node_cloud["PlayFab Services"]

node_player -->|"interacts"| node_ui
node_service -->|"imports"| node_game
node_game -->|"initializes"| node_resources
node_game -->|"initializes"| node_research
node_game -->|"initializes"| node_shipyard
node_game -->|"initializes"| node_enemy
node_game -->|"advances work"| node_stations
node_game -->|"initializes"| node_automation
node_game -->|"initializes"| node_computing
node_game -->|"starts challenge"| node_challenges
node_game -->|"imports"| node_prestige
node_game -->|"initializes"| node_stats
node_game -->|"initializes"| node_notifications
node_resources -->|"uses bonuses"| node_bonus
node_resources -->|"adds notifications"| node_notifications
node_research -->|"extends manager"| node_jobs
node_research -->|"creates bonuses"| node_bonus
node_shipyard -->|"uses job manager"| node_jobs
node_enemy -->|"uses job manager"| node_jobs
node_stations -->|"uses job manager"| node_jobs
node_service -.->|"calls account API"| node_cloud
node_game -->|"sends platform stats"| node_service

click node_ui "https://github.com/scorzy/idlespace2/blob/master/src/app/app.component.ts"
click node_service "https://github.com/scorzy/idlespace2/blob/master/src/app/main.service.ts"
click node_game "https://github.com/scorzy/idlespace2/blob/master/src/app/model/game.ts"
click node_resources "https://github.com/scorzy/idlespace2/blob/master/src/app/model/units/resourceManager.ts"
click node_jobs "https://github.com/scorzy/idlespace2/blob/master/src/app/model/job/jobManager.ts"
click node_bonus "https://github.com/scorzy/idlespace2/blob/master/src/app/model/bonus/bonusStack.ts"
click node_research "https://github.com/scorzy/idlespace2/blob/master/src/app/model/researches/researchManager.ts"
click node_challenges "https://github.com/scorzy/idlespace2/blob/master/src/app/model/challenge/challengeManager.ts"
click node_achievements "https://github.com/scorzy/idlespace2/blob/master/src/app/model/achievements/achievementManager.ts"
click node_prestige "https://github.com/scorzy/idlespace2/blob/master/src/app/model/prestige/prestigeManager.ts"
click node_computing "https://github.com/scorzy/idlespace2/blob/master/src/app/model/computing/computingManager.ts"
click node_shipyard "https://github.com/scorzy/idlespace2/blob/master/src/app/model/shipyard/shipyardManager.ts"
click node_enemy "https://github.com/scorzy/idlespace2/blob/master/src/app/model/enemy/enemyManager.ts"
click node_stations "https://github.com/scorzy/idlespace2/blob/master/src/app/model/space/spaceStationManager.ts"
click node_automation "https://github.com/scorzy/idlespace2/blob/master/src/app/model/automation/automationManager.ts"
click node_stats "https://github.com/scorzy/idlespace2/blob/master/src/app/model/stats/statsManager.ts"
click node_notifications "https://github.com/scorzy/idlespace2/blob/master/src/app/model/notifications/notificationManager.ts"

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_ui,node_service toneBlue
class node_game,node_resources,node_jobs,node_bonus toneAmber
class node_research,node_challenges,node_achievements,node_prestige,node_computing toneMint
class node_shipyard,node_enemy,node_stations,node_automation toneRose
class node_stats,node_notifications,node_player,node_cloud toneIndigo
```

## Components

### Application

- [Game Interface](https://github.com/scorzy/idlespace2/blob/master/src/app/app.component.ts): `src/app/app.component.ts`
- [Main Service](https://github.com/scorzy/idlespace2/blob/master/src/app/main.service.ts): `src/app/main.service.ts`

### Game Runtime

- [Game State](https://github.com/scorzy/idlespace2/blob/master/src/app/model/game.ts): `src/app/model/game.ts`
- [Resources & Units](https://github.com/scorzy/idlespace2/blob/master/src/app/model/units/resourceManager.ts): `src/app/model/units/resourceManager.ts`
- [Job Queues](https://github.com/scorzy/idlespace2/blob/master/src/app/model/job/jobManager.ts): `src/app/model/job/jobManager.ts`
- [Bonus Calculation](https://github.com/scorzy/idlespace2/blob/master/src/app/model/bonus/bonusStack.ts): `src/app/model/bonus/bonusStack.ts`

### Progression

- [Research & Tech](https://github.com/scorzy/idlespace2/blob/master/src/app/model/researches/researchManager.ts): `src/app/model/researches/researchManager.ts`
- [Challenges](https://github.com/scorzy/idlespace2/blob/master/src/app/model/challenge/challengeManager.ts): `src/app/model/challenge/challengeManager.ts`
- [Achievements](https://github.com/scorzy/idlespace2/blob/master/src/app/model/achievements/achievementManager.ts): `src/app/model/achievements/achievementManager.ts`
- [Prestige](https://github.com/scorzy/idlespace2/blob/master/src/app/model/prestige/prestigeManager.ts): `src/app/model/prestige/prestigeManager.ts`
- [Spells & Warp](https://github.com/scorzy/idlespace2/blob/master/src/app/model/computing/computingManager.ts): `src/app/model/computing/computingManager.ts`

### Space Operations

- [Shipyard](https://github.com/scorzy/idlespace2/blob/master/src/app/model/shipyard/shipyardManager.ts): `src/app/model/shipyard/shipyardManager.ts`
- [Enemy Search & Battle](https://github.com/scorzy/idlespace2/blob/master/src/app/model/enemy/enemyManager.ts): `src/app/model/enemy/enemyManager.ts`
- [Space Stations](https://github.com/scorzy/idlespace2/blob/master/src/app/model/space/spaceStationManager.ts): `src/app/model/space/spaceStationManager.ts`
- [Automation](https://github.com/scorzy/idlespace2/blob/master/src/app/model/automation/automationManager.ts): `src/app/model/automation/automationManager.ts`

### Game Systems

- [Statistics](https://github.com/scorzy/idlespace2/blob/master/src/app/model/stats/statsManager.ts): `src/app/model/stats/statsManager.ts`
- [Notifications](https://github.com/scorzy/idlespace2/blob/master/src/app/model/notifications/notificationManager.ts): `src/app/model/notifications/notificationManager.ts`

### Other components

- **Player**
- **PlayFab Services**

## Connections

- Player → Game Interface: interacts
- Main Service → Game State: imports (evidence: `src/app/main.service.ts`)
- Game State → Resources & Units: initializes (evidence: `src/app/model/game.ts`)
- Game State → Research & Tech: initializes (evidence: `src/app/model/game.ts`)
- Game State → Shipyard: initializes (evidence: `src/app/model/game.ts`)
- Game State → Enemy Search & Battle: initializes (evidence: `src/app/model/game.ts`)
- Game State → Space Stations: advances work (evidence: `src/app/model/game.ts`)
- Game State → Automation: initializes (evidence: `src/app/model/game.ts`)
- Game State → Spells & Warp: initializes (evidence: `src/app/model/game.ts`)
- Game State → Challenges: starts challenge (evidence: `src/app/model/game.ts`)
- Game State → Prestige: imports (evidence: `src/app/model/game.ts`)
- Game State → Statistics: initializes (evidence: `src/app/model/game.ts`)
- Game State → Notifications: initializes (evidence: `src/app/model/game.ts`)
- Resources & Units → Bonus Calculation: uses bonuses (evidence: `src/app/model/units/resourceManager.ts`)
- Resources & Units → Notifications: adds notifications (evidence: `src/app/model/units/resourceManager.ts`)
- Research & Tech → Job Queues: extends manager (evidence: `src/app/model/researches/researchManager.ts`)
- Research & Tech → Bonus Calculation: creates bonuses (evidence: `src/app/model/researches/researchManager.ts`)
- Shipyard → Job Queues: uses job manager (evidence: `src/app/model/shipyard/shipyardManager.ts`)
- Enemy Search & Battle → Job Queues: uses job manager (evidence: `src/app/model/enemy/enemyManager.ts`)
- Space Stations → Job Queues: uses job manager (evidence: `src/app/model/space/spaceStationManager.ts`)
- Main Service → PlayFab Services: calls account API
- Game State → Main Service: sends platform stats (evidence: `src/app/model/game.ts`)
