Defang Samples

April 4, 2026 ยท View on GitHub

Samples to show you how to develop, deploy, and debug cloud applications with Defang.

Browse through the ./samples directory, or search and browse in the docs.

Adding Samples

To start working on a new sample, run . ./scripts/new-sample from the root of the repository. This will create a new sample directory, with some basic scaffolding to get you started. Look for #REMOVE_ME_AFTER_EDITING in your new project to look for things that you should probably be changing/checking per sample. Feel free to remove files, like compose.dev.yaml if they aren't necessary for your sample.

Testing Samples

When you add a new sample, make sure to add any config vals to the deploy-changed-samples.yml workflow. They need to be prefixed with TEST_ and those values need to be set in the repo secrets. NOTE at the moment test break if we have a config value that only shows up in string interpolation in a longer string, for example in ENV_NAME: proto://user:${PASSWORD}@host if PASSWORD only ever shows up in that longer string, it will break the test. A workaround is to just add a line with PASSWORD: in the environment section, so the test can pick it up. Ugly, but works for now.

Available Samples

SampleDescriptionTagsLanguages
Agentic AutogenAn Autogen agent application using Mistral and FastAPI, deployed with Defang.Agent, Autogen, Mistral, FastAPI, Vite, React, Python, JavaScript, AIPython, JavaScript
Agentic LangGraphA LangGraph Agent application that can use tools, deployed with Defang.Agent, LangGraph, LangChain, AI, OpenAI, TavilyTypeScript
Agentic StrandsA Strands Agent application, deployed with Defang.Python, Flask, Strands, AI, AgentPython
Angular & Node.jsA full-stack application using Angular for the frontend and Node.js with Socket.IO for the backend, containerized with Docker.Angular, Node.js, Socket.IO, TypeScript, JavaScriptnodejs
Arduino Flask Wifi ServerAn Arduino wifi server built with Flask.Arduino, Flask, Python, IoT, Wifi, Serialpython
BullMQ & BullBoard & RedisA sample project with BullMQ, BullBoard, and Redis.BullMQ, BullBoard, Redis, Express, Node.js, Message Queue, JavaScriptnodejs
Crew.ai Django SampleA sample application that uses Crew.ai to summarize text in a background task, streamed to the user in real-time.Django, Celery, Redis, Postgres, AI, MLPython
C# & ASP.NET CoreA simple task manager application using C# and ASP.NET Core.ASP.NET Core, JavaScript, C#C#
DjangoA simple Django app that uses SQLite as the database.Django, SQLite, Pythonpython
Django CeleryA Django application that uses Celery for background tasks, Postgres as the database, and Redis as the message broker.Django, Celery, Postgres, Redispython, sql
Django Channels & Redis & PostgresA basic configuration of Django Channels with Redis and Postgres demonstrating a simple chat application.Django, Channels, Redis, Postgres, Chat, ApplicationPython
Django & PostgreSQLA customer relationship management list project developed using the Python Django framework, offering a starting point to help you quickly build your customer management system.Django, PostgreSQL, Python, SQLpython
DjangoA simple Django app that uses SQLite as the database.Django, SQLite, Python, Railpackpython
Elysia & BunA basic Elysia app running on Bun with Defang.Bun, Elysia, TypeScript, JavaScriptnodejs
FastAPIA sample project demonstrating how to deploy FastAPI with Defang.FastAPI, OpenAPI, Pythonpython
FastAPI & PostgreSQLA sample project with FastAPI and PostgreSQL.FastAPI, PostgreSQL, Python, SQLpython
FastAPI Postgres Pub/SubFastAPI sample that stores messages in Postgres and streams them to two app instances via LISTEN/NOTIFY.FastAPI, PostgreSQL, WebSockets, PubSubPython, SQL
Feathers.jsA sample project demonstrating how to deploy a Feathers.js application using Defang. The application displays "DefangxFeathersjs" on the webpage.Feathers.js, Node.js, JavaScriptnodejs
FlaskA basic Flask to-do app.Flask, Pythonpython
FlaskA basic Flask to-do app.Flask, Python, Railpackpython
Go HTTP ServerA simple Go application that echoes back the request.Go, HTTPgolang
Go HTTP FormA simple Go application that demonstrates form submission using the net/http library.Go, HTTPgolang
Go HTTP FormA simple Go application that demonstrates form submission using the net/http library.Go, HTTP, Railpackgolang
Go & MongoDBA simple Go application that manages tasks with MongoDB.Go, MongoDB, Atlas, Task Managergolang
Go & OpenAIA simple Go application that interacts with the OpenAI API.Go, OpenAI, ChatGPTgolang
Go & REST APIA simple Go application that fetches fiscal data from an API.Go, HTTP, Fiscal Data, REST APIgolang
Go & S3A simple Go application that uploads and downloads files from AWS S3.Go, S3, AWSgolang
Go & Slack APIA simple Slackbot that posts messages to a Slack channel.Go, Slack, Botgolang
Google ADKA simple sample demonstrating how to deploy agents build with Google ADK to Defang.Google ADK, Python, Agentspython
Hasura & PostgreSQLA sample project demonstrating how to deploy Hasura with Defang and connect it to a PostgreSQL database.Hasura, GraphQL, PostgreSQL, DatabaseSQL, GraphQL
HTML & CSS & JavaScriptA simple HTML, CSS and JavaScript website running on Defang.HTML, CSS, JavaScript, Frontendnodejs
HuginnA system for building agents that perform automated tasks for you online.Huginn, Agents, AutomationDockerfile
ImgProxyA fast and secure standalone server for resizing and converting remote imagesImgproxy, Images, ServerN/A
JavalinA short hello world application demonstrating how to deploy Javalin onto Defang.Javalin, Java, Mavenjava
Jupyter & PostgresThis sample shows you how to spin up a postgres database and a Jupyter notebook server.Jupyter, Postgres, DatabasePython, SQL
LangChain & FlaskA sample project demonstrating how to deploy LangChain with Flask on Defang.LangChain, Flask, AI, Pythonpython
Managed LLMAn app using Managed LLMs with Defang's OpenAI Access Gateway.LLM, OpenAI, Python, Bedrock, VertexPython
Managed LLM with Docker Model ProviderAn app using Managed LLMs with a Docker Model Provider, deployed with Defang.LLM, Python, Bedrock, Vertex, Docker Model ProviderPython
Mastra & Next.jsAn AI-powered tool for chatting with GitHub repositories using Mastra and Google Gemini.AI, GitHub, Mastra, Next.js, PostgreSQL, TypeScriptTypeScript, JavaScript, Docker
Mastra & Next.js & PostgreSQL & RedisA multi-service Mastra support and ops copilot with background jobs, PostgreSQL, Redis, and managed LLM access.Mastra, Next.js, PostgreSQL, Redis, BullMQ, AI, Agents, Support, OperationsTypeScript, JavaScript, Docker
Model Context Protocol (MCP) ChatbotAn MCP (Model Context Protocol) chatbot assistant built with Next.js, Python, and Anthropic Claude.MCP, Next.js, Python, Quart, Claude, AI, Anthropic, TypeScript, React, JavaScriptnodejs, python
Metabase & PostgreSQLA simple Metabase configuration with a PostgreSQL database.Metabase, PostgreSQL, Analytics, DatabaseSQL
n8nA n8n app running on Defang.n8n, PostgreSQL, DockerDocker, Shell
Next.jsA basic Next.js app.Next.js, React, Docker, Node.js, TypeScript, JavaScript, Staticnodejs
Next.js BlogA starter project developed using Next.js designed to make it easy to launch a blog.Next.js, Blog, Node.js, React, MDX, TypeScript, JavaScriptnodejs
Next.js & ClaudeA fun chatbot created with Next.js and Claude.Next.js, TypeScript, React, JavaScript, Chatbot, Claude, AI, AnthropicTypeScript
Next.js CVA Next.js web app that displays a minimalist CV.Next.js, React, TypeScript, JavaScriptnodejs
NextraA documentation starter project developed using Nextra designed to streamline the creation of your documentation.Next.js, Documentation, Nextra, Knowledgebase, Node.js, JavaScript, TypeScriptnodejs
Next.js & PostgresA sample Next.js application that uses Postgres as a database.Next.js, Postgres, Database, Node.jsTypeScript, JavaScript
Next.jsA basic Next.js app.Next.js, React, Node.js, TypeScript, JavaScript, Static, Railpacknodejs
NocoDBAn open source alternative to AirTable.NocoDBDockerfile
Node.js & SocketIOA minimal chat application that shows how to use Socket.IO with Node.js.Node.js, Chat, Socket.IO, JavaScriptnodejs
Node.js & ExpressA Node.js application that inspects and displays detailed information about incoming HTTP requests.Node.js, Express, HTTP, Request, Inspector, JavaScriptnodejs
Node.js Express FormA Node.js application that handles form submissions using the Express framework.Node.js, Express, HTTP, JavaScriptnodejs
Node.js HTTP ServerA simple Node.js application that creates an HTTP server.Node.js, HTTP, Servernodejs
Node.js & OpenAIA simple Node.js application that interacts with the OpenAI API.Node.js, OpenAI, API, JavaScriptnodejs
Node.js & React & PostgreSQLA full-stack to-do list application.Node.js, React, Full-stack, PostgreSQL, JavaScript, SQLnodejs
Node.js & REST APIA simple Node.js application that creates a REST API and fetches data from the U.S. Department of the Treasury's Fiscal Data API.Node.js, REST API, JavaScriptnodejs
Node.js & S3A simple Node.js application that uploads and downloads files from AWS S3.Node.js, S3, AWS, JavaScriptnodejs
NounlyA URL shortener website built with Go, JavaScript, and Redis.Go, JavaScript, Redis, URL shortenergolang, javascript
OllamaOllama is a tool that lets you easily run large language models.AI, LLM, ML, Llama, Mistral, Next.js, AI SDK,Typescript
Phoenix & PostgreSQLA sample Phoenix application that uses a PostgreSQL database.Phoenix, PostgreSQL, Database, ElixirElixir
PlatformaticA sample project showcasing a simple Platformatic service with Docker deployment.Platformatic, Defang, Docker, Node.js, Service, JavaScriptnodejs
PulumiA basic Pulumi example.Pulumi, Node.js, HTTP, Server, TypeScriptnodejs
Pulumi & Remix & PostgreSQLA full-stack example using Remix, Prisma, and Aiven.Full-stack, Remix, Prisma, Aiven, PostgreSQL, Pulumi, Node.js, TypeScript, SQLnodejs
Python & FormA short Python example for form submission in Flask.Python, Flask, Formpython
Python & Implicit & GPUA Music Recommendation API that provides artist recommendations based on collaborative filtering using the ALS algorithm from the Implicit library, leveraging a GPU.Music, Recommendation, API, Collaborative Filtering, Implicit, GPU, Pythonpython
Python & Flask & HTTPA Flask application that inspects and returns detailed information about HTTP requests.Flask, HTTP, Pythonpython
Python & Flask & OpenAIAn app that demonstrates how to use the OpenAI API with Python and Flask.Python, Flask, OpenAI, AI, Pythonpython
Python & REST APIA Flask application that fetches average interest rates from the Fiscal Data Treasury API.Flask, REST API, Pythonpython
Python & Flask & AWS S3An app that demonstrates how to upload and download files from AWS S3 using Python and Flask.Python, Flask, AWS, S3python
Ruby on RailsA basic member list project developed using Ruby on Rails.Ruby, RailsRuby
ReactA minimal React app running on Defang.React, Vite, JavaScript, FrontendJavaScript
ReactA minimal React app running on Defang.React, Vite, JavaScript, Frontend, RailpackJavaScript
Redis & JavaScriptA Redis and JavaScript application, deployed with Defang.Redis, JavaScriptJavaScript
RocketA simple Rocket app.RocketRust
Sails.jsA short hello world application demonstrating how to deploy Sails.js onto Defang.Sails.js, Node.jsnodejs
Sails.js & PostgreSQLA sample project demonstrating how to deploy a project with PostgreSQL and Sails.js.PostgreSQL, Sails.js, SQL, JavaScriptnodejs
Svelte & Node.js & MySQLA full-stack application using Svelte for the frontend, Node.js for the backend, and MySQL for the database.Svelte, Node.js, MySQL, Full-stack, JavaScript, TypeScript, SQLnodejs
SvelteKitA minimal SvelteKit app running on Defang.SvelteKit, TypeScript, JavaScript, Svelte, Node.js, Frontend, TypeScript, JavaScriptnodejs
SvelteKit & MongoDBA full-stack application using SvelteKit for the frontend and MongoDB for the database.SvelteKit, MongoDB, Full-stack, Node.js, JavaScriptnodejs
Mistral & vLLMDeploy Mistral with a custom UI using vLLM.Mistral, vLLM, AI, Nextjs, GPU, Node.js, TypeScript, JavaScriptnodejs
Vue.jsA minimal Vue.js app running on Defang.Vue.js, Vite, Node.js, Frontend, JavaScriptnodejs

This list is auto-generated. Run node scripts/generate-samples-list.js to update.