How apteryxxyz/evaluate works
Project type and purpose
• This is a multi-app, monorepo (pnpm workspace + Turborepo) called “Evaluate,” comprising three client-side applications plus shared libraries.
• Purpose: let users run code in any language from anywhere—via a web IDE (Next.js website), a browser extension (Vite-powered), and a Discord bot (Node + discord.js).
File structure
• Top-level “apps/” directory holds three separate apps:
• browser-extension (Vite + TypeScript + React content & background scripts)
• discord-bot (slash commands, event handlers, Node service)
• website (Next.js v14 app directory, React components, serverless API routes)
• “packages/” directory holds reusable modules:
• engine (code-execution logic & remote fetch/compression)
• components, styles (shared React UI)
• Configs: shared tsconfig.*, .env templates, workflows for CI/CD, Husky hooks, Vercel ignore.
README
• Confirms three main products: website, browser extension, Discord bot
• No dedicated “backend” service in repo; execution happens via engine library calling Evaluate’s public API/gateways.
• Analytics with PostHog integrated in clients.
• Website (Next.js)
• Browser Extension (React + background/content scripts)
• Discord Bot (Node service)
• External Services:
• Evaluate Code-Execution API / Runtime cluster
• Discord API
• PostHog Analytics
• Website ←→ engine → Evaluate API → language runtimes → engine → Website
• Browser Extension scripts ←→ engine → Evaluate API → … → Extension
• Discord Bot ←→ engine → Evaluate API → … → Discord Bot → Discord Users
• All three clients send analytic events to PostHog
• Discord Bot interacts with Discord API (slash commands, events)
c. Architectural patterns & principles:
• Monorepo with workspace packages for maximum code reuse
• Clear separation of concerns: UI apps vs core engine vs utilities
• Serverless API routes (Next.js) vs long-running Node process (Discord bot)
• Content scripts + background scripts for extension isolation
d. Key technologies & frameworks:
• Next.js App Router, React, TypeScript
• Vite for extension bundling
• discord.js (or Discord REST/WS) for bot
• Importing shared “engine” module in each client
• pnpm + Turborepo for workspace orchestration
• PostHog for telemetry
Detail
• Break each client into subcomponents if needed (e.g., Next.js SSR vs API routes; extension’s background vs content scripts; bot’s command handlers vs event listeners)
• Environment/config flows (e.g., .env loading, CI pipelines) if they impact deployment