Skip to main content
Developer & Creator Documentation

YourPlayground.games Documentation & Architecture

YourPlayground.games (www.yourplayground.games) is an AI-native multi-surface game creation studio, instant playable browser arcade, and universal iOS/Android mobile & tablet ecosystem.

Open AI Studio Direct-Answer FAQ Hub Machine-Readable Corpus (/llms-full.txt)

YourPlayground.games — Canonical Engineering, Scientific Research & Platform Documentation Suite

Platform Motto: "Dream It. Prompt It. Play Your Universe."

Canonical Origin: https://www.yourplayground.games | Local Runtime: http://localhost:9033

AI Compute Backbone: Google Cloud Vertex AI (project: 'ids-hybrid-model', location: 'global')

Default Active Coding Model: gemini-4-neon (XHIGH Thinking) | Forensic 1-Shot Repair Model: gemini-4-carbon


1. Platform Vision & Engineering Philosophy

YourPlayground.games (www.yourplayground.games) is an AI-native multi-surface game creation studio, instant playable browser arcade, and universal iOS/Android mobile & tablet ecosystem. Any creator or player—with or without an account, and without writing a single line of code—can describe a 2D or 3D game concept in plain English, unlock synthesis via a lightweight rewarded-ad gate (Watch Ad -> Earn Credit -> Generate & Play), and immediately play, remix, export, or compete on global leaderboards inside a cryptographically and origin-isolated execution sandbox.

Every subsystem of the platform is engineered from first principles around five non-negotiable architectural pillars:

  1. Deterministic Neuro-Symbolic Game Synthesis: Coupling gemini-4-neon (XHIGH reasoning) for rapid single-file HTML5 Canvas 2D, Phaser 3.90.0, and Three.js r160 synthesis with linear-time structural validation, V8 vm.Script compilation verification, and gemini-4-carbon 1-shot forensic root-cause repair.
  2. Linear-Time O(N) Sandbox Isolation: Eliminating regular-expression catastrophic backtracking (O(2^N) ReDoS) and cross-origin data exfiltration through spec-exact WHATWG HTML5 §13.2.5, W3C CSS Syntax Level 3, and ECMA-262 lexical state machines paired with opaque-origin <iframe sandbox="allow-scripts allow-pointer-lock"> OOPIF isolation.
  3. 1:1 Cosmic Midnight Visual Craft: Matching the canonical visual design anchors (your_playgrpound_games_design_1.png and Yapay Zekâ Evrenini Oyna ve Yarat-1.png) across desktop, tablet, and mobile viewports—combining deep cosmic midnight surfaces, violet glassmorphism, luminous cyan-to-violet-magenta gradients, and gemini-nano-banana-2.1 / gemini-3-pro-image text-free multimodal artwork.
  4. Near-Zero-Spend 5-Pillar Organic Discovery (SEO + GEO + ASO + AEO + AIO): Delivering full Server-Side Rendered (SSR) HTML5 documents with zero client-JS dependency for crawlers, interconnected Schema.org @graph JSON-LD topologies, /llms.txt & /llms-full.txt corpora, /.well-known/ai-context.json, IndexNow instant push notifications, and installable PWA / native store readiness.
  5. Sustainable Free-to-Play Rewarded Monetization & Privacy-First Telemetry: Financing frontier AI compute via Google AdSense, Google IMA HTML5 SDK VAST 4.2 rewarded video, single-use HMAC-SHA256 adGrantToken cryptographic state machines, Google AdMob on iOS/Android, and default-denied Google Consent Mode v2 (ypg_consent_v2).

2. High-Level Architectural Topology

