← All Projects

grim-gambit

A TypeScript monorepo with npm workspaces powering multiple apps — portfolio, dashboard, and shared packages for UI, storage, and AI — all deployed to Cloudflare's edge.

Source Code

Overview

grim-gambit is the monorepo that ties together my entire infrastructure. It uses npm workspaces to share code across multiple applications while keeping each app independently deployable.

Architecture

The monorepo is structured around three layers:

Shared Packages

  • @grim/ui — Reusable UI components (Button, Input, Card) with TypeScript-first APIs
  • @grim/storage — Cloudflare R2 storage abstraction for media and asset management
  • @grim/ai — Multi-provider LLM integration layer supporting Gemini, DeepSeek, and Claude

Applications

  • Portfolio (this site) — Astro 5 static output, zero client-side JavaScript
  • Web Dashboard — Admin interface for managing the platform
  • Crypt Core — API proxy and backend services on Cloudflare Workers

Infrastructure

  • All apps deploy to Cloudflare Pages or Workers
  • BFF pattern with same-origin API proxies via Cloudflare Pages Functions
  • Static assets served from R2 with edge caching

Design Decisions

Why a monorepo? Shared type definitions, consistent tooling, and atomic changes across packages. When I update the Card component in @grim/ui, every app gets the change in the same commit.

Why npm workspaces? Zero additional tooling. It works with Node.js out of the box, and the workspace protocol handles linking cleanly. No need for Turborepo or Nx at this scale.

Why Astro for the portfolio? A portfolio is content-driven. Astro compiles to static HTML with zero JavaScript by default. The result is sub-50ms page loads from any Cloudflare edge location.

Performance

  • Portfolio: 100/100 Lighthouse score (static HTML, no JS bundle)
  • Dashboard: Progressive enhancement — works without JS, enhanced with islands
  • API proxy: Sub-10ms cold starts on Cloudflare Workers