Encore Project Introduction
What is Encore?
Encore is a cutting-edge open-source development platform designed to streamline the creation of robust, type-safe distributed systems. It achieves this through the use of declarative infrastructure, simplifying cloud development from start to finish. Aimed at addressing the complexities that often accompany cloud services, Encore offers a comprehensive toolset for backend development, making it easier for developers to manage infrastructure and DevOps.
Key Features of Encore
-
Backend Frameworks: Encore provides two open-source backend frameworks, Encore.ts and Encore.go, which simplify the process of defining services and APIs. These frameworks also allow developers to declare the needed infrastructure within their code, making the process streamlined and efficient.
-
Local Development Environment: Encore automates local infrastructure setup and offers a built-in development dashboard that includes tools such as Tracing, a Service Catalog, and an API Explorer, enhancing the local development experience.
-
Cloud Infrastructure Integration: With Encore's open-source tools, integrating with cloud infrastructure is a breeze. It also provides a Cloud Platform that automates DevOps processes and infrastructure provisioning on AWS and GCP.
Getting Started with Encore
To start using Encore, developers can install it on their system with simple commands depending on their operating system:
- macOS:
brew install encoredev/tap/encore
- Linux:
curl -L https://encore.dev/install.sh | bash
- Windows:
iwr https://encore.dev/install.ps1 | iex
Once installed, developers can create their first app using TypeScript or Go with simple commands.
How Does Encore Work?
Encore operates by allowing developers to define resources like services and databases directly in their application code as type-safe objects. This setup negates the need for specific cloud service configurations, as Encore takes care of the infrastructure orchestration across different environments. This capability makes Encore's applications highly portable and reduces the need for tools like Terraform.
Example Usage
Using Encore, defining a microservice and API can be done with minimal code. Here’s a simple example in Encore.ts:
import { api } from "encore.dev/api";
export const get = api(
{ expose: true, method: "GET", path: "/hello/:name" },
async ({ name }: { name: string }): Promise<Response> => {
const msg = `Hello ${name}!`;
return { message: msg };
}
);
interface Response {
message: string;
}
Local Development and Testing
With Encore, developers can simulate a cloud environment locally, ensuring the local environment mirrors the cloud setup. The platform also includes tools for efficient local development of microservices with features like type-safety, secrets management, tracing, and automatic API documentation.
Testing is straightforward, with built-in capabilities for API mocking and dedicated infrastructure for running local tests. This ensures that developers can isolate and execute tests effectively, with distributed tracing available for in-depth debugging.
DevOps Automation with Encore Cloud Platform
Encore’s Cloud Platform offers automated infrastructure provisioning, reducing the need for manual setups or extensive configuration files. It supports a wide range of services, including compute, databases, and caching, on both AWS and GCP. Additionally, Encore provides tools for cost management, logging, metrics, and infrastructure change tracking, significantly cutting down DevOps workloads.
Why Choose Encore?
Encore is ideal for developers seeking faster development with reduced costs and complexity. It empowers users to build scalable applications efficiently while maintaining control and standardization. By automating infrastructure management and providing robust development tools, Encore enhances security, ensures compliance, and facilitates creative software development.
Joining the Encore Community
Developers can become part of the vibrant Encore community, where they can exchange ideas, contribute to the project, or seek assistance. Encore is open-source, enabling developers to contribute and customize the platform as needed. Joining their Discord community allows developers to collaborate and stay updated on new features and improvements.