db3.aiVisit main site

11 October 2026

7 Executable Code Examples That Demonstrate Complete Application Patterns

Searching for executable code examples can surface results about binary files. That is not what we mean here. We are looking at source repositories that can be set up, run, observed, tested, and changed as working applications.

The best runnable examples do more than show a clever function. They make the operational contract visible: prerequisites, local dependencies, configuration, seed data, a startup command, and a way to confirm the expected behavior. We selected the examples below because their maintainers document a concrete path to running a recognizable application pattern.

No repository is guaranteed to run unchanged on every machine. Dependency versions, credentials, operating systems, and cloud services still matter. Before you adopt any example, verify its setup path in a clean environment and decide which parts are learning scaffolding versus production-ready policy.

Table of contents

What makes a code example genuinely executable?

We use a practical standard:

  • A defined starting point: a clone, generator, or package installation path.
  • Declared dependencies: databases, containers, credentials, and local tools are named rather than implied.
  • A repeatable run command: the repository tells us how to start the system.
  • An observable outcome: a URL, test, seeded account, API response, or expected job result confirms that it worked.
  • A safe change surface: models, routes, workflows, or services are clear enough to adapt without reverse-engineering the whole codebase.

Visual checklist showing the stages that make a code example truly runnable

1. db3.ai starter: a private-notes application with an optional AI feature

Context. The db3.ai starter application is a focused full-stack slice: account registration, login, private notes, and an optional AI summarization action.

What runs. The guide documents a Vue, DOM Studio, Fastify, and MariaDB setup. After configuring the local database and supplied preview packages, developers apply migrations and start the app with npm run dev. The example also documents checks, builds, and tests.

Why it works as an example. The application connects visible UI behavior to server-owned authorization and persistence. The server assigns note ownership, so the browser does not select the account owner. The optional AI route is deliberately bounded: the key stays server-side, only the selected note is sent, and a missing key leaves the notes feature usable.

Evidence and outcome. The documented acceptance path is concrete: create an account, save a note, reload, sign out, and sign back in to confirm private persistence. The guide also states that the public creator package is not yet published, so teams need matching preview tarballs from a maintainer today.

Transferable lesson. We value examples that explain both the happy path and the boundary conditions. If we adapt this pattern, we would keep policy, authorization, and prompts in application code while relying on reusable services for shared runtime concerns. For the broader runtime model, see application services, durable queues, and durable flows.

Screenshot of db3.ai

2. Next.js SaaS Starter: the SaaS foundation pattern

Context. The official Next.js SaaS Starter concentrates the features that turn a dashboard into a commercial product: authentication, role-based access, teams, subscription management, payment webhooks, and activity logging.

What runs. Its setup path includes installing dependencies, creating local environment settings, migrating and seeding Postgres, then starting the Next.js development server. It also documents Stripe CLI forwarding for testing subscription webhook events locally.

Why it works as an example. The repository exposes the seams that many snippets omit: database state, authentication cookies, protected routes, payment events, and a test account. That makes it useful for tracing a business event from a user action to a persisted subscription change.

Evidence and outcome. The README identifies a local URL and seeded credentials after the database setup. It explicitly describes the project as intentionally minimal and intended as a learning resource, which is an important scope boundary.

Transferable lesson. When evaluating SaaS starters, we look for the lifecycle around a paid action, not merely a checkout button. The runnable loop should include local data, webhook delivery, state updates, and a way to inspect the result.

3. Full Stack FastAPI Template: the contract-first API pattern

Context. The official Full Stack FastAPI Template combines a FastAPI backend with a TypeScript React frontend, PostgreSQL, Docker Compose, authentication, and test tooling.

What runs. The project documents a generator path and separates backend, frontend, development, and deployment guidance. Its declared stack includes validation, an automatically generated frontend client, end-to-end tests, local email testing, and Docker Compose services.

Why it works as an example. This is a strong example of treating the API contract as a product boundary. Input validation, generated client code, frontend calls, and tests work together, reducing the risk that server and browser examples drift apart.

Evidence and outcome. The repository includes Docker Compose, backend and frontend documentation, plus workflows for testing the compose setup and backend. Those assets are evidence of an executable system rather than a collection of isolated endpoints.

Transferable lesson. Choose an example with one source of truth for request and response shapes. We can then extend a feature by changing the server contract, regenerating or updating the client, and testing the completed user journey.

4. Spring PetClinic: the domain-model and persistence pattern

Context. Spring PetClinic is a canonical sample for a server-rendered business application with owners, pets, visits, and veterinarians.

