: Automatically sets up PostgreSQL databases, Pub/Sub topics, and Cron jobs based on your code declarations.
It is still young (first stable release in late 2024), but for greenfield projects, it represents a genuine leap forward in TypeScript backend ergonomics.
my-app/ ├── encore.app # Application configuration (ID, global settings) ├── package.json # Standard Node dependencies ├── tsconfig.json # TypeScript configuration └── src/ # Your application code └── greeting/ # A "Service" (Encore's primary building block) ├── service.ts # Service definition └── greeting.ts # API endpoints
To run the application locally, Encore sets up a local environment including the database. encore ts
Encore.ts is a high-performance backend framework designed for building distributed systems and event-driven architectures with TypeScript. It distinguishes itself by integrating a Rust-based runtime with the Node.js ecosystem, aiming to eliminate much of the boilerplate associated with traditional backend development. What is Encore.ts?
export const addTodo = api( method: "POST", path: "/todo" , async (req: title: string ): Promise<TodoItem> => // Insert and return the result const result = await todoDB.queryRow<TodoItem>` INSERT INTO todo_items (title, done) VALUES ($req.title, false) RETURNING * `; return result!;
Encore comes with a built-in local development dashboard. When you run encore run , look for a link to the "Local Dashboard" (usually http://localhost:9400 ). Encore
interface AuthData userID: string;
Encore.ts treats background jobs as first-class citizens. You define a queue, and Encore handles the message broker (e.g., Redis, SQS, GCP Pub/Sub):
Encore will automatically:
src/todo/endpoint.ts
// Define a request interface interface TodoRequest title: string;