How encoredev/examples works
Project type and purpose
• This is a monorepo that holds:
– Starters: full-stack or microservice example apps (in Go or TypeScript) ready to clone or bootstrap via encore app create.
– Bits: small reusable code modules demonstrating common integrations (e.g., SendGrid, Pexels, ElevenLabs).
• The README describes two categories: Starters (runnable apps) and Bits (libraries/snippets).
File structure
• Top-level contains global assets:
– .gitignore, LICENSE, README.md
– CLI metadata files (cli-templates.json, cli-tutorials.json)
• Template folders – each subfolder (e.g., ai-chat, booking-system, url-shortener, ts/hello-world, etc.) is a standalone example:
– Some in Go (root-level directories like ai-chat, booking-system, hello-world).
– Some in TypeScript (under ts/…).
– Typically include:
• encore.app (Encore configuration)
• service or backend directories (handlers, migrations, DB code)
• frontend (static or React/Next.js code)
• migrations folder with SQL files
• README.md with usage instructions
• bits/ folder contains small Go packages (bits/sendgrid, bits/pexels, etc.) with reusable code and their own README.
README for additional insights
• It enumerates all Starters, grouped by language (TypeScript vs. Go) and by feature set (e.g., “ts/saas-starter”, “hello-world”, “ts/streaming-chat”).
• It enumerates all Bits under bits/, describing the primitives they illustrate (APIs, Pub/Sub, Secrets, etc.).
a. Main Components
– Developer (actor who runs CLI)
– Encore CLI (tool that scaffolds a new app)
– Templates Monorepo
• Starters (folders for full apps)
• Bits (folders for reusable modules)
– GitHub (remote origin)
– Local File System (where CLI copies a selected template)
b. Relationships & Interactions
– Developer ➞ runs Encore CLI ➞ queries Templates Monorepo ➞ clones selected Starter (or copy Bits) into new project directory.
– Starter sub-folder ➞ defines backend, frontend, migrations, configs.
– Bits folder ➞ imported into user’s Encore app as dependencies.
– Encore CLI ➞ interprets encore.app within each Starter to spin up local dev environment.
c. Architectural Patterns & Principles
– Monorepo containing many independent projects
– Template/Scaffolding pattern: reusable boilerplate
– Clear separation between Starters (full apps) and Bits (modules)
– Folder-per-template isolation, each with its own Encore config and code
d. Key Technologies
– Encore (backend framework & CLI)
– Go and TypeScript runtimes
– React/Next.js, static assets (Vite) in frontends
– SQL migrations (PostgreSQL)
– Pub/Sub patterns in some templates (e.g., ai-chat)