# PRODUCTION - The Idle Game > **"Build the Ultimate Global Supply Chain Empire."** **Production - The Idle Game** is an expansive, strategic incremental/idle web game inspired by *Capitalism*, *Factorio-lite*, and modern idle tycoon simulators. Take command of a burgeoning enterprise, starting from primary extraction (wheat, timber, iron ore) and scaling into complex, multi-tiered industrial supply chains producing microchips, commercial trucks, consumer smartphones, and corporate office furniture. The game is packaged as a lightweight, turnkey **Docker Compose stack** powered by a fast Python FastAPI backend with SQLite persistence and an Nginx reverse-proxy frontend. --- ## 🌟 Key Features * **Real Supply Chain Dependencies (DAG Pipeline):** * Higher-tier industrial goods require and consume physical stockpiles of lower-tier commodities. * Real-time bottleneck warnings when upstream inputs run short. * 6 Interconnected Industry Sectors: 1. **Agriculture & Food:** Wheat, Milled Flour, Sugar Beet, Refined Sugar, Artisan Bread, Packaged Meals. 2. **Forestry & Materials:** Raw Timber, Milled Planks, Industrial Paper, Office Furniture. 3. **Mining & Metallurgy:** Iron Ore, Coking Coal, Structural Steel, Heavy Frameworks. 4. **Chemicals & Polymers:** Crude Oil, Silica Quartz Sand, Industrial Polymers, Purified Silicon. 5. **High-Tech & Electronics:** Silicon Microchips, PCB Motherboards, Consumer Smartphones. 6. **Heavy Industry & Vehicles:** Industrial Engines, Commercial Logistics Trucks. * **Dual Revenue Channels:** * **Continuous Logistics Distribution:** Deploy dedicated logistics fleets to automatically wholesale products to regional distributors for continuous passive cashflow. * **B2B Procurement Contracts Board:** Bid on time-sensitive procurement tenders from MegaCorps and industrial clients for massive capital injections and reputation. * **Corporate IPO & Boardroom Prestige:** * File for an **Initial Public Offering (IPO)** on Wall Street when your enterprise valuation reaches critical mass. * Cash in for **Venture Shares ($V-Shares)** to unlock permanent perks on the Boardroom R&D Tech Tree (Automated ERP Routing, Industrial Robotics, Logistics Subsidies, Venture Capital Syndicate). * **Responsive Executive UI:** * **Desktop Command Station:** 3-column workstation layout (Departments & Sectors sidebar, main Production Floor, and live Supply Chain Inspector with instant spot-market liquidation). * **Mobile Optimization:** Ergonomic single-column interface with bottom navigation tabs and thumb-friendly controls. * **Cloud & Offline Sync:** * Plays instantly as a Guest with local persistence. * Optional lightweight account system (username + password with anti-bot honeypot protection). * Authoritative offline tick engine: when you return, your automated lines calculate production and logistics sales up to 8 hours. --- ## πŸ› οΈ Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Browser Client UI β”‚ β”‚ (ES Modules, CSS3) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ HTTP / :HOST_PORT β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Nginx Proxy β”‚ β”‚ (Reverse Proxy) β”‚ β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ / (Statiske aktiver) β”‚ /api/* β”‚ β–Ό β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ Python FastAPIβ”‚ β”‚ β”‚ (JWT & Engine)β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β–Ό β–Ό [frontend/] [SQLite DB] (/app/data/production.db) ``` --- ## πŸš€ Quick Start with Docker Compose ### 1. Prerequisites * [Docker](https://docs.docker.com/get-docker/) & [Docker Compose](https://docs.docker.com/compose/) ### 2. Configuration (.env) Create a `.env` file from the example: ```bash cp .env.example .env ``` ### 3. Launch the Stack ```bash docker compose up -d --build ``` The game is live in your browser at: πŸ‘‰ **`http://localhost:8080`** (or the port defined in `.env`). --- ## πŸ“ Project Directory Structure ``` . β”œβ”€β”€ .env.example β”œβ”€β”€ docker-compose.yml β”œβ”€β”€ backend/ β”‚ β”œβ”€β”€ Dockerfile β”‚ β”œβ”€β”€ requirements.txt β”‚ β”œβ”€β”€ auth.py # JWT authentication & password hashing β”‚ β”œβ”€β”€ database.py # SQLite connection and migration setup β”‚ β”œβ”€β”€ engine.py # Authoritative DAG simulation and offline calculations β”‚ β”œβ”€β”€ main.py # FastAPI endpoints β”‚ └── models.py # Pydantic schemas β”œβ”€β”€ frontend/ β”‚ β”œβ”€β”€ index.html # Responsive executive layout β”‚ β”œβ”€β”€ css/ β”‚ β”‚ └── style.css # Modern corporate design system β”‚ └── js/ β”‚ β”œβ”€β”€ app.js # Application orchestrator & game loop β”‚ β”œβ”€β”€ core/ β”‚ β”‚ β”œβ”€β”€ engine.js # Client-side DAG tick simulation β”‚ β”‚ β”œβ”€β”€ formatters.js# Number notations (Standard K/M/B/T, Scientific) β”‚ β”‚ β”œβ”€β”€ state.js # State manager, schema handling & IPO reset β”‚ β”‚ └── sync.js # Backend synchronization & auth handling β”‚ β”œβ”€β”€ data/ β”‚ β”‚ β”œβ”€β”€ products.js # 24+ commodities across 6 sectors β”‚ β”‚ β”œβ”€β”€ contracts.js # B2B procurement tenders β”‚ β”‚ β”œβ”€β”€ boardroom.js # IPO perks and Venture Share logic β”‚ β”‚ └── achievements.js β”‚ └── ui/ β”‚ β”œβ”€β”€ productionView.js β”‚ β”œβ”€β”€ contractsView.js β”‚ β”œβ”€β”€ boardroomView.js β”‚ β”œβ”€β”€ inspectorView.js β”‚ └── achievementsView.js └── nginx/ └── default.conf.template ```