flowchart TB
    subgraph Clients["Multi-Surface Client Tier"]
        WebSSR["Desktop & Mobile Web Shell<br/>(SSR HTML5 + ES Modules)"]
        PWA["Installable PWA Shell<br/>(/manifest.webmanifest + ypg-shell-v2 SW)"]
        MobileApp["iOS & Android Universal App<br/>(Phone & Tablet Adaptive Stage)"]
    end

    subgraph Edge["Express 5 HTTP Engine (:9033 -> www.yourplayground.games)"]
        SecMW["Security & Cache Hygiene Layer<br/>(SSR CSP, X-Frame-Options, No-Store HTML)"]
        SessMW["HMAC-SHA256 Cookie Middleware<br/>(ypg_vid 30d + Optional ypg_sid 7d)"]
        PagesR["SSR Pages & Growth Router<br/>(/, /showcase, /categories, /games/:slug, /faq)"]
        DiscR["AI & Search Discovery Router<br/>(/robots.txt, /sitemap.xml, /llms*.txt, /.well-known/*)"]
        ApiR["REST API Routers<br/>(/api/config, /api/ads/*, /api/games/*, /api/auth/*)"]
        RunR["Isolated Runtime Router<br/>(/runtime/:slug/* + RUNTIME_CSP_HEADER)"]
    end

    subgraph Core["Core Domain & Security Services"]
        AdGate["Ad-Gate State Machine<br/>(adGateService.mjs · Single-Use JTI)"]
        GenSvc["Game Synthesis Orchestrator<br/>(gameGeneratorService.mjs)"]
        Sanitizer["Linear-Time O(N) Sanitizer<br/>(gameSanitizer.mjs + vm.Script + SDK)"]
        VertexSvc["Vertex AI Client & Auth Resilience<br/>(vertexAiService.mjs · 45m gcloud Fallback)"]
        IdxNow["IndexNow Instant Publisher<br/>(indexNowService.mjs)"]
    end

    subgraph Persistence["Crash-Safe Atomic Persistence & Cloud Backing"]
        AtomicFS["Copy-on-Write JSON & Binary Store<br/>(storage/catalog.json, users.json, games/*)"]
        VertexCloud["Google Cloud Vertex AI<br/>(project: ids-hybrid-model · location: global)"]
        FirebaseCloud["Firebase Mobile Cloud Suite<br/>(Auth, Firestore, Storage, Remote Config, App Check)"]
    end

    WebSSR --> SecMW
    PWA --> SecMW
    MobileApp --> ApiR
    MobileApp --> FirebaseCloud

    SecMW --> SessMW
    SessMW --> PagesR
    SessMW --> DiscR
    SessMW --> ApiR
    SecMW --> RunR

    ApiR --> AdGate
    ApiR --> GenSvc
    GenSvc --> VertexSvc
    GenSvc --> Sanitizer
    GenSvc --> AtomicFS
    GenSvc --> IdxNow
    VertexSvc --> VertexCloud
    RunR --> AtomicFS
    PagesR --> AtomicFS
    DiscR --> AtomicFS

3. Master Documentation Navigation Table (10 Domain Volumes)

All documentation inside docs/ is self-contained, portable, and cross-linked directly to the live codebase.