What runs. The repository requires Java 17 or later and starts from Maven or Gradle. The default configuration launches with an in-memory H2 database, while MySQL and PostgreSQL profiles provide a path to persistent local data. Container image and Compose options are documented too.

Why it works as an example. It begins with a low-friction executable default, then makes the production-adjacent persistence choices visible. That progression lets developers understand the domain and request flow before adding infrastructure complexity.

Evidence and outcome. The README provides direct startup commands and a local address. It also identifies test applications and integration-test approaches for the default, MySQL, and PostgreSQL paths.

Transferable lesson. A useful example earns trust when its first run is simple, but its data model is not a toy. Start with a disposable datastore when learning, then make the change to a persistent database an explicit engineering decision.

5. .NET eShop: the orchestrated services pattern

Context. The .NET eShop reference application demonstrates an e-commerce system with a services-based architecture coordinated through .NET Aspire.

What runs. The current project documents prerequisites for the .NET SDK, Aspire CLI, and an OCI-compatible container runtime. From the repository root, aspire run starts the application model and provides a dashboard URL. The project also documents server tests and Playwright browser journeys.

Why it works as an example. Instead of hiding infrastructure, eShop puts orchestration in the runnable developer experience. Developers can inspect the hosted services together, then move from a local system to deployment artifacts with the same application model.

Evidence and outcome. The README describes the AppHost as the selected startup project and includes both server-side and browser-level test commands. It also cautions that its Azure deployment configuration is intended for evaluation and demonstrations, not production data.

Transferable lesson. For multi-service applications, executable examples should give us one command that starts the system and one place to observe it. If running the stack depends on tribal knowledge, it is not yet a reusable example.

6. Google Online Boutique: the distributed-systems learning pattern

Context. Google’s Online Boutique is a cloud-first e-commerce demonstration composed of 11 services in multiple languages communicating over gRPC.

What runs. The project provides Kubernetes deployment instructions, manifests, protocol definitions, a development guide, and variations for observability, service mesh, and other platform concerns. The storefront supports browsing, cart activity, and a mock checkout flow.

Why it works as an example. It makes distributed boundaries tangible. Cart storage, checkout orchestration, currency conversion, recommendations, email, and mock payment behavior live in distinct services, so we can inspect failure points and interfaces rather than treating microservices as an abstract diagram.

Evidence and outcome. The repository documents a deployment path to a Kubernetes cluster and provides commands to inspect pod readiness and access the frontend. It also lists each service, language, and responsibility.

Transferable lesson. This is not the first executable example we would hand to a new product team. It is valuable when the question is architectural: which boundaries deserve separate deployment, ownership, scaling, or failure handling? Start simpler unless those concerns are real.

7. TodoMVC: the controlled comparison pattern

Context. TodoMVC implements the same to-do application across multiple maintained JavaScript frameworks.

What runs. Each example builds and serves itself. The project documents a repeatable path into an individual example and a test command for its curated modern framework set.

Why it works as an example. Every implementation follows the same behavioral specification. That controls for product requirements, so the differences we see are more likely to be framework structure, state handling, routing, and idioms instead of missing features.

Evidence and outcome. The repository identifies maintained implementations for React, Vue, Angular, Svelte, Preact, Lit, and React Redux, and it defines the same user interactions across the examples.

Transferable lesson. When choosing a framework or establishing team conventions, use a controlled executable example before committing to a large starter. A small, comparable application reveals day-to-day ergonomics quickly.

How to adapt an executable example without copying its liabilities

  1. Write down the behavior you need. Select one outcome, such as invite a teammate, create a report, or retry a failed webhook. Do not begin by importing an entire repository.
  2. Run the original cleanly. Use a fresh directory, isolated credentials, and disposable data. Record every undocumented step as a potential adoption risk.
  3. Map the vertical slice. Follow the request or event through UI, validation, authorization, persistence, background work, and tests.
  4. Replace infrastructure deliberately. Keep a local mock or test mode for external payments, email, AI providers, and cloud resources. Never copy sample secrets or point a starter at production data.
  5. Keep the verification loop. Preserve the original acceptance path while changing the domain. A reliable test, seeded state, or repeatable manual check is more valuable than a polished demo screen.

Build the next runnable slice with db3.ai

For a TypeScript product team, start with the db3.ai starter application to study a coherent authentication, data, and optional AI slice. Then extend it through the framework’s application lifecycle, queue examples, and durable flow guide.

We recommend adapting one verified workflow at a time. A small application that a teammate can clone, run, test, and safely modify is a more valuable executable code example than a large repository nobody can confidently operate.