[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72642":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},72642,"server-survival","pshenok\u002Fserver-survival","pshenok","Tower defense game that teaches cloud architecture. Build infrastructure, survive traffic, learn scaling.","https:\u002F\u002Fpshenok.github.io\u002Fserver-survival\u002F",null,"JavaScript",5774,661,24,31,0,10,23,115,30,105.96,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37],"aws","cloud","devops","education","game","javascript","learning","open-source","simulation","threejs","tower-defense","2026-06-12 04:01:06","# Server Survival\n\n![Gameplay Demo](assets\u002Fgameplay.gif)\n\n**Server Survival** is an interactive 3D simulation game where you play as a **Cloud Architect**. Your mission is to build and scale a resilient cloud infrastructure to handle increasing traffic loads while fighting off DDoS attacks, managing your budget, and keeping your services healthy.\n\nLearn cloud by playing:\n\n[![PLAY NOW](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPLAY_NOW-Server_Survival-2ea44f?style=for-the-badge)](https:\u002F\u002Fpshenok.github.io\u002Fserver-survival\u002F)\n\n## How to Play\n\n### Objective\n\nSurvive as long as possible! Manage your **Budget ($)**, **Reputation (%)**, and **Service Health**.\n\n- **Earn Money** by successfully processing legitimate traffic requests.\n- **Lose Reputation** if requests fail or if malicious traffic slips through.\n- **Maintain Health** - Services degrade under load and need repairs.\n- **Game Over** if Reputation hits 0% or you go bankrupt ($-1000).\n\n### Traffic Types\n\n| Traffic       | Color  | Destination        | Reward | Description                            |\n| :------------ | :----- | :----------------- | :----- | :------------------------------------- |\n| **STATIC**    | Green  | CDN \u002F Storage      | $0.50  | Static file requests (images, CSS, JS) |\n| **READ**      | Blue   | Replica \u002F NoSQL \u002F SQL DB | $0.80  | Database read operations               |\n| **WRITE**     | Orange | NoSQL \u002F SQL DB     | $1.20  | Database write operations              |\n| **UPLOAD**    | Yellow | Storage            | $1.50  | File uploads                           |\n| **SEARCH**    | Cyan   | Search Engine \u002F SQL DB | $1.20  | Search queries (Search Engine preferred, SQL DB fallback) |\n| **MALICIOUS** | Red    | Blocked by Firewall| $0     | DDoS attacks — block with Firewall!    |\n\n### Infrastructure & Services\n\nBuild your architecture using the toolbar. Each service has a cost, capacity, and upkeep:\n\n| Service          | Cost | Capacity  | Upkeep    | Function                                                              |\n| :--------------- | :--- | :-------- | :-------- | :-------------------------------------------------------------------- |\n| **Firewall**     | $40  | 30        | Low       | **Security.** First line of defense. Blocks malicious traffic.        |\n| **API Gateway**  | $70  | 40        | Medium    | **Rate Limiting.** Throttles excess traffic (soft-fail). **Upgradeable T1→T3.** |\n| **Queue**        | $45  | Queue:200 | Low       | **Buffer.** Buffers requests during spikes. Prevents drops.           |\n| **Load Balancer**| $50  | 20        | Medium    | **Distribution.** Distributes traffic to multiple instances.          |\n| **Compute**      | $60  | 4         | High      | **Processing.** Processes requests. **Upgradeable T1→T3.**            |\n| **Serverless Function** | $45 | 30 (auto) | Very Low + $0.03\u002Freq | **Pay-per-use Compute.** Auto-scales with traffic. Low upkeep, but charges $0.03 per request. Cheap when idle, expensive at high RPS. |\n| **CDN**          | $60  | 50        | Low       | **Delivery.** Caches STATIC content at edge (95% hit rate).           |\n| **SQL DB**       | $150 | 8         | Very High | **Database.** Handles READ\u002FWRITE\u002FSEARCH. **Upgradeable T1→T3.**      |\n| **NoSQL DB**     | $80  | 15        | High      | **Fast Database.** Handles READ\u002FWRITE only (no SEARCH). **Upgradeable T1→T3.** |\n| **Cache**        | $60  | 30        | Medium    | **Caching.** Caches responses to reduce DB load. **Upgradeable T1→T3.** |\n| **Search Engine**| $120 | 12        | High      | **Search.** Specialized for SEARCH queries. 3x faster than SQL DB. **Upgradeable T1→T3.** |\n| **Read Replica** | $100 | 12        | Medium    | **Read Offload.** Offloads READ from master DB. Requires DB connection. **Upgradeable T1→T3.** |\n| **Storage**      | $25  | 25        | Low       | **File System.** Destination for STATIC\u002FUPLOAD traffic.               |\n\n### Scoring & Economy\n\n| Action         | Money  | Score | Reputation |\n| :------------- | :----- | :---- | :--------- |\n| Static Request | +$0.50 | +3    | +0.1       |\n| DB Read        | +$0.80 | +5    | +0.1       |\n| DB Write       | +$1.20 | +8    | +0.1       |\n| File Upload    | +$1.50 | +10   | +0.1       |\n| Search Query   | +$1.20 | +5    | +0.1       |\n| Attack Blocked | +$0.50 | +10   | -          |\n| Request Failed | -      | -half | -1         |\n| Req. Throttled | -      | -     | -0.2       |\n| Attack Leaked  | -      | -     | -5         |\n\n### Upkeep & Cost Scaling\n\n- **Base Upkeep:** Each service has per-minute upkeep costs\n- **Upkeep Scaling:** Costs increase 1x to 2x over 10 minutes\n- **Repair Costs:** 15% of service cost to manually repair\n- **Auto-Repair:** +10% upkeep overhead when enabled\n\n### Game Modes\n\n#### Survival Mode\n\nThe core experience - survive as long as possible against escalating traffic with constant intervention required:\n\n**Dynamic Challenges:**\n\n- **RPS Acceleration** - Traffic multiplies at time milestones (×1.3 at 1min → ×4.0 at 10min)\n- **Random Events** - Cost spikes, capacity drops, traffic bursts every 15-45 seconds\n- **Traffic Shifts** - Traffic patterns change every 40 seconds\n- **DDoS Spikes** - 50% malicious traffic waves every 45 seconds\n- **Service Degradation** - Services lose health under load, require repairs\n\n**New UI Features:**\n\n- **Health bars on all services**\n- **Active event indicator bar at top**\n- **Detailed finances panel (income\u002Fexpenses breakdown)**\n- **Service health panel with repair costs**\n- **Auto-repair toggle**\n- **Game over analysis with tips**\n\n#### Sandbox Mode\n\nA fully customizable testing environment for experimenting with any architecture:\n\n| Control           | Description                                                       |\n| :---------------- | :---------------------------------------------------------------- |\n| **Budget**        | Set any starting budget (slider 0-10K, or type any amount)        |\n| **RPS**           | Control traffic rate (0 = stopped, or type 100+ for stress tests) |\n| **Traffic Mix**   | Adjust all 6 traffic type percentages independently               |\n| **Burst**         | Spawn instant bursts of specific traffic types                    |\n| **Upkeep Toggle** | Enable\u002Fdisable service costs                                      |\n| **Clear All**     | Reset all services and restore budget                             |\n\n**No game over in Sandbox** - experiment freely!\n\n### Recent Features (v2.3)\n\n- **Serverless Function** - Pay-per-use compute variant ($45 to place, $2\u002Fmin upkeep, $0.03 per completed request). Auto-scales to capacity 30 with a 900ms cold-start processing time. Same routing topology as Compute (ALB\u002FQueue\u002FAPI Gateway upstream; Cache\u002FDB\u002FNoSQL\u002FS3\u002FSearch\u002FReplica downstream).\n- **Cost-aware Smart Hint** - Warns when a Serverless node's per-request cost is adding up at high RPS, nudging players toward a Compute node for sustained throughput.\n\n### Recent Features (v2.2)\n\n- **Search Engine** - Specialized SEARCH handler, 3x faster than SQL DB (100ms vs 300ms). Upgradeable (Tiers 1-3: 12\u002F25\u002F40 capacity)\n- **Read Replica** - Offloads READ traffic from master DB. Requires connection to SQL DB or NoSQL. Upgradeable (Tiers 1-3)\n- **Smart Hints** - Contextual suggestions when your architecture is suboptimal (e.g. \"DB overloaded with SEARCH — add a Search Engine!\")\n- **Economy Rebalance** - Starting budget $500, SEARCH reward increased to $1.20\n- **New Traffic Shifts** - \"Read Heavy\" (45% READ) and \"Full-Text Flood\" (55% SEARCH) patterns\n\n### Previous Features (v2.1)\n\n- **API Gateway** - Rate limits traffic with soft-fail throttling (-0.2 rep instead of -1.0). Upgradeable (Tiers 1-3: 20\u002F40\u002F80 RPS)\n- **NoSQL Database** - Fast alternative to SQL for READ\u002FWRITE traffic (150ms vs 300ms). Cannot handle SEARCH. Upgradeable (Tiers 1-3)\n- **Constant Intervention Mechanics** - Game requires active management throughout\n- **Service Health System** - Visual health bars, manual\u002Fauto repair options\n- **RPS Milestones** - Traffic surge warnings with multiplier display\n- **Active Event Bar** - Shows current random event with countdown timer\n- **Detailed Finances** - Income by request type, expenses by service with counts\n- **Game Over Analysis** - Failure reason, description, and contextual tips\n- **Retry Same Setup** - Restart with same architecture after game over\n- **Interactive Tutorial** - Guided walkthrough for new players\n\n### Controls\n\n- **Left Click:** Select tools, place services, and connect nodes.\n- **Right Click + Drag:** Pan the camera.\n- **Scroll:** Zoom in and out.\n- **WASD \u002F Arrows:** Move camera (pan) when zoomed in.\n- **ESC:** Open main menu and pause game. Press again or click Resume to close menu (stays paused).\n- **Camera Reset:** Press `R` to reset the camera position.\n- **Birds-Eye View:** Press `T` to switch between isometric and top-down view.\n- **Hide HUD:** Press `H` to toggle UI panels.\n- **Connect Tool:** Click two nodes to create a connection (flow direction matters!).\n  - _Valid Flows:_ Internet -> (Firewall\u002FCDN\u002FAPI Gateway) -> Load Balancer -> Queue -> Compute -> Cache -> (Search Engine\u002FRead Replica\u002FSQL DB\u002FNoSQL DB\u002FStorage)\n- **Delete Tool:** Remove services to recover 50% of the cost.\n- **Time Controls:** Pause, Play (1x), and Fast Forward (3x).\n\n## Strategy Tips\n\n1.  **Block Attacks First:** Always place a Firewall immediately connected to the Internet. Malicious leaks destroy reputation fast (-5 per leak).\n2.  **Use CDN for Static Content:** Connect Internet -> CDN -> Storage. The CDN handles 95% of static traffic cheaply!\n3.  **Watch Service Health:** Damaged services have reduced capacity. Click to repair or enable Auto-Repair.\n4.  **Scale for Traffic Surges:** RPS multiplies at milestones - prepare before ×2.0 at 3 minutes!\n5.  **Balance Income vs Upkeep:** Start lean, scale as income grows. Over-provisioning leads to bankruptcy.\n6.  **Use Cache Wisely:** Reduces database load significantly for READ requests.\n7.  **Buffer with Queue:** Queue helps survive traffic burst events without dropping requests.\n8.  **React to Events:** Watch the event bar - cost spikes mean hold off on purchases, traffic bursts mean ensure capacity.\n9.  **API Gateway for Graceful Degradation:** Throttled requests only lose -0.2 reputation (vs -1.0 for failures). Great for surviving traffic spikes!\n10. **Split DB Traffic with NoSQL:** Route READ\u002FWRITE to NoSQL (faster, cheaper) and keep SQL DB for SEARCH queries only.\n11. **Search Engine for SEARCH Storms:** SEARCH is the heaviest traffic type (2.5x weight). A dedicated Search Engine processes it 3x faster than SQL DB.\n12. **Read Replica for READ offloading:** Under \"API Heavy\" or \"Read Heavy\" shifts, a Read Replica prevents your main DB from drowning in READ requests.\n13. **Serverless Function = pay-per-use:** Great for spiky traffic, but monitor finances — per-request cost ($0.03) adds up fast at high RPS.\n\n## Tech Stack\n\n- **Core:** Vanilla JavaScript (ES6+)\n- **Rendering:** [Three.js](https:\u002F\u002Fthreejs.org\u002F) for 3D visualization.\n- **Styling:** [Tailwind CSS](https:\u002F\u002Ftailwindcss.com\u002F) for the glassmorphism UI.\n- **Build:** No build step required! Just standard HTML\u002FCSS\u002FJS.\n\n## Getting Started\n\n1.  Clone the repository.\n2.  Open `index.html` in your modern web browser.\n3.  Start building your cloud empire!\n\n## Community\n\nJoin our Discord server to discuss strategies and share your high scores:\n[Join Discord](https:\u002F\u002Fdiscord.gg\u002Ff38NgHDwnK)\n\n---\n\n_Built with code and chaos._\n","Server Survival 是一款以云架构为主题的塔防游戏，通过构建和扩展云基础设施来应对不断增加的流量负载，并抵御DDoS攻击。核心功能包括使用不同类型的云服务（如防火墙、API网关、队列等）来管理预算、声誉和服务健康度，同时处理合法与恶意流量。游戏采用JavaScript开发，利用Three.js实现3D效果，适合对云计算感兴趣的学习者以及希望以更有趣方式了解DevOps概念的专业人士。",2,"2026-06-11 03:42:55","high_star"]