Skip to content

Tech Stack

Architecture

┌─────────────────────────────────────────────────────────────────────────┐
│                    PHONY - ARCHITECTURE                                 │
├─────────────────────────────────────────────────────────────────────────┤
│                                                                         │
│  ╔═══════════════════════════════════════════════════════════════════╗ │
│  ║                      OSS LIBRARIES                                 ║ │
│  ╠═══════════════════════════════════════════════════════════════════╣ │
│  ║                                                                    ║ │
│  ║  APPROACH: Pure native implementation per language                 ║ │
│  ║  DEVELOPMENT: AI-assisted (AI writes, human reviews)               ║ │
│  ║  FORMAT: Shared .phony model format (MessagePack)                  ║ │
│  ║                                                                    ║ │
│  ║  TIMELINE:                                                         ║ │
│  ║  ├── Year 1: PHP/Laravel (phonyland/phony)                        ║ │
│  ║  ├── Year 2: Python (phony - pip) ★ Revenue focus                 ║ │
│  ║  ├── Year 3: TypeScript (@phonyland/phony) - Optional             ║ │
│  ║  └── Future: Community contributions for other languages          ║ │
│  ║                                                                    ║ │
│  ║  PERFORMANCE: ~50-100K records/sec (good enough for typical use)   ║ │
│  ║  MAINTENANCE: Community can maintain non-PHP implementations       ║ │
│  ║                                                                    ║ │
│  ╚═══════════════════════════════════════════════════════════════════╝ │
│                                                                         │
│  ╔═══════════════════════════════════════════════════════════════════╗ │
│  ║                      CLOUD PLATFORM                                ║ │
│  ╠═══════════════════════════════════════════════════════════════════╣ │
│  ║                                                                    ║ │
│  ║  STACK: Nuxt + Go + Rust (3 languages)                            ║ │
│  ║                                                                    ║ │
│  ║  ┌─────────────┐   ┌─────────────┐   ┌─────────────┐              ║ │
│  ║  │   NUXT      │   │     GO      │   │    RUST     │              ║ │
│  ║  │  Dashboard  │   │   Engine    │   │    Core     │              ║ │
│  ║  │             │   │             │   │             │              ║ │
│  ║  │ • Vue 3     │   │ • DB Sync   │   │ • N-gram    │              ║ │
│  ║  │ • TypeScript│ → │ • Mock API  │ → │ • Train     │              ║ │
│  ║  │ • Auth      │   │ • Training  │   │ • Generate  │              ║ │
│  ║  │ • Billing   │   │ • pgx (DB)  │   │ • Model I/O │              ║ │
│  ║  │             │   │             │   │             │              ║ │
│  ║  └─────────────┘   └─────────────┘   └─────────────┘              ║ │
│  ║                                                                    ║ │
│  ║  NO LARAVEL: Go handles all backend (sync, API, processing)       ║ │
│  ║  PERFORMANCE: ~5M records/sec (Rust-powered)                      ║ │
│  ║  SCALE: TB-level database sync capable                            ║ │
│  ║                                                                    ║ │
│  ╚═══════════════════════════════════════════════════════════════════╝ │
│                                                                         │
│  ╔═══════════════════════════════════════════════════════════════════╗ │
│  ║                      MONETIZATION                                  ║ │
│  ╠═══════════════════════════════════════════════════════════════════╣ │
│  ║                                                                    ║ │
│  ║  OSS (Free):    Pure native, ~100K/sec, good for typical use      ║ │
│  ║  Cloud (Paid):  Rust-powered, ~5M/sec, TB-scale, Mock API hosting ║ │
│  ║                                                                    ║ │
│  ║  → Heavy users naturally upgrade to Cloud                         ║ │
│  ║  → Clear value differentiation                                    ║ │
│  ║                                                                    ║ │
│  ╚═══════════════════════════════════════════════════════════════════╝ │
│                                                                         │
└─────────────────────────────────────────────────────────────────────────┘

Why This Architecture?

DecisionRationale
No LaravelGo already handles sync/API; Laravel would be overhead
Nuxt for DashboardVue familiarity (from Inertia), TypeScript, easy deploy
Go for EngineBest DB libraries (pgx), great concurrency, fast HTTP
Rust for CoreMaximum N-gram performance, memory efficiency
Pure native OSSEasy install, no binary deps, community maintainable
AI-assisted devMakes unfamiliar languages feasible

Timeline

CLOUD PLATFORM (5-6 months):
├── Week 1-4:   Rust Core (ngram, generator, model)
├── Week 5-10:  Go Engine (sync, mock API, training)
└── Week 11-22: Nuxt Dashboard (UI, auth, billing)

OSS LIBRARIES (parallel):
├── Year 1: PHP/Laravel (alongside Cloud development)
├── Year 2: Python (after Cloud launch, revenue focus)
└── Year 3: TypeScript (optional, based on demand)

Layer Details

Layer 1: Nuxt (TypeScript + Vue)

AspectDetail
PurposeWeb dashboard, auth, billing UI
WhyVue familiarity, TypeScript, easy deploy to Vercel
TechNuxt 3, Vue 3, Auth.js, Stripe SDK

Layer 2: Go Engine

AspectDetail
PurposeDB sync, Mock API server, training orchestration
WhyGoroutines for concurrency, memory efficiency, fast HTTP
TechGo 1.22+, pgx, go-mysql, asynq

Layer 3: Rust Core

AspectDetail
PurposeN-gram train/generate/save/load
WhyMaximum performance for hot path (5M/sec)
TechRust stable, MessagePack (serde), FFI to Go

Communication Flow

Nuxt ──HTTP──► Go Engine ──FFI (CGO)──► Rust Core

AI-Assisted Development

Development leverages AI agents for code generation with human review.

What AI Does Well

  • Writing isolated modules with clear interfaces
  • Test generation
  • Boilerplate and CRUD operations
  • Documentation
  • Code translation between languages

What Needs Human Expertise

  • Architectural decisions
  • Performance optimization strategies
  • Debugging complex issues
  • Security review
  • Production incident response

Language-Specific AI Effectiveness

LanguageAI Code QualityReview Difficulty
TypeScript★★★★★Easy
Go★★★★Medium (readable)
Rust★★★★Hard (lifetimes, borrowing)

Key Insight: AI can write Rust well, but reviewing Rust for correctness requires understanding ownership/borrowing. Go is more forgiving for reviewers.

Phony Cloud Platform Specification