Vol.Domain VolumeDocument PathCore Engineering & Scientific ScopePrimary Codebase Traceability
01System Architecturearchitecture/SYSTEM_ARCHITECTURE.mdExpress 5 SSR engine (:9033), null-origin OOPIF runtime, copy-on-write atomicJson persistence, ypg-shell-v2 cache-purge invariant, cross-platform mobile/tablet topology, and 10-layer butterfly-effect matrix.server.mjs, src/app.mjs, src/storage/atomicJson.mjs, public/sw.js
02Frontier Research Foundationsresearch/FRONTIER_RESEARCH_FOUNDATIONS.mdConstrained neuro-symbolic synthesis for 60 FPS interactive loops, Markov convergence math for Gemini 4 Neon → Gemini 4 Carbon 1-shot repair, multimodal crop-to-asset style locking, O(N) DFA vs O(2^N) NFA ReDoS proofs, GEO/AIO retrieval mechanics, and rewarded-ad game theory.src/services/gameGeneratorService.mjs, src/services/gameSanitizer.mjs, scripts/generate-creatives.mjs
03UI/UX Design Specificationdesign-system/UI_UX_DESIGN_SPECIFICATION.mdCanonical 1:1 visual specification anchored to docs/UI/*.png: Cosmic Midnight palette (#080A1A), #2CEEF8 -> #7C5CFF -> #D946EF gradients, violet glassmorphism, full-bleed hero blending, 5-stat ribbon, 4-step flow, carousel, ticket banner, horizon footer, non-overlapping consent bar, and phone/tablet/desktop breakpoints.docs/UI/your_playgrpound_games_design_1.png, docs/UI/Yapay Zekâ Evrenini Oyna ve Yarat-1.png, public/assets/css/tokens.css, src/views/layout.mjs
04Vertex AI & Model Routingai-engine/VERTEX_AI_AND_MODEL_ROUTING.mdComplete 8-model engineering matrix (gemini-4-neon default, gemini-4-carbon repair, hydrogen, argon, 3.8/3.7/3.6-flash, 3.1-pro-preview), thinking-level clamping calculus (MINIMAL..XHIGH/AUTO), 32,768 output token floor, Nano Banana 2.1 & Gemini 3 Pro Image, and 45-minute cached gcloud CLI fallback on invalid_rapt.src/config/models.mjs, src/services/vertexAiService.mjs, src/services/gameGeneratorService.mjs
05Sandbox & O(N) Sanitizersecurity/SANDBOX_AND_ON_SANITIZER.mdLinear-time O(N) complexity proofs across HTML5/CSS3/ECMA-262 scanners, blocked exfiltration sinks, local /vendor/{phaser.min.js,three.min.js} whitelisting, allow-scripts OOPIF null-origin isolation, dual CSP headers (SSR_CSP_HEADER vs RUNTIME_CSP_HEADER), HMAC-SHA256 cookies, and adversarial fuzzing benchmarks.src/services/gameSanitizer.mjs, src/routes/runtimeRouter.mjs, src/middleware/sessionMiddleware.mjs
065-Pillar Organic Growth Stackgrowth/ORGANIC_GROWTH_5_PILLAR_STACK.mdNear-zero-marketing-spend SEO + GEO + ASO + AEO + AIO stack: SSR canonical graph (https://www.yourplayground.games), Schema.org @graph JSON-LD builders, /llms.txt, /llms-full.txt, /.well-known/ai-context.json, IndexNow instant push, Google/Bing/Yandex verification tags, and PWA manifest.src/seo/metaBuilder.mjs, src/seo/schemaBuilder.mjs, src/routes/discoveryRouter.mjs, src/services/indexNowService.mjs
07Ads, Monetization & Consentmonetization/ADS_AND_CONSENT_ARCHITECTURE.mdGoogle AdSense publisher/slot integration, Google IMA HTML5 SDK VAST 4.2 rewarded video gate, single-use HMAC adGrantToken state machine, play-credit loop, Google AdMob iOS/Android placements, Google Consent Mode v2 (ypg_consent_v2), and GA4 / GTM / Microsoft Clarity telemetry (window.ypgTrack).src/services/adGateService.mjs, src/routes/apiAdsRouter.mjs, public/assets/js/adGateModal.mjs, public/assets/js/authModal.mjs
08Mobile & Tablet Architecturemobile/MOBILE_AND_TABLET_ARCHITECTURE.mdUniversal iOS & Android phone + tablet application blueprint: 1:1 docs/UI adaptive split-stage UX, hardware-accelerated isolated WKWebView/android.webkit.WebView + virtual touch bridge, full Firebase suite (Auth, Firestore, Storage, Analytics, Crashlytics, FCM, Remote Config, App Check), AdMob mediation, and store release checklists.public/assets/js/playerStage.mjs, src/routes/discoveryRouter.mjs, src/config/env.mjs
09API & Runtime SDK Referenceapi/API_AND_RUNTIME_SDK_REFERENCE.mdComplete HTTP REST API specification (/api/health, /api/config, /api/ads/*, /api/games/* including sprites, scores, and game metadata & score contract, /api/auth/*, /auth/google/*), JSON schemas, error codes, body-size guards, and window.YourPlaygroundSDK postMessage bridge protocol.src/routes/apiConfigRouter.mjs, src/routes/apiGamesRouter.mjs, src/routes/authRouter.mjs, src/services/gameSanitizer.mjs
10Operations & Verification Ladderoperations/RUNBOOK_AND_VERIFICATION_LADDER.mdProduction deployment runbook, exhaustive .env configuration dictionary (Vertex AI, AdSense, VAST, GA4, GTM, Clarity, Search Console, Bing, Yandex, IndexNow, OAuth, Firebase, AdMob), Zero-Ghost-UI Service Worker cache hygiene, and the 5-Rung Deterministic Verification Suite.src/config/env.mjs, package.json, public/sw.js
11QA Verification Matrix & Defect Ledgeroperations/qa-department-matrix-and-defect-ledger.mdFull-stack QA department verification architecture, multi-layer acceptance gates (Backend/Security, 5-Pillar SSR/Visual Lock, All 12 Browser Games Interactive & 60 FPS Pacing, Mobile Read-Only Parity), and live closed-loop defect & retest ledger (PRE-001, QA-001..QA-NNN).tests/unit/, tests/integration/, tests/e2e/, mobile/scripts/verify-mobile-contracts.mjs
12ASO & 5-Pillar Dynamic URL Growthgrowth/ASO_AND_5PILLAR_GROWTH_ARCHITECTURE.mdProgrammatic dynamic SSR hubs (/creators/:slug, /engines/:slug, /models/:slug), Google Image Sitemap + /sitemap-index.xml, 38-bot /robots.txt, /ai.txt, /.well-known/llms.txt, RFC 9116 security.txt, live RSS/Atom/JSON feeds, Android/iOS deep links (assetlinks.json, AASA), /app-ads.txt, and Apple App Store + Google Play ASO metadata pack.src/seo/growthCatalog.mjs, src/views/hubViews.mjs, src/routes/discoveryRouter.mjs, src/services/indexNowService.mjs

4. Canonical Visual Reference Assets (Read-Only Immutable Locks)

The two visual design anchor artifacts inside docs/UI/ define the canonical 1:1 atmosphere, typography hierarchy, glassmorphism, color science, and layout geometry for both the web platform and universal mobile/tablet applications:

  • Primary Cosmic Platform Panorama & Full Funnel Reference: docs/UI/your_playgrpound_games_design_1.png (2,806,971 bytes, SHA-256 ACCA31B4AE1CF937EDB649C8C2FBAF8BF13BE733...)
  • Companion AI Studio & Community Remix Reference: docs/UI/Yapay Zekâ Evrenini Oyna ve Yarat-1.png (2,302,623 bytes, SHA-256 9941B38AA52EA25E4BA802F55F85E6FFD3AF49FC...)

[!IMPORTANT]

Both PNG artifacts inside docs/UI/ are governed by a strict read-only preservation invariant. Asset synthesis workflows inspect or crop regions exclusively into isolated scratch buffers and generate clean, text-free high-resolution artwork via gemini-nano-banana-2.1 or gemini-3-pro-image without mutating docs/UI/*.


5. Core Invariants Summary

Invariant DomainCanonical Value / Enforcement MechanismVerification Rung
Local HTTP Port9033 (http://localhost:9033 via server.mjs)Rung 4 (Live HTTP)
Canonical Originhttps://www.yourplayground.games (CANONICAL_ORIGIN in src/seo/metaBuilder.mjs)Rung 2 & Rung 4
Default Coding Modelgemini-4-neon (XHIGH supported, maxOutputTokens >= 32768)Rung 2 & Rung 3
Default Repair Modelgemini-4-carbon (temperature: 0.3, 1-shot structural & vm.Script repair)Rung 2 & Rung 3
Sanitizer ComplexityΘ(N) time and O(N) space in document byte length N; zero backtracking regexesRung 2 (Adversarial)
Game Sandbox<iframe sandbox="allow-scripts allow-pointer-lock"> (origin === "null") + RUNTIME_CSP_HEADERRung 4 (CDP/OOPIF)
Zero Ghost-UI Cacheypg-shell-v2 deletes all key !== CACHE_NAME on activate; skips navigate & text/htmlRung 4 & Rung 5
Language Standard100% English across all code, UI, SSR metadata, JSON-LD, discovery corpora, and docs/*Rung 1 & Rung 5